/* ==========================================================================
   Component stylesheet
   Every value comes from tokens.css (custom properties). Class prefix: bp-
   Breakpoints are literal in @media (CSS cannot read vars there):
   sm 600 · md 768 · lg 1024 · xl 1280 · 2xl 1440 — keep in sync with bp-* tokens.
   ========================================================================== */

/* ---------- 0. Base ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--selection); color: var(--text); }
:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
:focus:not(:focus-visible) { outline: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
.bp-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bp-skip { position: absolute; left: var(--space-4); top: -100px; z-index: var(--z-tooltip); background: var(--surface-raised); color: var(--text); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.bp-skip:focus { top: var(--space-2); }

/* Type helpers — fluid versions of the type styles */
.bp-display { font: var(--display-weight, 620) var(--fs-display)/0.98 var(--font-sans); letter-spacing: -0.04em; text-wrap: balance; }
.bp-h1 { font: 600 var(--fs-h1)/1.04 var(--font-sans); letter-spacing: -0.032em; text-wrap: balance; }
.bp-h2 { font: 600 var(--fs-h2)/1.08 var(--font-sans); letter-spacing: -0.026em; text-wrap: balance; }
.bp-h3 { font: 600 var(--fs-h3)/1.2 var(--font-sans); letter-spacing: -0.016em; text-wrap: balance; }
.bp-h4 { font: 600 var(--fs-h4)/1.3 var(--font-sans); letter-spacing: -0.008em; }
.bp-lead { font: 400 var(--fs-lead)/1.5 var(--font-sans); letter-spacing: -0.006em; color: var(--text-muted); max-width: 60ch; text-wrap: pretty; }
.bp-body { font: 400 var(--fs-body)/1.6 var(--font-sans); max-width: 72ch; text-wrap: pretty; }
.bp-body-sm { font: 400 var(--fs-body-sm)/1.55 var(--font-sans); }
.bp-caption { font: 400 13px/1.45 var(--font-sans); color: var(--text-subtle); }
.bp-mono-label { font: 500 12px/1.33 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle); }
.bp-mono-sm { font: 400 13px/1.54 var(--font-mono); font-variant-numeric: tabular-nums; }
.bp-mono-md { font: 400 15px/1.6 var(--font-mono); letter-spacing: -0.01em; }
.bp-muted { color: var(--text-muted); }
.bp-subtle { color: var(--text-subtle); }
.bp-clamp-2, .bp-clamp-3, .bp-clamp-4 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.bp-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.bp-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }
.bp-clamp-4 { -webkit-line-clamp: 4; line-clamp: 4; }
.bp-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bp-break { overflow-wrap: anywhere; }

/* ---------- 1. Layout -------------------------------------------------- */
.bp-container { width: 100%; max-width: calc(var(--container-content) + 2 * var(--page-margin)); margin-inline: auto; padding-inline: var(--page-margin); }
.bp-container--wide { max-width: calc(var(--container-wide) + 2 * var(--page-margin)); }
.bp-container--prose { max-width: calc(var(--container-prose) + 2 * var(--page-margin)); }
.bp-grid { display: grid; grid-template-columns: repeat(var(--grid-cols-base), minmax(0, 1fr)); column-gap: var(--gutter-base); row-gap: var(--space-6); }
@media (min-width: 768px) { .bp-grid { grid-template-columns: repeat(var(--grid-cols-md), minmax(0, 1fr)); column-gap: var(--gutter-md); } }
@media (min-width: 1024px) { .bp-grid { grid-template-columns: repeat(var(--grid-cols-lg), minmax(0, 1fr)); } }
@media (min-width: 1280px) { .bp-grid { column-gap: var(--gutter-xl); } }
.bp-section { padding-block: var(--space-section); }
.bp-stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--space-4)); }
.bp-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--row-gap, var(--space-3)); }

/* Blueprint paper: minor 24px + major 96px grid, fading out. Decorative. */
.bp-gridpaper { position: relative; isolation: isolate; }
.bp-gridpaper::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--bg-grid) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--bg-grid) 55%, transparent) 1px, transparent 1px);
  background-size: var(--space-24) var(--space-24), var(--space-24) var(--space-24), var(--space-6) var(--space-6), var(--space-6) var(--space-6);
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}
.bp-gridpaper--full::before { -webkit-mask-image: none; mask-image: none; }

/* Crop marks at the four corners (drawing frame). Decorative. */
.bp-ticks {
  --tick: 12px; --tick-c: var(--border-strong);
  background-image:
    linear-gradient(var(--tick-c), var(--tick-c)), linear-gradient(var(--tick-c), var(--tick-c)),
    linear-gradient(var(--tick-c), var(--tick-c)), linear-gradient(var(--tick-c), var(--tick-c)),
    linear-gradient(var(--tick-c), var(--tick-c)), linear-gradient(var(--tick-c), var(--tick-c)),
    linear-gradient(var(--tick-c), var(--tick-c)), linear-gradient(var(--tick-c), var(--tick-c));
  background-size: var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick);
  background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
}

/* Node: the C4 «box» glyph — status shape + colour, never colour alone */
.bp-node { display: inline-block; width: 8px; height: 8px; flex: none; border: 1.5px solid currentColor; background: currentColor; }
.bp-node--hollow { background: transparent; }
.bp-node--half { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.bp-node--dashed { border-style: dashed; background: transparent; border-width: 1px; }
.bp-node--slashed { background: linear-gradient(135deg, transparent 42%, currentColor 42% 58%, transparent 58%); }

/* Section head: «03 / ОПЫТ ———————— 2013—2026» then the title */
.bp-section-head { display: grid; gap: var(--space-4); margin-bottom: var(--space-block); }
.bp-section-head__bar { display: flex; align-items: center; gap: var(--space-3); }
.bp-section-head__bar::after { content: ""; order: 1; flex: 1; height: 1px; background: var(--border-subtle); }
.bp-section-head__index { order: 0; }
.bp-section-head__meta { order: 2; }
.bp-section-head__title { max-width: 22ch; }
.bp-section-head__intro { margin-top: var(--space-1); }
@media (min-width: 1024px) {
  .bp-section-head--split { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter-md); align-items: end; }
  .bp-section-head--split .bp-section-head__bar { grid-column: 1 / -1; }
  .bp-section-head--split .bp-section-head__title { grid-column: 1 / 7; }
  .bp-section-head--split .bp-section-head__intro { grid-column: 8 / -1; margin: 0; }
}

/* Kicker: node + mono label */
.bp-kicker { display: inline-flex; align-items: center; gap: var(--space-2); }
.bp-kicker .bp-node { color: var(--accent); }

/* ---------- 2. Button -------------------------------------------------- */
.bp-btn {
  --h: var(--control-h-md); --px: var(--space-4); --ic: var(--icon-md);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--h); padding: 0 var(--px); border: 1px solid transparent; border-radius: var(--radius-sm);
  font: 520 14px/1 var(--font-sans); letter-spacing: 0; white-space: nowrap; text-decoration: none;
  background: transparent; color: var(--text); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.bp-btn > svg { width: var(--ic); height: var(--ic); flex: none; }
.bp-btn--sm { --h: var(--control-h-sm); --px: var(--space-3); --ic: var(--icon-sm); font-size: 13px; }
.bp-btn--lg { --h: var(--control-h-lg); --px: var(--space-6); font-size: 15px; }
.bp-btn--block { width: 100%; }
.bp-btn--primary { background: var(--accent); color: var(--text-on-accent); }
.bp-btn--primary:hover { background: var(--accent-hover); }
.bp-btn--primary:active { background: var(--accent-active); }
.bp-btn--secondary { border-color: var(--border); }
.bp-btn--secondary:hover { border-color: var(--border-strong); background: var(--surface-sunken); }
.bp-btn--secondary:active { background: var(--bg-grid); }
.bp-btn--ghost:hover { background: var(--surface-sunken); }
.bp-btn--ghost:active { background: var(--bg-grid); }
.bp-btn--danger { background: var(--danger); color: var(--bg); }
.bp-btn--danger:hover { background: color-mix(in srgb, var(--danger) 86%, var(--text)); }
.bp-btn--danger-ghost { color: var(--danger); }
.bp-btn--danger-ghost:hover { background: var(--danger-subtle); }
.bp-btn--link { --h: auto; --px: 0; height: auto; padding: 0; border: 0; color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.bp-btn--link:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
.bp-btn--icon { width: var(--h); padding: 0; }
.bp-btn:is([disabled], [aria-disabled="true"]) { cursor: not-allowed; background: var(--surface-sunken); border-color: transparent; color: var(--text-disabled); }
.bp-btn:is(.bp-btn--ghost, .bp-btn--link, .bp-btn--danger-ghost):is([disabled], [aria-disabled="true"]) { background: transparent; }
.bp-btn[aria-busy="true"] { cursor: progress; }
.bp-btn[aria-busy="true"] > :not(.bp-spinner) { visibility: hidden; }
.bp-btn[aria-busy="true"] > .bp-spinner { position: absolute; inset: 0; margin: auto; }
@media (pointer: coarse) {
  .bp-btn::after { content: ""; position: absolute; inset: min(0px, calc((var(--h) - var(--touch-target)) / 2)); }
  .bp-btn--link::after { inset: -8px; }
}

/* ---------- 3. Link ---------------------------------------------------- */
.bp-link { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); border-radius: 1px; transition: color var(--duration-fast) var(--ease-standard), text-decoration-color var(--duration-fast) var(--ease-standard); }
.bp-link:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
.bp-link--quiet { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.bp-link--quiet:hover { color: var(--accent); }
.bp-link--standalone { display: inline-flex; align-items: center; gap: var(--space-1); text-decoration: none; font-weight: 520; }
.bp-link--standalone:hover { text-decoration: underline; text-underline-offset: 0.22em; }
.bp-link svg { display: inline-block; width: 0.95em; height: 0.95em; vertical-align: -0.1em; }

/* ---------- 4. Badge (status) & Tag (stack) ---------------------------- */
.bp-badge {
  --c: var(--text-muted); --g: var(--surface-sunken);
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 var(--space-2);
  border-radius: var(--radius-xs); background: var(--g); color: var(--c);
  font: 500 12px/1 var(--font-mono); letter-spacing: 0.01em; white-space: nowrap; vertical-align: middle;
}
.bp-badge .bp-node { width: 7px; height: 7px; }
.bp-badge--accent { --c: var(--accent); --g: var(--accent-subtle); }
.bp-badge--success { --c: var(--success); --g: var(--success-subtle); }
.bp-badge--warning { --c: var(--warning); --g: var(--warning-subtle); }
.bp-badge--danger { --c: var(--danger); --g: var(--danger-subtle); }
.bp-badge--info { --c: var(--info); --g: var(--info-subtle); }
.bp-badge--marker { --c: var(--marker); --g: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.bp-badge--outline { --g: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.bp-badge--sm { height: 18px; padding: 0 6px; font-size: 11px; }

.bp-tag {
  display: inline-flex; align-items: center; gap: var(--space-1); height: 24px; padding: 0 var(--space-2);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: transparent; color: var(--text-muted);
  font: 400 12.5px/1 var(--font-mono); white-space: nowrap; text-decoration: none; max-width: 100%;
}
.bp-tag > span { overflow: hidden; text-overflow: ellipsis; }
a.bp-tag:hover { border-color: var(--border); color: var(--text); }
.bp-tag--more { color: var(--text-subtle); border-style: dashed; }
.bp-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }

/* ---------- 5. Chip (filter) ------------------------------------------ */
.bp-chip {
  display: inline-flex; align-items: center; gap: 6px; height: var(--control-h-sm); padding: 0 var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-xs); background: transparent; color: var(--text);
  font: 500 13px/1 var(--font-mono); cursor: pointer; white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.bp-chip:hover { background: var(--surface-sunken); border-color: var(--border-strong); }
.bp-chip svg { width: 14px; height: 14px; display: none; }
.bp-chip[aria-pressed="true"], .bp-chip[aria-checked="true"] { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }
.bp-chip[aria-pressed="true"] svg, .bp-chip[aria-checked="true"] svg { display: block; }
.bp-chip__count { color: var(--text-subtle); font-size: 12px; }
.bp-chip[aria-pressed="true"] .bp-chip__count { color: inherit; }
.bp-chip:is([disabled], [aria-disabled="true"]) { cursor: not-allowed; color: var(--text-disabled); border-color: var(--border-subtle); background: transparent; }
.bp-chipbar { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 599px) { .bp-chipbar--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--page-margin) * -1); padding-inline: var(--page-margin); scroll-padding-inline: var(--page-margin); } .bp-chipbar--scroll::-webkit-scrollbar { display: none; } }

/* ---------- 6. Avatar -------------------------------------------------- */
.bp-avatar { --s: 32px; position: relative; display: inline-grid; place-items: center; width: var(--s); height: var(--s); flex: none; border-radius: var(--radius-full); overflow: hidden; background: var(--accent-subtle); color: var(--accent); font: 600 calc(var(--s) * 0.38)/1 var(--font-sans); letter-spacing: 0.02em; box-shadow: inset 0 0 0 1px var(--border-subtle); user-select: none; }
.bp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bp-avatar--xs { --s: 20px; } .bp-avatar--sm { --s: 24px; } .bp-avatar--lg { --s: 40px; } .bp-avatar--xl { --s: 64px; }

/* ---------- 7. Tooltip ------------------------------------------------- */
.bp-tooltip { position: relative; z-index: var(--z-tooltip); max-width: 260px; padding: 6px var(--space-2); border-radius: var(--radius-xs); background: var(--surface-inverse); color: var(--text-inverse); font: 400 12px/1.4 var(--font-mono); box-shadow: var(--shadow-sm); }
.bp-tooltip::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; margin-left: -4px; background: inherit; transform: rotate(45deg); }
.bp-tooltip kbd { font: inherit; padding: 0 4px; border: 1px solid color-mix(in srgb, var(--text-inverse) 40%, transparent); border-radius: 2px; margin-left: 6px; }

/* ---------- 8. Divider ------------------------------------------------- */
.bp-divider { border: 0; height: 1px; background: var(--border-subtle); margin: 0; }
.bp-divider--strong { background: var(--border-strong); }
.bp-divider--dashed { background: none; border-top: 1px dashed var(--border); height: 0; }
.bp-divider--vertical { width: 1px; height: auto; align-self: stretch; }
.bp-divider-label { display: flex; align-items: center; gap: var(--space-3); }
.bp-divider-label::before, .bp-divider-label::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }
/* Dimension line |———| with end ticks — metrics, scale bars */
.bp-dim { position: relative; height: 9px; border: 0; margin: 0; }
.bp-dim::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--connector); }
.bp-dim::after { content: ""; position: absolute; inset: 0; border-inline: 1px solid var(--connector); }

/* ---------- 9. Skeleton (hatched — an undrawn area) & Spinner --------- */
.bp-skeleton {
  display: block; border-radius: var(--radius-xs); background-color: var(--surface-sunken);
  background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--border-subtle) 70%, transparent) 0 1px, transparent 1px 7px);
  animation: bp-pulse calc(var(--duration-slower) * 3) var(--ease-standard) infinite;
}
.bp-skeleton--text { height: 0.8em; margin-block: 0.35em; }
.bp-skeleton--circle { border-radius: var(--radius-full); }
@keyframes bp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.bp-spinner { --s: 16px; display: inline-block; width: var(--s); height: var(--s); flex: none; border: 1.5px solid color-mix(in srgb, currentColor 22%, transparent); border-top-color: currentColor; border-radius: 50%; animation: bp-spin 0.8s linear infinite; }
.bp-spinner--md { --s: 20px; } .bp-spinner--lg { --s: 32px; border-width: 2px; }
@keyframes bp-spin { to { transform: rotate(360deg); } }
.bp-progress { height: 4px; border-radius: 2px; background: var(--surface-sunken); overflow: hidden; }
.bp-progress > span { display: block; height: 100%; background: var(--accent); transition: width var(--duration-base) var(--ease-standard); }
@media (prefers-reduced-motion: reduce) {
  .bp-skeleton { animation: none !important; }
  .bp-spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; } /* essential indicator: slowed, not removed */
}

/* ---------- 10. Toast -------------------------------------------------- */
.bp-toast-region { position: fixed; z-index: var(--z-toast); right: var(--space-4); bottom: var(--space-4); display: grid; gap: var(--space-2); width: min(400px, calc(100vw - 2 * var(--space-4))); list-style: none; margin: 0; padding: 0; }
.bp-toast {
  --c: var(--text-muted);
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: start;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  background: var(--surface-raised); color: var(--text); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  animation: bp-toast-in var(--duration-slow) var(--ease-enter);
}
.bp-toast__icon { color: var(--c); width: var(--icon-md); height: var(--icon-md); margin-top: 1px; }
.bp-toast__title { font: 600 14px/1.43 var(--font-sans); }
.bp-toast__desc { font: 400 13px/1.45 var(--font-sans); color: var(--text-muted); margin-top: 2px; }
.bp-toast__actions { display: flex; gap: var(--space-3); margin-top: var(--space-2); }
.bp-toast--success { --c: var(--success); } .bp-toast--danger { --c: var(--danger); } .bp-toast--warning { --c: var(--warning); } .bp-toast--info { --c: var(--info); }
@keyframes bp-toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 599px) { .bp-toast-region { left: var(--space-4); right: var(--space-4); width: auto; bottom: max(var(--space-4), env(safe-area-inset-bottom)); } }

/* ---------- 11. Overlay, Dialog, Sheet -------------------------------- */
.bp-overlay { position: fixed; inset: 0; z-index: var(--z-overlay); background: var(--overlay); animation: bp-fade var(--duration-slow) var(--ease-enter); }
.bp-dialog {
  position: fixed; z-index: var(--z-modal); left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; width: min(var(--dialog-w, 480px), calc(100vw - 2 * var(--space-4))); max-height: calc(100dvh - 2 * var(--space-8));
  background: var(--surface-raised); color: var(--text); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  animation: bp-dialog-in var(--duration-slow) var(--ease-enter);
}
.bp-dialog--lg { --dialog-w: 720px; }
.bp-dialog__head { display: flex; align-items: start; gap: var(--space-3); padding: var(--space-5) var(--space-5) 0 var(--space-6); }
.bp-dialog__title { flex: 1; font: 600 18px/1.35 var(--font-sans); letter-spacing: -0.008em; padding-top: 6px; }
.bp-dialog__body { padding: var(--space-3) var(--space-6) var(--space-2); overflow: auto; color: var(--text-muted); font-size: 15px; }
.bp-dialog__foot { display: flex; justify-content: flex-end; gap: var(--space-3); padding: var(--space-5) var(--space-6) var(--space-6); }
@keyframes bp-fade { from { opacity: 0; } }
@keyframes bp-dialog-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } }
@media (max-width: 599px) {
  .bp-dialog { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: calc(100dvh - var(--space-12)); border-radius: var(--radius-md) var(--radius-md) 0 0; padding-bottom: env(safe-area-inset-bottom); animation-name: bp-sheet-up; }
  .bp-dialog__foot { flex-direction: column-reverse; }
  .bp-dialog__foot > .bp-btn { width: 100%; height: var(--control-h-lg); }
}
@keyframes bp-sheet-up { from { transform: translateY(16px); opacity: 0; } }
.bp-sheet { position: fixed; z-index: var(--z-modal); top: 0; right: 0; bottom: 0; width: min(360px, 100vw); display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--border-subtle); box-shadow: var(--shadow-lg); animation: bp-sheet-in var(--duration-slow) var(--ease-enter); }
@keyframes bp-sheet-in { from { transform: translateX(24px); opacity: 0; } }
/* Preview helper: render overlays in flow */
.bp-static { position: relative !important; inset: auto !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; transform: none !important; animation: none !important; }

/* ---------- 12. Dropdown menu ----------------------------------------- */
.bp-menu { min-width: 220px; max-width: 320px; padding: var(--space-1); background: var(--surface-raised); color: var(--text); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); z-index: var(--z-dropdown); animation: bp-menu-in var(--duration-base) var(--ease-enter); }
@keyframes bp-menu-in { from { opacity: 0; transform: translateY(-4px); } }
.bp-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; font: 400 14px/1.3 var(--font-sans); text-align: left; text-decoration: none; cursor: pointer; outline: none; }
.bp-menu__item > svg { width: var(--icon-sm); height: var(--icon-sm); color: var(--text-subtle); flex: none; }
.bp-menu__item:hover, .bp-menu__item[data-highlighted], .bp-menu__item:focus-visible { background: var(--surface-sunken); }
.bp-menu__item:focus-visible { box-shadow: inset 0 0 0 var(--focus-width) var(--focus); }
.bp-menu__item--danger, .bp-menu__item--danger > svg { color: var(--danger); }
.bp-menu__item--danger:hover, .bp-menu__item--danger[data-highlighted] { background: var(--danger-subtle); }
.bp-menu__item[aria-disabled="true"], .bp-menu__item[data-disabled] { color: var(--text-disabled); cursor: not-allowed; background: transparent; }
.bp-menu__item[aria-checked="true"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; background: var(--accent); outline: 1.5px solid var(--accent); outline-offset: 2px; }
.bp-menu__label { padding: var(--space-2) 10px var(--space-1); }
.bp-menu__sep { height: 1px; margin: var(--space-1) calc(var(--space-1) * -1); background: var(--border-subtle); }
.bp-menu__kbd { margin-left: auto; font: 400 12px/1 var(--font-mono); color: var(--text-subtle); }

/* ---------- 13. Tabs & segmented ------------------------------------- */
.bp-tabs__list { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-subtle); overflow-x: auto; scrollbar-width: none; }
.bp-tabs__list::-webkit-scrollbar { display: none; }
.bp-tabs__tab { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-h-md); padding: 0 var(--space-3); border: 0; background: none; color: var(--text-muted); font: 520 14px/1 var(--font-sans); white-space: nowrap; cursor: pointer; }
.bp-tabs__tab::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: -1px; height: var(--border-width-strong); background: transparent; transition: background-color var(--duration-base) var(--ease-standard); }
.bp-tabs__tab:hover { color: var(--text); }
.bp-tabs__tab[aria-selected="true"] { color: var(--text); }
.bp-tabs__tab[aria-selected="true"]::after { background: var(--accent); }
.bp-tabs__tab:focus-visible { outline-offset: -2px; }
.bp-tabs__count { font: 400 12px/1 var(--font-mono); color: var(--text-subtle); }
.bp-tabs__panel { padding-top: var(--space-5); }
.bp-segmented { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.bp-segmented > button, .bp-segmented > a { display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 var(--space-2); border: 0; border-radius: 2px; background: transparent; color: var(--text-subtle); font: 500 12px/1 var(--font-mono); letter-spacing: 0.04em; cursor: pointer; text-decoration: none; }
.bp-segmented > :hover { color: var(--text); }
.bp-segmented > [aria-pressed="true"], .bp-segmented > [aria-current] { background: var(--surface-sunken); color: var(--text); }

/* ---------- 14. Breadcrumbs ------------------------------------------ */
.bp-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; font: 400 13px/1.5 var(--font-mono); color: var(--text-subtle); }
.bp-crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.bp-crumbs li + li::before { content: "/"; color: var(--border); }
.bp-crumbs a { color: var(--text-muted); text-decoration: none; border-radius: 2px; }
.bp-crumbs a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 0.22em; }
.bp-crumbs [aria-current="page"] { color: var(--text); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-crumbs__more { border: 0; background: none; padding: 0 2px; color: var(--text-muted); cursor: pointer; font: inherit; }

/* ==========================================================================
   Public site
   ========================================================================== */
.bp-icon { width: var(--icon-md); height: var(--icon-md); flex: none; }
.bp-icon--sm { width: var(--icon-sm); height: var(--icon-sm); }
.bp-icon--lg { width: var(--icon-lg); height: var(--icon-lg); }

/* ---------- 15. Site header ------------------------------------------- */
.bp-header { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--bg); border-bottom: 1px solid transparent; transition: border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard); }
.bp-header[data-scrolled="true"] { border-bottom-color: var(--border-subtle); }
.bp-header__inner { display: flex; align-items: center; gap: var(--space-6); height: 56px; }
@media (min-width: 768px) { .bp-header__inner { height: var(--header-h); } }
.bp-wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; white-space: nowrap; border-radius: 2px; }
.bp-wordmark__mark { width: 22px; height: 22px; flex: none; color: var(--accent); }
.bp-wordmark__name { font: 600 15px/1 var(--font-sans); letter-spacing: -0.01em; }
.bp-wordmark__role { font: 400 12px/1 var(--font-mono); color: var(--text-subtle); letter-spacing: 0.02em; }
@media (max-width: 479px) { .bp-wordmark__role { display: none; } }
.bp-nav { display: none; }
@media (min-width: 1024px) { .bp-nav { display: block; } }
.bp-nav ul { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.bp-nav a { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: 36px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--text-muted); font: 520 14px/1 var(--font-sans); text-decoration: none; transition: color var(--duration-fast) var(--ease-standard); }
.bp-nav a::before { content: ""; width: 6px; height: 6px; background: var(--accent); transform: scale(0); transition: transform var(--duration-base) var(--ease-standard); }
.bp-nav a:hover { color: var(--text); }
.bp-nav a[aria-current="true"], .bp-nav a[aria-current="page"] { color: var(--text); }
.bp-nav a[aria-current="true"]::before, .bp-nav a[aria-current="page"]::before { transform: scale(1); }
.bp-header__actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.bp-header__desktop { display: none; }
@media (min-width: 1024px) { .bp-header__desktop { display: contents; } .bp-header__burger { display: none !important; } }
.bp-mobilenav { display: flex; flex-direction: column; height: 100%; }
.bp-mobilenav__head { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 var(--space-2) 0 var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.bp-mobilenav ol { list-style: none; margin: 0; padding: var(--space-4); display: grid; gap: 0; counter-reset: nav; }
.bp-mobilenav li a { display: flex; align-items: baseline; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); color: var(--text); text-decoration: none; font: 600 22px/1.2 var(--font-sans); letter-spacing: -0.016em; }
.bp-mobilenav li a::before { counter-increment: nav; content: counter(nav, decimal-leading-zero); font: 500 12px/1 var(--font-mono); color: var(--text-subtle); width: 24px; }
.bp-mobilenav__foot { margin-top: auto; display: grid; gap: var(--space-3); padding: var(--space-4); border-top: 1px solid var(--border-subtle); }

/* ---------- 16. Hero --------------------------------------------------- */
.bp-hero { padding-top: clamp(40px, 2rem + 4vw, 112px); padding-bottom: var(--space-section); }
.bp-hero__grid { display: grid; gap: var(--space-10); }
@media (min-width: 1024px) { .bp-hero__grid { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: var(--gutter-xl); align-items: end; } }
.bp-hero__name { margin-top: var(--space-5); max-width: 11ch; }
.bp-hero__role { margin-top: var(--space-4); font: 500 var(--fs-h3)/1.25 var(--font-sans); letter-spacing: -0.016em; color: var(--text-muted); }
.bp-hero__lead { margin-top: var(--space-6); color: var(--text); max-width: 34em; }
.bp-hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
@media (max-width: 479px) { .bp-hero__cta .bp-btn { flex: 1 1 100%; } }
/* Spec block — the drawing's title block in miniature */
.bp-spec { position: relative; margin: 0; padding: var(--space-5); background: var(--surface); border: 1px solid var(--border-subtle); }
.bp-spec__title { display: flex; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-3); margin-bottom: var(--space-1); border-bottom: 1px solid var(--border-strong); }
.bp-spec dl { display: grid; grid-template-columns: auto 1fr; margin: 0; }
.bp-spec dt, .bp-spec dd { padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.bp-spec dt { padding-right: var(--space-4); }
.bp-spec dd { font: 400 14px/1.45 var(--font-sans); color: var(--text); }
.bp-spec dl > :nth-last-child(-n+2) { border-bottom: 0; }
.bp-spec__status { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--marker); }

/* ---------- 17. Metrics ------------------------------------------------ */
.bp-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-strong); }
@media (min-width: 1024px) { .bp-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bp-metric { display: grid; align-content: start; gap: var(--space-3); padding: var(--space-6) var(--space-4) var(--space-6) 0; border-bottom: 1px solid var(--border-subtle); }
.bp-metric:nth-child(odd) { padding-right: var(--space-5); border-right: 1px solid var(--border-subtle); }
.bp-metric:nth-child(even) { padding-left: var(--space-5); }
@media (min-width: 1024px) {
  .bp-metric, .bp-metric:nth-child(odd), .bp-metric:nth-child(even) { padding: var(--space-8) var(--space-6); border-right: 1px solid var(--border-subtle); border-bottom: 0; }
  .bp-metric:first-child { padding-left: 0; }
  .bp-metric:last-child { border-right: 0; }
}
.bp-metric__value { font: 500 var(--fs-metric)/1 var(--font-mono); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.bp-metric__unit { font-size: 0.42em; letter-spacing: 0; color: var(--text-subtle); margin-left: 0.2em; }
.bp-metric__label { font: 400 var(--fs-body-sm)/1.5 var(--font-sans); color: var(--text-muted); max-width: 28ch; }

/* ---------- 18. Expertise map (C4-like context diagram) --------------- */
.bp-xmap { position: relative; }
.bp-xmap__svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; display: none; }
.bp-xmap__svg path { fill: none; stroke: var(--connector); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bp-xmap__svg rect { fill: var(--bg); stroke: var(--connector); stroke-width: 1; }
.bp-xmap__list { position: relative; display: grid; gap: var(--space-3); list-style: none; margin: 0; padding: 0 0 0 var(--space-6); }
.bp-xmap__list::before { content: ""; position: absolute; left: 7px; top: var(--space-8); bottom: var(--space-8); width: 1px; background: var(--connector); }
.bp-xnode { position: relative; display: grid; gap: var(--space-2); padding: var(--space-5); background: var(--surface); border: 1px solid var(--border-strong); }
.bp-xmap__list > .bp-xnode::before { content: ""; position: absolute; left: calc(var(--space-6) * -1 + 4px); top: var(--space-6); width: 7px; height: 7px; background: var(--bg); border: 1px solid var(--connector); }
.bp-xmap__list > .bp-xnode::after { content: ""; position: absolute; left: calc(var(--space-6) * -1 + 12px); top: calc(var(--space-6) + 4px); width: calc(var(--space-6) - 12px); height: 1px; background: var(--connector); }
.bp-xnode__meta { display: flex; justify-content: space-between; gap: var(--space-3); }
.bp-xnode__title { font: 600 var(--fs-h4)/1.3 var(--font-sans); letter-spacing: -0.008em; }
.bp-xnode__text { font: 400 var(--fs-body-sm)/1.55 var(--font-sans); color: var(--text-muted); }
.bp-xnode .bp-tags { margin-top: var(--space-2); }
.bp-xnode--hub { background: var(--accent-subtle); border-color: var(--accent); }
.bp-xnode--hub .bp-xnode__meta { color: var(--accent); }
.bp-xnode--hub .bp-xnode__title { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.016em; }
@media (min-width: 1024px) {
  .bp-xmap__svg { display: block; }
  .bp-xmap__list { padding: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "a . b" "c hub d" ". e ."; column-gap: var(--space-16); row-gap: var(--space-8); align-items: center; }
  .bp-xmap__list::before, .bp-xmap__list > .bp-xnode::before, .bp-xmap__list > .bp-xnode::after { display: none; }
  .bp-xmap__list > :nth-child(1) { grid-area: hub; }
  .bp-xmap__list > :nth-child(2) { grid-area: a; } .bp-xmap__list > :nth-child(3) { grid-area: b; }
  .bp-xmap__list > :nth-child(4) { grid-area: c; } .bp-xmap__list > :nth-child(5) { grid-area: d; }
  .bp-xmap__list > :nth-child(6) { grid-area: e; }
}

/* ---------- 19. Experience timeline ----------------------------------- */
.bp-timeline { list-style: none; margin: 0; padding: 0; }
.bp-tl { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: var(--space-4); padding-bottom: var(--space-10); }
.bp-tl::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 1px; background: var(--border-strong); }
.bp-tl:last-child::before { bottom: auto; height: calc(100% - 18px - var(--space-10)); background: linear-gradient(var(--border-strong), transparent); }
.bp-tl__node { grid-column: 1; grid-row: 1 / span 2; width: 11px; height: 11px; margin-top: 7px; background: var(--bg); border: 1.5px solid var(--border-strong); position: relative; z-index: 1; }
.bp-tl--current .bp-tl__node { background: var(--marker); border-color: var(--marker); outline: 1px solid var(--marker); outline-offset: 3px; }
.bp-tl__period { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--text-subtle); }
.bp-tl__body { grid-column: 2; display: grid; gap: var(--space-3); margin-top: var(--space-2); }
.bp-tl__company { font: 600 var(--fs-h3)/1.2 var(--font-sans); letter-spacing: -0.016em; }
.bp-tl__role { font: 500 15px/1.45 var(--font-sans); color: var(--text-muted); }
.bp-tl__results { display: grid; gap: var(--space-2); list-style: none; margin: var(--space-1) 0 0; padding: 0; max-width: 68ch; }
.bp-tl__results li { position: relative; padding-left: var(--space-6); font: 400 var(--fs-body)/1.6 var(--font-sans); }
.bp-tl__results li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 14px; height: 1px; background: var(--connector); }
.bp-tl__results li::after { content: ""; position: absolute; left: 12px; top: calc(0.8em - 2px); width: 5px; height: 5px; border-top: 1px solid var(--connector); border-right: 1px solid var(--connector); transform: rotate(45deg); }
.bp-tl__toggle { justify-self: start; }
.bp-tl__toggle svg { transition: transform var(--duration-base) var(--ease-standard); }
.bp-tl__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.bp-tl__more { display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--border-subtle); }
.bp-tl__more[hidden] { display: none; }
.bp-tl__todo { padding: var(--space-4); border: 1px dashed var(--marker); color: var(--marker); font: 400 13px/1.5 var(--font-mono); max-width: 68ch; }
@media (min-width: 1024px) {
  .bp-tl { grid-template-columns: 184px 24px minmax(0, 1fr); }
  .bp-tl::before { left: calc(184px + var(--space-4) + 5px); }
  .bp-tl__node { grid-column: 2; }
  .bp-tl__period { grid-column: 1; grid-row: 1; align-content: flex-start; padding-top: 6px; column-gap: 6px; }
  .bp-tl__body { grid-column: 3; grid-row: 1; margin-top: 0; }
}

/* ---------- 20. Case card ---------------------------------------------- */
.bp-case { display: grid; gap: var(--space-6); padding: var(--space-6); background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
@media (min-width: 1024px) { .bp-case { padding: var(--space-8); } }
.bp-case__head { display: grid; gap: var(--space-3); }
.bp-case__meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.bp-case__steps { display: grid; gap: var(--space-6); list-style: none; margin: 0; padding: 0; counter-reset: step; }
.bp-case__step { position: relative; display: grid; align-content: start; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border-strong); }
.bp-case__step h4 { display: flex; align-items: center; gap: var(--space-2); }
.bp-case__step h4::before { counter-increment: step; content: counter(step, decimal-leading-zero); font: 500 12px/1 var(--font-mono); color: var(--accent); }
.bp-case__step p { font: 400 var(--fs-body-sm)/1.6 var(--font-sans); color: var(--text-muted); }
.bp-case__step--result { border-top-color: var(--accent); }
.bp-case__kpis { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); margin-top: var(--space-2); }
.bp-case__kpi b { display: block; font: 500 28px/1 var(--font-mono); letter-spacing: -0.03em; color: var(--text); }
.bp-case__kpi span { font: 400 13px/1.4 var(--font-sans); color: var(--text-muted); }
@media (min-width: 1024px) {
  .bp-case__steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-10); }
  .bp-case__step:not(:last-child)::after { content: ""; position: absolute; top: -1px; right: calc(var(--space-10) * -1); width: var(--space-10); height: 1px; background: var(--border-strong); }
  .bp-case__step:not(:last-child)::before { content: ""; position: absolute; top: -4px; right: calc(var(--space-10) * -1 + 1px); width: 6px; height: 6px; border-top: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong); transform: rotate(45deg); }
}
.bp-case__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); }

/* ---------- 21. Project card ------------------------------------------ */
.bp-pcard { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; transition: border-color var(--duration-fast) var(--ease-standard); }
.bp-pcard:hover { border-color: var(--border); }
.bp-pcard:focus-within { border-color: var(--border-strong); }
.bp-pcard__cover { position: relative; aspect-ratio: 16 / 9; background: var(--surface-sunken); border-bottom: 1px solid var(--border-subtle); overflow: hidden; }
.bp-pcard__cover img, .bp-pcard__cover svg { width: 100%; height: 100%; object-fit: cover; }
.bp-pcard__body { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; padding: var(--space-5); }
@media (min-width: 768px) { .bp-pcard__body { padding: var(--space-6); } }
.bp-pcard__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.bp-pcard__title { font: 600 var(--fs-h4)/1.3 var(--font-sans); letter-spacing: -0.008em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.bp-pcard__title a { color: inherit; text-decoration: none; }
.bp-pcard__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.bp-pcard__title a:focus-visible { outline: none; }
.bp-pcard__title a:focus-visible::after { outline: var(--focus-width) solid var(--focus); outline-offset: -2px; border-radius: var(--radius-md); }
.bp-pcard:hover .bp-pcard__title a { color: var(--accent); }
.bp-pcard__desc { font: 400 var(--fs-body-sm)/1.55 var(--font-sans); color: var(--text-muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.bp-pcard__foot { margin-top: auto; display: grid; gap: var(--space-4); padding-top: var(--space-2); }
.bp-pcard__links { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.bp-pcard__links a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--text-muted); font: 500 13px/1 var(--font-mono); text-decoration: none; border-radius: 2px; }
.bp-pcard__links a:hover { color: var(--accent); }
.bp-pcard__links svg { width: 15px; height: 15px; }
.bp-pcard .bp-tags { position: relative; z-index: 1; flex-wrap: nowrap; overflow: hidden; }
.bp-pcard--featured .bp-pcard__title { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.016em; }
.bp-pcard--featured .bp-pcard__desc { -webkit-line-clamp: 4; line-clamp: 4; font-size: var(--fs-body); }
@media (min-width: 1024px) {
  .bp-pcard--featured { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .bp-pcard--featured .bp-pcard__cover { aspect-ratio: auto; min-height: 360px; border-bottom: 0; border-right: 1px solid var(--border-subtle); }
  .bp-pcard--featured .bp-pcard__body { padding: var(--space-8); }
}
.bp-pcard--placeholder { align-items: center; justify-content: center; min-height: 280px; padding: var(--space-6); text-align: center; background-color: transparent; border: 1px dashed var(--border); background-image: repeating-linear-gradient(-45deg, var(--bg-grid) 0 1px, transparent 1px 10px); }
.bp-pcard--placeholder:hover { border-color: var(--border); }
.bp-pcard--placeholder p { max-width: 28ch; margin-inline: auto; }
/* Generative cover */
.bp-gen { display: block; width: 100%; height: 100%; background: var(--surface-sunken); }
.bp-gen .g-dot { fill: var(--border-subtle); }
.bp-gen .g-line { fill: none; stroke: var(--connector); stroke-width: 1.25; }
.bp-gen .g-node { fill: var(--surface); stroke: var(--text-subtle); stroke-width: 1.25; }
.bp-gen .g-hub { fill: var(--accent); stroke: var(--accent); }
.bp-gen .g-port { fill: var(--connector); }
.bp-gen .g-label { fill: var(--text-subtle); font: 500 11px var(--font-mono); letter-spacing: 0.06em; }

/* ---------- 22. Project grid + filters -------------------------------- */
.bp-pgrid__bar { display: grid; gap: var(--space-4); margin-bottom: var(--space-6); }
.bp-pgrid__status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.bp-pgrid { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); list-style: none; margin: 0; padding: 0; }
@media (min-width: 600px) { .bp-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); } }
@media (min-width: 1024px) { .bp-pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bp-pgrid > .bp-pgrid__wide { grid-column: 1 / -1; }
.bp-empty { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-12) var(--space-6); text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-md); }
.bp-empty__art { width: 120px; height: 80px; color: var(--text-subtle); }
.bp-empty__title { font: 600 18px/1.35 var(--font-sans); }
.bp-empty__text { max-width: 44ch; color: var(--text-muted); font-size: 15px; }

/* ---------- 23. Project detail ---------------------------------------- */
.bp-phead { display: grid; gap: var(--space-5); padding-block: var(--space-10) var(--space-8); border-bottom: 1px solid var(--border-subtle); }
.bp-pmeta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-6); margin: 0; padding-top: var(--space-5); border-top: 1px solid var(--border-strong); }
@media (min-width: 768px) { .bp-pmeta { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bp-pmeta dd { margin-top: var(--space-1); font: 400 14px/1.5 var(--font-sans); }
.bp-prose { font: 400 var(--fs-body)/1.7 var(--font-sans); color: var(--text); max-width: var(--container-prose); }
.bp-prose > * + * { margin-top: 1.1em; }
.bp-prose h2 { font: 600 var(--fs-h3)/1.2 var(--font-sans); letter-spacing: -0.016em; margin-top: 2em; }
.bp-prose h3 { font: 600 var(--fs-h4)/1.3 var(--font-sans); margin-top: 1.6em; }
.bp-prose a { color: var(--link); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
.bp-prose ul, .bp-prose ol { padding-left: 1.4em; }
.bp-prose li + li { margin-top: 0.4em; }
.bp-prose li::marker { color: var(--text-subtle); font-family: var(--font-mono); }
.bp-prose blockquote { padding-left: var(--space-5); border-left: 1px solid var(--border-strong); color: var(--text-muted); font-size: var(--fs-lead); line-height: 1.5; }
.bp-prose code { font: 400 0.88em/1 var(--font-mono); padding: 0.15em 0.35em; background: var(--surface-sunken); border-radius: var(--radius-xs); }
.bp-prose pre { padding: var(--space-4) var(--space-5); background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow-x: auto; font: 400 13.5px/1.6 var(--font-mono); }
.bp-prose pre code { padding: 0; background: none; font-size: inherit; }
.bp-prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.bp-prose th, .bp-prose td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border-subtle); }
.bp-prose th { font: 500 12px/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-subtle); border-bottom-color: var(--border-strong); }
.bp-prose hr { border: 0; height: 1px; background: var(--border-subtle); margin-block: 2.4em; }
.bp-figure figcaption, .bp-prose figcaption { margin-top: var(--space-2); font: 400 13px/1.5 var(--font-mono); color: var(--text-subtle); }
.bp-gallery { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) { .bp-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bp-gallery > :first-child { grid-column: 1 / -1; }
.bp-gallery button { display: block; width: 100%; padding: 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-sunken); overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; }
.bp-gallery > :first-child button { aspect-ratio: 16 / 9; }
.bp-toc { position: sticky; top: calc(var(--header-h) + var(--space-6)); display: grid; gap: var(--space-2); }
.bp-toc a { display: block; padding: 2px 0 2px var(--space-3); border-left: 1px solid var(--border-subtle); color: var(--text-muted); font: 400 14px/1.45 var(--font-sans); text-decoration: none; }
.bp-toc a:hover { color: var(--text); }
.bp-toc a[aria-current="true"] { color: var(--text); border-left-color: var(--accent); }

/* Architecture diagram (diagram.py renders the SVG; colours come only from tokens) */
.bp-diagram { grid-column: 1 / -1; margin-block: var(--space-8); }
.bp-diagram__scroll { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-sunken); }
.bp-diagram__scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bp-diagram__svg { display: block; width: 100%; height: auto; min-width: 720px; }
/* As a card cover: a picture scaled into the box, nothing to scroll or read. */
.bp-diagram--fit { margin: 0; height: 100%; }
.bp-diagram--fit .bp-diagram__svg { width: 100%; height: 100%; min-width: 0; }
.bp-diagram figcaption { margin-top: var(--space-2); font: 400 13px/1.5 var(--font-mono); color: var(--text-subtle); }
.bp-diagram .d-bg { fill: var(--surface-sunken); }
.bp-diagram .d-dot { fill: var(--border-subtle); }
.bp-diagram .d-group { fill: none; stroke: var(--border); stroke-width: 1; stroke-dasharray: 4 4; }
.bp-diagram .d-ghead rect { fill: var(--surface-sunken); }
.bp-diagram .d-ghead text { fill: var(--text-subtle); font: 500 11px var(--font-mono); letter-spacing: 0.08em; }
.bp-diagram .d-edge { fill: none; stroke: var(--connector); stroke-width: 1.25; }
.bp-diagram .d-edge--dashed { stroke-dasharray: 5 4; }
.bp-diagram .d-arrow { fill: none; stroke: var(--connector); stroke-width: 1.5; }
.bp-diagram .d-port { fill: var(--connector); }
.bp-diagram .d-elabel rect { fill: var(--surface-sunken); stroke: var(--border-subtle); stroke-width: 1; }
.bp-diagram .d-elabel text { fill: var(--text-muted); font: 500 11px var(--font-mono); }
.bp-diagram .d-node rect { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.bp-diagram .d-node--accent rect { fill: var(--accent-subtle); stroke: var(--accent); }
.bp-diagram .d-node--ext rect { fill: var(--surface-sunken); stroke-dasharray: 4 3; }
.bp-diagram .d-node--person rect { stroke: var(--border-strong); }
.bp-diagram .d-mark { fill: none; stroke: var(--border); stroke-width: 1; }
.bp-diagram .d-kicker { fill: var(--text-subtle); font: 500 11.5px var(--font-mono); letter-spacing: 0.06em; }
.bp-diagram .d-node--accent .d-kicker { fill: var(--accent); }
.bp-diagram .d-title { fill: var(--text); font: 600 16px var(--font-sans); letter-spacing: -0.01em; }
.bp-diagram .d-note { fill: var(--text-muted); font: 400 13.5px var(--font-sans); }

/* ---------- 24. Certificates, contacts, footer ------------------------ */
.bp-certs { display: grid; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-strong); }
.bp-cert { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--space-2) var(--space-4); align-items: start; padding: var(--space-5) 0; border-bottom: 1px solid var(--border-subtle); }
.bp-cert__seal { grid-row: span 2; display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--border-strong); font: 600 13px/1 var(--font-mono); letter-spacing: 0.04em; color: var(--text); position: relative; }
.bp-cert__seal::after { content: ""; position: absolute; inset: 3px; border: 1px solid var(--border-subtle); }
.bp-cert__title { font: 600 16px/1.4 var(--font-sans); }
.bp-cert__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); align-items: center; }
@media (min-width: 768px) { .bp-cert { grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; } .bp-cert__seal { grid-row: auto; } .bp-cert__link { grid-column: 3; grid-row: 1 / span 2; } }

.bp-contacts { display: grid; gap: var(--space-10); }
@media (min-width: 1024px) { .bp-contacts { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--gutter-xl); align-items: end; } }
.bp-contacts__email { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }
.bp-contacts__email a { font: 500 clamp(1.125rem, 0.8rem + 1.6vw, 1.875rem)/1.2 var(--font-mono); letter-spacing: -0.02em; color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--connector); overflow-wrap: anywhere; }
.bp-contacts__email a:hover { color: var(--accent); text-decoration-color: currentColor; }
.bp-contacts__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-strong); }
.bp-contacts__list a { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: var(--space-3); min-height: 52px; border-bottom: 1px solid var(--border-subtle); color: var(--text); text-decoration: none; }
.bp-contacts__list a:hover .bp-contacts__handle { color: var(--accent); }
.bp-contacts__handle { font: 400 15px/1.4 var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-contacts__list svg { width: 16px; height: 16px; color: var(--text-subtle); }

.bp-footer { padding-block: var(--space-10) var(--space-8); }
.bp-stamp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border-strong); border-width: 1px 0 0 1px; }
.bp-stamp > div { display: grid; gap: 4px; align-content: start; padding: 10px 12px; border: 1px solid var(--border-strong); border-width: 0 1px 1px 0; min-width: 0; }
.bp-stamp__value { font: 400 13px/1.45 var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
.bp-stamp__value a { color: inherit; text-underline-offset: 0.2em; }
.bp-stamp__value a:hover { color: var(--accent); }
.bp-stamp__main { grid-column: 1 / -1; }
.bp-stamp__main .bp-stamp__value { font: 600 18px/1.3 var(--font-sans); letter-spacing: -0.01em; }
@media (min-width: 768px) {
  .bp-stamp { grid-template-columns: 2.2fr 1fr 1fr 1fr; }
  .bp-stamp__main { grid-column: 1; grid-row: span 2; }
}

/* ==========================================================================
   Auth screens
   ========================================================================== */
.bp-authpage { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.bp-authpage__main { display: grid; place-items: center; padding: var(--space-10) var(--space-4); }
.bp-auth { position: relative; width: min(460px, 100%); display: grid; gap: var(--space-4); padding: var(--space-8) var(--space-6); background: var(--surface-raised); border: 1px solid var(--border-subtle); }
@media (min-width: 600px) { .bp-auth { padding: var(--space-10) var(--space-10) var(--space-8); } }
.bp-auth__code { display: flex; justify-content: space-between; gap: var(--space-3); }
.bp-auth__glyph { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid currentColor; color: var(--c, var(--accent)); position: relative; }
.bp-auth__glyph::before, .bp-auth__glyph::after { content: ""; position: absolute; top: 50%; width: var(--space-4); height: 1px; background: currentColor; opacity: 0.6; }
.bp-auth__glyph::before { right: 100%; } .bp-auth__glyph::after { left: 100%; }
.bp-auth__glyph svg { width: var(--icon-lg); height: var(--icon-lg); }
.bp-auth--danger { --c: var(--danger); } .bp-auth--warning { --c: var(--warning); } .bp-auth--info { --c: var(--info); }
.bp-auth__title { font: 600 var(--fs-h3)/1.2 var(--font-sans); letter-spacing: -0.016em; }
.bp-auth__text { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.bp-auth__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
@media (max-width: 479px) { .bp-auth__actions .bp-btn { flex: 1 1 100%; height: var(--control-h-lg); } }
.bp-auth__details { border-top: 1px solid var(--border-subtle); padding-top: var(--space-3); margin-top: var(--space-2); }
.bp-auth__details summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: var(--space-2); border-radius: 2px; }
.bp-auth__details summary::-webkit-details-marker { display: none; }
.bp-auth__details summary::before { content: "+"; font: 500 13px/1 var(--font-mono); color: var(--text-subtle); width: 10px; }
.bp-auth__details[open] summary::before { content: "−"; }
.bp-auth__details dl { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--space-4); margin-top: var(--space-3); font: 400 12.5px/1.5 var(--font-mono); }
.bp-auth__details dt { color: var(--text-subtle); }
.bp-auth__details dd { color: var(--text); overflow-wrap: anywhere; }
.bp-auth__progress { display: flex; align-items: center; gap: var(--space-3); color: var(--accent); }
.bp-auth__steps { display: grid; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.bp-auth__steps li { display: flex; align-items: center; gap: var(--space-3); font: 400 13px/1.5 var(--font-mono); color: var(--text-subtle); }
.bp-auth__steps li[data-state="done"] { color: var(--text-muted); }
.bp-auth__steps li[data-state="done"] .bp-node { color: var(--success); }
.bp-auth__steps li[data-state="active"] { color: var(--text); }
.bp-auth__steps li[data-state="active"] .bp-node { color: var(--accent); }

/* User menu trigger */
.bp-usertrigger { display: inline-flex; align-items: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-2) 0 3px; border: 1px solid transparent; border-radius: var(--radius-full); background: transparent; color: var(--text); cursor: pointer; }
.bp-usertrigger:hover { background: var(--surface-sunken); }
.bp-usertrigger[aria-expanded="true"] { border-color: var(--border); }
.bp-usertrigger__name { font: 520 14px/1 var(--font-sans); max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-usertrigger svg { width: 16px; height: 16px; color: var(--text-subtle); }
@media (max-width: 767px) { .bp-usertrigger__name, .bp-usertrigger > svg { display: none; } .bp-usertrigger { padding: 0; width: 36px; justify-content: center; } }
.bp-menu__user { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--space-3); align-items: center; padding: var(--space-3) 10px; }
.bp-menu__user .bp-avatar { grid-row: span 2; }
.bp-menu__user b { font: 600 14px/1.3 var(--font-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-menu__user span { font: 400 12.5px/1.3 var(--font-mono); color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   App shell (/app) — denser, utilitarian, same tokens
   ========================================================================== */
.bp-app { --control-h-md: 36px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); min-height: 100dvh; background: var(--bg); font-size: 14px; }
@media (min-width: 768px) {
  .bp-app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); transition: grid-template-columns var(--duration-slow) var(--ease-standard); }
  .bp-app[data-collapsed="true"] { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
}
.bp-app[data-density="compact"] { --control-h-md: 32px; --control-h-sm: 28px; }
.bp-side { grid-row: 1 / -1; display: none; flex-direction: column; min-width: 0; background: var(--surface); border-right: 1px solid var(--border-subtle); }
@media (min-width: 768px) { .bp-side { display: flex; } }
.bp-side__head { display: flex; align-items: center; height: 56px; padding: 0 var(--space-4); border-bottom: 1px solid var(--border-subtle); gap: var(--space-2); }
.bp-side__nav { flex: 1; overflow-y: auto; padding: var(--space-3) var(--space-2); display: grid; align-content: start; gap: 2px; }
.bp-side__label { padding: var(--space-4) var(--space-3) var(--space-2); }
.bp-side__item { position: relative; display: flex; align-items: center; gap: var(--space-3); height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--text-muted); font: 520 14px/1 var(--font-sans); text-decoration: none; white-space: nowrap; }
.bp-side__item svg { width: 18px; height: 18px; flex: none; }
.bp-side__item:hover { background: var(--surface-sunken); color: var(--text); }
.bp-side__item[aria-current="page"] { background: var(--accent-subtle); color: var(--accent); }
.bp-side__item[aria-current="page"]::before { content: ""; position: absolute; left: -9px; top: 50%; width: 6px; height: 6px; margin-top: -3px; background: var(--accent); }
.bp-side__item .bp-badge { margin-left: auto; }
.bp-side__foot { padding: var(--space-2); border-top: 1px solid var(--border-subtle); }
.bp-app[data-collapsed="true"] .bp-side__item { justify-content: center; padding: 0; }
.bp-app[data-collapsed="true"] .bp-side__item > span, .bp-app[data-collapsed="true"] .bp-side__label, .bp-app[data-collapsed="true"] .bp-side__item .bp-badge, .bp-app[data-collapsed="true"] .bp-side__head .bp-wordmark__name, .bp-app[data-collapsed="true"] .bp-side__head .bp-wordmark__role { display: none; }
.bp-app[data-collapsed="true"] .bp-side__collapse svg { transform: rotate(180deg); }
.bp-top { display: flex; align-items: center; gap: var(--space-3); height: 56px; padding: 0 var(--space-4); border-bottom: 1px solid var(--border-subtle); background: var(--bg); position: sticky; top: 0; z-index: var(--z-sticky); min-width: 0; }
.bp-top__burger { display: inline-flex; }
@media (min-width: 768px) { .bp-top__burger { display: none !important; } .bp-top { padding: 0 var(--space-6); } }
.bp-top__end { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.bp-main { min-width: 0; padding: var(--space-6) var(--space-4); }
@media (min-width: 768px) { .bp-main { padding: var(--space-8) var(--space-8); } }
.bp-pagehead { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.bp-pagehead h1 { font: 600 24px/1.25 var(--font-sans); letter-spacing: -0.02em; }
.bp-v2 { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border: 1px dashed var(--marker); color: var(--marker); font: 500 11px/1 var(--font-mono); letter-spacing: 0.06em; border-radius: var(--radius-xs); vertical-align: middle; }

/* Empty state — «drawing in progress» */
.bp-wip { display: grid; justify-items: center; gap: var(--space-4); max-width: 520px; margin: var(--space-12) auto; padding: var(--space-10) var(--space-6); text-align: center; }
.bp-wip__art { width: 220px; height: 132px; }
.bp-wip__art .w-frame { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.bp-wip__art .w-dash { fill: none; stroke: var(--border); stroke-width: 1; stroke-dasharray: 4 4; }
.bp-wip__art .w-hatch { stroke: var(--border-subtle); stroke-width: 1; }
.bp-wip__art .w-line { fill: none; stroke: var(--connector); stroke-width: 1; }
.bp-wip__art .w-node { fill: var(--accent); }
.bp-wip__art .w-mark { fill: none; stroke: var(--marker); stroke-width: 1.25; }
.bp-wip__art .w-txt { fill: var(--text-subtle); font: 500 9px var(--font-mono); letter-spacing: 0.08em; }
.bp-wip__title { font: 600 22px/1.25 var(--font-sans); letter-spacing: -0.016em; }
.bp-wip__text { color: var(--text-muted); font-size: 15px; max-width: 42ch; }

/* ==========================================================================
   CMS v2 — forms, table, editor
   ========================================================================== */
.bp-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.bp-label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); font: 520 14px/1.4 var(--font-sans); color: var(--text); }
.bp-label__req { color: var(--danger); margin-left: 2px; }
.bp-label__opt { font: 400 12px/1 var(--font-mono); color: var(--text-subtle); }
.bp-hint { font: 400 13px/1.45 var(--font-sans); color: var(--text-subtle); }
.bp-fielderror { display: flex; align-items: flex-start; gap: 6px; font: 400 13px/1.45 var(--font-sans); color: var(--danger); }
.bp-fielderror svg { width: 14px; height: 14px; margin-top: 2px; flex: none; }
.bp-counter { font: 400 12px/1 var(--font-mono); color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.bp-counter[data-over="true"] { color: var(--danger); }
.bp-input, .bp-textarea, .bp-selecttrigger, .bp-combo {
  width: 100%; min-height: var(--control-h-md); padding: 0 var(--space-3);
  background: var(--surface-raised); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: 400 15px/1.4 var(--font-sans);
  transition: border-color var(--duration-fast) var(--ease-standard);
}
.bp-app .bp-input, .bp-app .bp-textarea, .bp-app .bp-selecttrigger, .bp-app .bp-combo { font-size: 14px; }
.bp-input::placeholder, .bp-textarea::placeholder { color: var(--text-subtle); opacity: 1; }
.bp-input:hover, .bp-textarea:hover, .bp-selecttrigger:hover, .bp-combo:hover { border-color: var(--border-strong); }
.bp-input:focus-visible, .bp-textarea:focus-visible, .bp-selecttrigger:focus-visible, .bp-combo:focus-within { outline: var(--focus-width) solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.bp-input[aria-invalid="true"], .bp-textarea[aria-invalid="true"], .bp-selecttrigger[aria-invalid="true"], .bp-combo[data-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.bp-input:disabled, .bp-textarea:disabled, .bp-selecttrigger:disabled { background: var(--surface-sunken); color: var(--text-disabled); border-color: var(--border-subtle); cursor: not-allowed; }
.bp-input[readonly] { background: transparent; border-style: dashed; }
.bp-textarea { padding: 10px var(--space-3); min-height: 104px; resize: vertical; line-height: 1.55; }
.bp-inputgroup { position: relative; display: flex; align-items: center; }
.bp-inputgroup > svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--text-subtle); pointer-events: none; }
.bp-inputgroup > .bp-input { padding-left: 34px; }
.bp-inputgroup > .bp-btn { position: absolute; right: 2px; }
.bp-selecttrigger { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); text-align: left; cursor: pointer; }
.bp-selecttrigger > svg { width: 16px; height: 16px; color: var(--text-subtle); flex: none; }
.bp-selecttrigger[data-placeholder] > span { color: var(--text-subtle); }
.bp-listbox { padding: var(--space-1); background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-md); max-height: 280px; overflow: auto; list-style: none; margin: 0; }
.bp-option { display: flex; align-items: center; gap: var(--space-2); min-height: 34px; padding: 0 10px; border-radius: var(--radius-sm); font: 400 14px/1.3 var(--font-sans); cursor: pointer; }
.bp-option[data-highlighted], .bp-option:hover { background: var(--surface-sunken); }
.bp-option[aria-selected="true"] { color: var(--accent); font-weight: 520; }
.bp-option[aria-selected="true"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; background: var(--accent); }
.bp-option__mono { font-family: var(--font-mono); font-size: 13px; }
.bp-option__hint { margin-left: auto; font: 400 12px/1 var(--font-mono); color: var(--text-subtle); }
.bp-option--create { color: var(--accent); border-top: 1px solid var(--border-subtle); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.bp-combo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px var(--space-2); cursor: text; }
.bp-combo input { flex: 1; min-width: 80px; height: 26px; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 14px/1 var(--font-mono); }
.bp-combo .bp-tag { padding-right: 2px; border-color: var(--border); color: var(--text); }
.bp-combo .bp-tag button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; padding: 0; background: none; color: var(--text-subtle); cursor: pointer; border-radius: 2px; }
.bp-combo .bp-tag button:hover { color: var(--danger); }
.bp-combo .bp-tag button svg { width: 12px; height: 12px; }
/* Checkbox & toggle */
.bp-check { appearance: none; -webkit-appearance: none; display: inline-grid; place-items: center; width: 16px; height: 16px; margin: 0; flex: none; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface-raised); cursor: pointer; }
.bp-check:hover { border-color: var(--border-strong); }
.bp-check:checked, .bp-check:indeterminate { background: var(--accent); border-color: var(--accent); }
.bp-check:checked::after { content: ""; width: 8px; height: 4px; border-left: 1.5px solid var(--text-on-accent); border-bottom: 1.5px solid var(--text-on-accent); transform: translateY(-1px) rotate(-45deg); }
.bp-check:indeterminate::after { content: ""; width: 8px; height: 1.5px; background: var(--text-on-accent); }
.bp-toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.bp-toggle { position: relative; flex: none; width: 36px; height: 20px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface-sunken); cursor: pointer; transition: background-color var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard); }
.bp-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-subtle); transition: transform var(--duration-base) var(--ease-standard), background-color var(--duration-base) var(--ease-standard); }
.bp-toggle[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.bp-toggle[aria-checked="true"]::after { transform: translateX(16px); background: var(--text-on-accent); }
.bp-toggle:disabled { opacity: 0.5; cursor: not-allowed; }
/* Date picker */
.bp-cal { width: 288px; padding: var(--space-3); background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.bp-cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); font: 600 14px/1 var(--font-sans); }
.bp-cal table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.bp-cal th { font: 500 11px/1 var(--font-mono); color: var(--text-subtle); padding: 6px 0; text-transform: uppercase; letter-spacing: 0.04em; }
.bp-cal td { padding: 1px; text-align: center; }
.bp-cal td button { width: 100%; height: 34px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--text); font: 400 13px/1 var(--font-mono); cursor: pointer; font-variant-numeric: tabular-nums; }
.bp-cal td button:hover { background: var(--surface-sunken); }
.bp-cal td button[data-outside] { color: var(--text-subtle); }
.bp-cal td button[data-today] { border-color: var(--border); }
.bp-cal td button[aria-selected="true"] { background: var(--accent); color: var(--text-on-accent); }
.bp-cal td button:disabled { color: var(--text-disabled); text-decoration: line-through; cursor: not-allowed; background: none; }
.bp-cal__foot { display: flex; justify-content: space-between; margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border-subtle); }
/* Image upload */
.bp-drop { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-8) var(--space-6); text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard); }
.bp-drop:hover { border-color: var(--border-strong); }
.bp-drop[data-dragover="true"] { border-color: var(--accent); border-style: solid; background-color: var(--accent-subtle); background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 18%, transparent) 0 1px, transparent 1px 8px); }
.bp-drop[data-invalid="true"] { border-color: var(--danger); }
.bp-drop svg { width: var(--icon-lg); height: var(--icon-lg); color: var(--text-subtle); }
.bp-drop b { font: 520 14px/1.4 var(--font-sans); }
.bp-upload { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: var(--space-3) var(--space-4); align-items: center; padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface); }
.bp-upload__thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: var(--radius-xs); overflow: hidden; background: var(--surface-sunken); }
.bp-upload__name { font: 400 13px/1.4 var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Markdown editor */
.bp-md { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-raised); overflow: hidden; }
.bp-md:focus-within { outline: var(--focus-width) solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.bp-md__bar { display: flex; align-items: center; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-sunken); overflow-x: auto; }
.bp-md__bar .bp-segmented { margin-right: var(--space-2); background: var(--surface-raised); }
.bp-md__bar .bp-divider--vertical { margin: 4px var(--space-1); }
.bp-md__panes { display: grid; grid-template-columns: minmax(0, 1fr); }
.bp-md[data-mode="split"] .bp-md__panes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.bp-md__src { display: block; width: 100%; min-height: 240px; padding: var(--space-4); border: 0; outline: 0; resize: vertical; background: transparent; color: var(--text); font: 400 13.5px/1.7 var(--font-mono); }
.bp-md__preview { min-height: 240px; padding: var(--space-4) var(--space-5); border-left: 1px solid var(--border-subtle); background: var(--surface); font-size: 15px; }
.bp-md__foot { display: flex; justify-content: space-between; gap: var(--space-3); padding: 6px var(--space-3); border-top: 1px solid var(--border-subtle); }
@media (max-width: 767px) { .bp-md[data-mode="split"] .bp-md__panes { grid-template-columns: minmax(0, 1fr); } .bp-md__preview { border-left: 0; border-top: 1px solid var(--border-subtle); } }
/* Autosave indicator */
.bp-autosave { display: inline-flex; align-items: center; gap: var(--space-2); font: 400 12.5px/1 var(--font-mono); color: var(--text-subtle); white-space: nowrap; }
.bp-autosave svg { width: 14px; height: 14px; }
.bp-autosave[data-state="saved"] svg { color: var(--success); }
.bp-autosave[data-state="dirty"] .bp-node { color: var(--warning); }
.bp-autosave[data-state="saving"] { color: var(--text-muted); }
.bp-autosave[data-state="error"] { color: var(--danger); }
.bp-autosave[data-state="error"] button { font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 0.2em; border: 0; background: none; padding: 0; cursor: pointer; }
/* Data table */
.bp-tablewrap { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.bp-tablebar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--border-subtle); min-height: 56px; }
.bp-tablebar--bulk { background: var(--accent-subtle); }
.bp-tablebar__count { font: 500 13px/1 var(--font-mono); color: var(--accent); margin-right: var(--space-2); }
.bp-tablescroll { overflow-x: auto; }
.bp-table { width: 100%; border-collapse: separate; border-spacing: 0; font: 400 14px/1.4 var(--font-sans); }
.bp-table th { position: sticky; top: 0; z-index: var(--z-raised); height: 36px; padding: 0 var(--space-3); background: var(--surface-sunken); border-bottom: 1px solid var(--border-subtle); text-align: left; font: 500 11.5px/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-subtle); white-space: nowrap; }
.bp-table th button { display: inline-flex; align-items: center; gap: 4px; height: 28px; margin-left: -6px; padding: 0 6px; border: 0; border-radius: 2px; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.bp-table th button:hover { color: var(--text); background: var(--bg-grid); }
.bp-table th button svg { width: 12px; height: 12px; }
.bp-table th[aria-sort="ascending"], .bp-table th[aria-sort="descending"] { color: var(--text); }
.bp-table td { height: 48px; padding: 0 var(--space-3); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.bp-app[data-density="compact"] .bp-table td { height: 40px; }
.bp-table tbody tr:last-child td { border-bottom: 0; }
.bp-table tbody tr:hover td { background: color-mix(in srgb, var(--surface-sunken) 60%, transparent); }
.bp-table tbody tr[aria-selected="true"] td { background: var(--accent-subtle); }
.bp-table .bp-col-check { width: 44px; padding-right: 0; }
.bp-table .bp-col-num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.bp-table .bp-col-actions { width: 48px; text-align: right; }
.bp-table__title { display: grid; gap: 2px; min-width: 220px; }
.bp-table__title a { color: var(--text); font-weight: 520; text-decoration: none; }
.bp-table__title a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }
.bp-table__title span { font: 400 12px/1.3 var(--font-mono); color: var(--text-subtle); }
.bp-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border-subtle); }
.bp-pager__info { font: 400 12.5px/1 var(--font-mono); color: var(--text-subtle); }
.bp-cardlist { display: none; list-style: none; margin: 0; padding: 0; }
@media (max-width: 767px) {
  .bp-tablewrap--responsive .bp-tablescroll { display: none; }
  .bp-tablewrap--responsive .bp-cardlist { display: grid; }
  .bp-cardlist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px var(--space-3); align-items: start; padding: var(--space-3); border-bottom: 1px solid var(--border-subtle); }
}
