/**
 * components.css — Shared Component Classes (Layer 2)
 *
 * All widgets MUST use .bp-* classes. No inline styles. No hardcoded values.
 * Token values are full oklch() — use var(--token) directly.
 * Alpha variants use color-mix(in oklch, var(--token) N%, transparent).
 * Mobile-first: base = mobile, @media (min-width:) for larger screens.
 *
 * Governance: audit_component_classes.js enforces bp-* namespace.
 */

/* ============================================
 * CARD
 * ============================================ */
.bp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.bp-card--elevated {
  box-shadow: var(--shadow-md);
}

.bp-card--interactive {
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-fast) var(--ease-default);
}

.bp-card--interactive:hover {
  border-color: color-mix(in oklch, var(--primary) 40%, transparent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.bp-card--interactive:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

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

.bp-card__title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  font-family: var(--font-sans);
  margin: 0;
}

.bp-card__subtitle {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  margin: 0;
}

.bp-card__body {
  padding: var(--space-5);
}

.bp-card__footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
}

/* ============================================
 * TABLE
 * ============================================ */
.bp-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bp-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.bp-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-weight: var(--font-medium);
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.bp-table th[data-sortable] {
  cursor: pointer;
}

.bp-table th[data-sortable]:hover {
  color: var(--foreground);
}

.bp-table td {
  padding: var(--space-2) var(--space-3);
  color: var(--foreground);
  border-bottom: 1px solid color-mix(in oklch, var(--border) 50%, transparent);
  vertical-align: middle;
}

.bp-table tbody tr {
  transition: background var(--duration-fast) var(--ease-default);
}

.bp-table tbody tr:hover {
  background: color-mix(in oklch, var(--muted) 50%, transparent);
}

.bp-table tbody tr:focus-within {
  background: color-mix(in oklch, var(--muted) 70%, transparent);
}

.bp-table tbody tr[data-clickable] {
  cursor: pointer;
}

.bp-table__empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--muted-foreground);
}

.bp-table--compact th,
.bp-table--compact td { padding: var(--space-1) var(--space-2); }

.bp-table--striped tbody tr:nth-child(even) td {
  background: color-mix(in oklch, var(--muted) 30%, transparent);
}

.bp-table__actions {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

/* ============================================
 * BADGE
 * ============================================ */
.bp-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  font-family: var(--font-sans);
  line-height: var(--leading-normal);
  white-space: nowrap;
}

.bp-badge--success {
  background: color-mix(in oklch, var(--success) 12%, transparent);
  color: var(--success);
}

.bp-badge--warning {
  background: color-mix(in oklch, var(--warning) 12%, transparent);
  color: var(--warning);
}

.bp-badge--destructive {
  background: color-mix(in oklch, var(--destructive) 12%, transparent);
  color: var(--destructive);
}

.bp-badge--info {
  background: color-mix(in oklch, var(--info) 12%, transparent);
  color: var(--info);
}

.bp-badge--muted {
  background: var(--muted);
  color: var(--muted-foreground);
}

.bp-badge--primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.bp-badge--accent {
  background: color-mix(in oklch, var(--accent) 15%, transparent);
  color: var(--accent);
}

.bp-badge--tertiary {
  background: color-mix(in oklch, var(--tertiary) 12%, transparent);
  color: var(--tertiary);
}

/* ============================================
 * BUTTON
 * ============================================ */
.bp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  min-height: 44px; /* WCAG 2.5.8 touch target minimum */
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--duration-fast) var(--ease-default),
              transform var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default),
              border-color var(--duration-fast) var(--ease-default),
              opacity var(--duration-fast) var(--ease-default);
  white-space: nowrap;
  text-decoration: none;
}

/* On larger screens, allow smaller buttons — desktop has precise pointer */
@media (min-width: 768px) {
  .bp-btn {
    min-height: unset;
  }
}

.bp-btn:active:not(:disabled):not(.bp-btn--disabled) {
  transform: scale(0.97);
}

.bp-btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  transition: outline-offset var(--duration-fast) var(--ease-default);
}

.bp-btn:disabled,
.bp-btn--disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.bp-btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.bp-btn--primary:hover {
  background: var(--primary-hover);
}

.bp-btn--primary:active {
  background: var(--primary-active);
}

.bp-btn--secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border);
}

.bp-btn--secondary:hover {
  background: var(--muted);
}

.bp-btn--ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.bp-btn--ghost:hover {
  background: var(--muted);
  color: var(--foreground);
}

.bp-btn--destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.bp-btn--destructive:hover {
  opacity: 0.9;
}

.bp-btn--outline {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}

.bp-btn--outline:hover {
  background: var(--muted);
  border-color: color-mix(in oklch, var(--foreground) 20%, var(--border));
}

.bp-btn--accent {
  background: var(--accent);
  color: var(--accent-foreground);
}

.bp-btn--accent:hover {
  background: var(--accent-hover);
}

.bp-btn--sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

.bp-btn--lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

.bp-btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
}

.bp-btn--icon.bp-btn--sm {
  width: 28px;
  height: 28px;
}

.bp-btn--loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.bp-btn--loading::after {
  content: '';
  position: absolute;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--radius-full);
  animation: bp-spin 0.6s linear infinite;
  color: var(--primary-foreground);
}

/* ============================================
 * INPUT / SELECT / TEXTAREA
 * ============================================ */
.bp-input,
.bp-select,
.bp-textarea {
  padding: var(--space-2) var(--space-3);
  min-height: 44px; /* WCAG 2.5.8 touch target minimum */
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-default);
  width: 100%;
}

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

.bp-input:focus-visible,
.bp-select:focus-visible,
.bp-textarea:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -1px;
}

.bp-input::placeholder,
.bp-textarea::placeholder {
  color: var(--muted-foreground);
}

.bp-input--error,
.bp-select--error,
.bp-textarea--error {
  border-color: var(--destructive);
}

.bp-textarea {
  min-height: 80px;
  resize: vertical;
}

.bp-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
}

.bp-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.bp-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.bp-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--foreground);
}

.bp-field-error {
  font-size: var(--text-xs);
  color: var(--destructive);
}

/* ============================================
 * SEARCH
 * ============================================ */
.bp-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  transition: border-color var(--duration-fast) var(--ease-default);
}

.bp-search:focus-within {
  border-color: var(--ring);
}

.bp-search input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  flex: 1;
  min-width: 0;
}

.bp-search input::placeholder {
  color: var(--muted-foreground);
}

/* ============================================
 * LAYOUT HELPERS
 * ============================================ */
.bp-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.bp-row--wrap {
  flex-wrap: wrap;
}

.bp-row--between {
  justify-content: space-between;
}

.bp-field-hint {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.bp-field-hint--error {
  color: var(--destructive);
}

/* ============================================
 * 12-COLUMN GRID SYSTEM
 *
 * Usage:
 *   Container: .bp-grid
 *   Items:     .bp-col-span-{1..12}
 *
 * Responsive collapse (mobile-first):
 *   Base (< 640px):   all items full-width (1 col)
 *   640px-1023px:     proportional 6-col mode
 *   >= 1024px:        full 12-column layout
 *
 * Overflow prevention:
 *   minmax(0, 1fr) on tracks + min-width:0 on items
 *   ensures NO widget can break out of its column.
 *
 * Legacy compat: .bp-grid--2/3/4/auto still work.
 * ============================================ */

.bp-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
  padding: var(--grid-pad);
}

@media (min-width: 640px) {
  .bp-grid {
    gap: var(--grid-gap-lg);
  }
}

@media (min-width: 1024px) {
  .bp-grid {
    padding: var(--grid-pad-lg);
  }
}

/* ── Column Span Classes ─────────────────────
 * Mobile-first: all items full-width.
 * 640px+: proportional tablet layout.
 * 1024px+: full 12-column desktop layout.
 */

.bp-col-span-1, .bp-col-span-2, .bp-col-span-3,
.bp-col-span-4, .bp-col-span-5, .bp-col-span-6,
.bp-col-span-7, .bp-col-span-8, .bp-col-span-9,
.bp-col-span-10, .bp-col-span-11, .bp-col-span-12 {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 640px) {
  .bp-col-span-1  { grid-column: span 3; }
  .bp-col-span-2  { grid-column: span 3; }
  .bp-col-span-3  { grid-column: span 6; }
  .bp-col-span-4  { grid-column: span 6; }
  .bp-col-span-5  { grid-column: span 6; }
  .bp-col-span-6  { grid-column: span 6; }
  .bp-col-span-7  { grid-column: span 12; }
  .bp-col-span-8  { grid-column: span 12; }
  .bp-col-span-9  { grid-column: span 12; }
  .bp-col-span-10 { grid-column: span 12; }
  .bp-col-span-11 { grid-column: span 12; }
  .bp-col-span-12 { grid-column: span 12; }
}

@media (min-width: 1024px) {
  .bp-col-span-1  { grid-column: span 1; }
  .bp-col-span-2  { grid-column: span 2; }
  .bp-col-span-3  { grid-column: span 3; }
  .bp-col-span-4  { grid-column: span 4; }
  .bp-col-span-5  { grid-column: span 5; }
  .bp-col-span-6  { grid-column: span 6; }
  .bp-col-span-7  { grid-column: span 7; }
  .bp-col-span-8  { grid-column: span 8; }
  .bp-col-span-9  { grid-column: span 9; }
  .bp-col-span-10 { grid-column: span 10; }
  .bp-col-span-11 { grid-column: span 11; }
  .bp-col-span-12 { grid-column: span 12; }
}

/* Full-width utility — always spans all columns */
.bp-col-full {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
}

/* ── Convenience grid helpers ──
 * Override the 12-column base with simple N-column layouts.
 * Mobile: single column stack (1fr).
 * 640px+: 2 columns.
 * 1024px+: target N columns.
 */
.bp-grid--2,
.bp-grid--3,
.bp-grid--4 {
  grid-template-columns: 1fr;
}

.bp-grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
}

@media (min-width: 640px) {
  .bp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bp-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bp-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .bp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bp-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================
 * SIDEBAR
 * ============================================ */
.bp-sidebar {
  /* Use dedicated sidebar tokens so the sidebar stays dark in both light and
   * dark modes. --primary flips to near-white in dark mode (used for text on
   * dark backgrounds), which would make the sidebar appear light — --sidebar-bg
   * avoids this by always resolving to a dark brand-hued surface. */
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--duration-normal) var(--ease-default),
              transform var(--duration-normal) var(--ease-default);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 50;
  width: 260px;
  transform: translateX(-100%);
}

.bp-sidebar--collapsed {
  width: 64px;
}

@media (min-width: 768px) {
  .bp-sidebar {
    position: relative;
    transform: none;
    z-index: 10;
    box-shadow: 1px 0 0 color-mix(in oklch, var(--border) 10%, transparent);
  }
}

.bp-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid color-mix(in oklch, var(--sidebar-fg) 8%, transparent);
}

.bp-sidebar__logo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: color-mix(in oklch, var(--sidebar-fg) 12%, transparent);
  flex-shrink: 0;
}

.bp-sidebar__title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  letter-spacing: -0.025em;
  line-height: var(--leading-tight);
}

.bp-sidebar__subtitle {
  font-size: var(--text-xs);
  opacity: 0.55;
  line-height: var(--leading-tight);
}

.bp-sidebar__nav {
  flex: 1;
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
}

.bp-sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  min-height: 44px; /* WCAG 2.5.8 touch target minimum */
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: color-mix(in oklch, var(--sidebar-fg) 65%, transparent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-align: left;
  width: 100%;
  transition: all var(--duration-fast) var(--ease-default);
  position: relative;
}

.bp-sidebar__item:hover {
  background: color-mix(in oklch, var(--sidebar-fg) 8%, transparent);
  color: color-mix(in oklch, var(--sidebar-fg) 90%, transparent);
}

.bp-sidebar__item:focus-visible {
  outline: 2px solid var(--sidebar-fg);
  outline-offset: -2px;
}

.bp-sidebar__item--active {
  background: color-mix(in oklch, var(--sidebar-fg) 12%, transparent);
  color: var(--sidebar-fg);
  font-weight: var(--font-semibold);
}

.bp-sidebar__item--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(1);
  width: 3px;
  height: 60%;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  background: var(--sidebar-fg);
  opacity: 0.8;
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out);
}

.bp-sidebar__item:not(.bp-sidebar__item--active)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  background: var(--sidebar-fg);
  opacity: 0;
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out);
}

.bp-sidebar__item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bp-sidebar__item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bp-sidebar--collapsed .bp-sidebar__item {
  justify-content: center;
  padding: var(--space-2);
}

.bp-sidebar--collapsed .bp-sidebar__item-label {
  display: none;
}

.bp-sidebar--collapsed .bp-sidebar__nav {
  padding: var(--space-3) var(--space-1);
}

.bp-sidebar__footer {
  padding: var(--space-3);
  border-top: 1px solid color-mix(in oklch, var(--sidebar-fg) 8%, transparent);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bp-sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1);
}

.bp-sidebar__avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: color-mix(in oklch, var(--sidebar-fg) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bp-sidebar__user-email {
  font-size: var(--text-xs);
  opacity: 0.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
 * HEADER
 * ============================================ */
.bp-header {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  background: var(--background);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .bp-header {
    padding: 0 var(--space-6);
  }
}

.bp-header__breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
}

.bp-header__crumb {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  font-weight: var(--font-medium);
}

.bp-header__crumb--active {
  color: var(--foreground);
  font-weight: var(--font-semibold);
}

.bp-header__crumb-sep {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  opacity: 0.4;
}

.bp-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================
 * CONTENT AREA
 * ============================================ */
.bp-content {
  flex: 1;
  overflow-y: auto;
  background: var(--muted);
}

.bp-content__inner {
  padding: var(--space-4);
}

@media (min-width: 768px) {
  .bp-content__inner {
    padding: var(--space-5);
  }
}

/* ============================================
 * STAT CARD
 * ============================================ */
.bp-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.bp-stat__label {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bp-stat__value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--foreground);
  line-height: var(--leading-tight);
}

.bp-stat__meta {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* ============================================
 * TOOLBAR
 * ============================================ */
.bp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .bp-toolbar {
    padding: var(--space-3) var(--space-5);
  }
}

.bp-toolbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.bp-toolbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ─── Filter Pills ──────────────────────────────────────── */
.bp-filter-pills {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.bp-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
}
.bp-pill:hover {
  background: color-mix(in oklch, var(--muted) 40%, transparent);
  color: var(--foreground);
}
.bp-pill--active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.bp-pill--active:hover {
  background: color-mix(in oklch, var(--primary) 85%, transparent);
}
.bp-pill:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.bp-pill__count {
  font-weight: var(--font-medium);
  color: color-mix(in oklch, var(--muted-foreground) 70%, transparent);
}

/* ============================================
 * PAGINATION
 * ============================================ */
.bp-pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
}

@media (min-width: 768px) {
  .bp-pagination {
    padding: var(--space-3) var(--space-5);
  }
}

.bp-pagination__btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.bp-pagination__btn:hover:not(:disabled) {
  background: var(--muted);
  color: var(--foreground);
}

.bp-pagination__btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.bp-pagination__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.bp-pagination__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.bp-pagination__num:hover {
  background: var(--muted);
  color: var(--foreground);
}

.bp-pagination__num--active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  font-weight: var(--font-semibold);
}

.bp-pagination__info {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* ============================================
 * SKELETON (Loading States)
 * ============================================ */
.bp-skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--muted) 25%, var(--accent) 50%, var(--muted) 75%);
  background-size: 200% 100%;
  animation: bp-shimmer 1.5s var(--ease-default) infinite;
}

.bp-skeleton--text {
  height: 1em;
  width: 80%;
}

.bp-skeleton--heading {
  height: 1.5em;
  width: 50%;
}

.bp-skeleton--card {
  height: 120px;
  width: 100%;
}

.bp-skeleton--avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
}

.bp-skeleton--row {
  height: 2.5em;
  width: 100%;
}

/* ============================================
 * TIMELINE
 * ============================================ */
.bp-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.bp-timeline__step {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  position: relative;
}

.bp-timeline__step::before {
  content: '';
  position: absolute;
  left: 11px;
  top: calc(var(--space-3) + 24px);
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.bp-timeline__step:last-child::before {
  display: none;
}

.bp-timeline__marker {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  z-index: 1;
}

.bp-timeline__step--active .bp-timeline__marker {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

.bp-timeline__step--done .bp-timeline__marker {
  border-color: var(--success);
  background: var(--success);
  color: var(--success-foreground);
}

.bp-timeline__step--error .bp-timeline__marker {
  border-color: var(--destructive);
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.bp-timeline__step--done::before {
  background: var(--success);
}

.bp-timeline__body {
  flex: 1;
  min-width: 0;
}

.bp-timeline__title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--foreground);
}

.bp-timeline__subtitle {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  margin-top: var(--space-1);
}

.bp-timeline__content {
  margin-top: var(--space-2);
}

/* ============================================
 * MODAL / DIALOG
 * ============================================ */
.bp-modal__overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-4);
  animation: bp-fade-in var(--duration-fast) var(--ease-default);
}

.bp-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: bp-scale-in var(--duration-normal) var(--ease-default);
}

.bp-modal--lg {
  max-width: 640px;
}

.bp-modal--xl {
  max-width: 800px;
}

.bp-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.bp-modal__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  margin: 0;
}

.bp-modal__body {
  padding: var(--space-5);
  overflow-y: auto;
  flex: 1;
}

.bp-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
}

/* ============================================
 * TOAST / NOTIFICATION
 * ============================================ */
.bp-toast-container {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 380px;
  width: 100%;
}

.bp-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: bp-toast-in var(--duration-normal) var(--ease-out);
}

.bp-toast--success {
  border-left: 3px solid var(--success);
}

.bp-toast--destructive {
  border-left: 3px solid var(--destructive);
}

.bp-toast--warning {
  border-left: 3px solid var(--warning);
}

.bp-toast--info {
  border-left: 3px solid var(--info);
}

.bp-toast__message {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--foreground);
}

.bp-toast__close {
  flex-shrink: 0;
  cursor: pointer;
  color: var(--muted-foreground);
  background: none;
  border: none;
  padding: var(--space-1);
}

.bp-toast__close:hover {
  color: var(--foreground);
}
.bp-toast__close:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================
 * TABS
 * ============================================ */
.bp-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bp-tabs__tab {
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--muted-foreground);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-default);
}

.bp-tabs__tab:hover {
  color: var(--foreground);
}

.bp-tabs__tab:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.bp-tabs__tab--active {
  color: var(--foreground);
  border-bottom-color: var(--primary);
  font-weight: var(--font-semibold);
}

.bp-tabs__panel {
  padding: var(--space-4) 0;
}

/* ============================================
 * FILTERS / PILLS
 * ============================================ */
.bp-filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.bp-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.bp-filter-pill:hover {
  border-color: color-mix(in oklch, var(--foreground) 20%, transparent);
  color: var(--foreground);
}

.bp-filter-pill:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.bp-filter-pill--active,
.bp-filter-pill--active:hover,
.bp-filter-pill--active:active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* ============================================
 * UTILITY TEXT
 * ============================================ */
.bp-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.bp-count {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.bp-sort-arrow {
  display: inline-block;
  margin-left: var(--space-1);
  font-size: var(--text-xs);
  opacity: 0.6;
}

/* ============================================
 * JSON VIEWER
 * ============================================ */
.bp-json {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
  color: var(--foreground);
}

/* ============================================
 * ICON SIZING — see governed block at end of file
 * (icon-registry.json → bp-icon--sm/md/lg/xl)
 * ============================================ */

/* ============================================
 * STATUS INDICATOR
 * ============================================ */
.bp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.bp-status-dot--success { background: var(--success); }
.bp-status-dot--warning { background: var(--warning); }
.bp-status-dot--destructive { background: var(--destructive); }
.bp-status-dot--info { background: var(--info); }
.bp-status-dot--muted { background: var(--muted-foreground); }

/* ============================================
 * APP SHELL LAYOUT
 * ============================================ */
.bp-app {
  display: flex;
  height: 100vh; /* fallback for browsers without dvh support */
  height: 100dvh; /* dynamic viewport height — prevents mobile address bar wobble */
  background: var(--background);
  overflow: hidden; /* page-level scroll disabled — only bp-content scrolls */
}

.bp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ============================================
 * LOADING STATES
 * ============================================ */
.bp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: var(--space-4);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
}

.bp-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: bp-spin 0.7s linear infinite;
}

.bp-widget-loading__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
}

.bp-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-8);
  color: var(--destructive);
  font-family: var(--font-sans);
  text-align: center;
}

/* ============================================
 * ANIMATIONS
 * ============================================ */
@keyframes bp-spin {
  to { transform: rotate(360deg); }
}

@keyframes bp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes bp-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bp-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes bp-slide-in-right {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes bp-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bp-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================
 * REDUCED MOTION
 * ============================================ */
@media (prefers-reduced-motion: reduce) {
  .bp-spinner,
  .bp-btn--loading::after {
    animation-duration: 1.5s;
  }

  .bp-btn,
  .bp-card--interactive,
  .bp-toast,
  .bp-skeleton,
  .bp-sidebar__item,
  .bp-sidebar__item::before,
  .bp-sidebar__item:not(.bp-sidebar__item--active)::before,
  .bp-expandable-row__header,
  .bp-tabs__tab,
  .bp-sidebar,
  .bp-modal,
  .bp-cmdk {
    animation: none;
    transition: none;
  }

  .bp-btn:active:not(:disabled):not(.bp-btn--disabled) {
    transform: none;
  }

  .bp-card--interactive:hover {
    transform: none;
  }
}

/* ============================================
 * BLUEPRINT NAVIGATOR WIDGET
 * pcc.blueprint-navigator.widget.js
 * Governed: G14 — no inline styles in widgets.
 * ============================================ */

/* Widget header row: source-version badge row beneath the card edge */
.bp-widget-header {
  margin-bottom: var(--space-2);
}

/* Raw node ID display in list cards — audit trail element */
.bp-node-id-code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* Detail row: ID row in the node detail panel needs bottom clearance */
.bp-detail-row--mb {
  margin-bottom: var(--space-2);
}

/* Flex-tags badge row in detail panel: clearance before property list */
.bp-flex-tags--mb {
  margin-bottom: var(--space-3);
}

/* Detail panel sections (AI, children, edges): top separation from above content */
.bp-section--mt {
  margin-top: var(--space-3);
}

/* Muted extra-small text — site meta, secondary labels */
.bp-text-xs--muted {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* Inline code at extra-small size — path labels, audit trails */
.bp-code--xs {
  font-size: var(--text-xs);
}

/* Block code at extra-small size — stacked legacy URL lists */
.bp-code--block-xs {
  display: block;
  font-size: var(--text-xs);
}

/* Small top margin (space-2) — service footprint sections */
.bp-section--mt-sm {
  margin-top: var(--space-2);
}

/* Larger top margin (space-4) — section separators in multi-block layouts */
.bp-section--mt-lg {
  margin-top: var(--space-4);
}

/* ════════════════════════════════════════════════════════════════════════
   PROMOTED WIDGET CLASSES — Extracted from pcc.css (Phase A)
   T-PHOENIX-PCC-CSS-ELIMINATION-001
   Sections: Live Sites Grid, PCC Utility Classes (promoted), Widget Showcase, Badge Outline + Card Header Actions, Graph Integration Utilities, Doc States, Tech Stack Cards, Text Utilities (shared)
   ════════════════════════════════════════════════════════════════════════ */

/* Live-site link cards — safe minimum with min() */
.bp-live-sites-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding: var(--space-3);
}

@media (min-width: 768px) {
  .bp-live-sites-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    padding: var(--space-4) var(--space-5);
  }
}

.bp-live-site {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-default);
}

.bp-live-site:hover {
  border-color: color-mix(in oklch, var(--primary) 40%, transparent);
}

.bp-live-site__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--foreground);
}

.bp-live-site__url {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--info);
  text-decoration: none;
  word-break: break-all;
}

.bp-live-site__url:hover {
  text-decoration: underline;
}

.bp-live-site__meta {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* ============================================
 * PCC UTILITY CLASSES
 * Added to eliminate inline styles.
 * All token-based, no hardcoded values.
 * ============================================ */

/* Stat grid — mobile-first responsive */
.bp-stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 480px) {
  .bp-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .bp-stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Stat button (clickable stat card) */
.bp-stat--btn {
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  width: 100%;
}

/* Stat value colour modifiers */
.bp-stat__value--success { color: var(--success); }
.bp-stat__value--warning { color: var(--warning); }
.bp-stat__value--destructive { color: var(--destructive); }

/* Progress bar */
.bp-progress {
  margin-top: var(--space-4);
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--muted);
  overflow: hidden;
  display: flex;
}

.bp-progress__segment--success {
  flex: var(--segment-flex, 0);
  background: var(--success);
  transition: flex var(--duration-normal) var(--ease-default);
}

.bp-progress__segment--warning {
  flex: var(--segment-flex, 0);
  background: var(--warning);
  transition: flex var(--duration-normal) var(--ease-default);
}

.bp-progress__segment--destructive {
  flex: var(--segment-flex, 0);
  background: var(--destructive);
  transition: flex var(--duration-normal) var(--ease-default);
}

/* Timestamp / count row with top margin */
.bp-count--mt {
  margin-top: var(--space-3);
}

/* Controls row (playground form row) */
.bp-controls-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

/* Label-field layout (label + input stacked) */
.bp-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

@media (min-width: 768px) {
  .bp-field {
    min-width: 200px;
  }
}

/* Field label text */
.bp-field__label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--muted-foreground);
}

/* Native select styled with tokens */
.bp-select {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

/* Response header row */
.bp-response-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Response title */
.bp-response-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--foreground);
}

/* Empty / placeholder state — see full system at bottom of file */

/* bp-mono with medium weight */
.bp-mono--semibold {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

/* Table cell: xs text with overflow truncation */
.bp-td--xs-truncate {
  font-size: var(--text-xs);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Events table: wider truncate cell */
.bp-td--xs-truncate-wide {
  font-size: var(--text-xs);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Table cell: xs mono text */
.bp-td--xs-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* Search with constrained width */
.bp-search--constrained {
  max-width: 280px;
  flex: 1;
}

.bp-search--sm {
  max-width: 240px;
  flex: 1;
}

/* Step functions section separator */
.bp-section-header {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
}

.bp-section-header__title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--foreground);
}

/* Live sites grid empty state */
.bp-live-sites-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted-foreground);
  padding: var(--space-8);
}

/* Live site header row */
.bp-live-site__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Magic-link verifying overlay */
.bp-verify-overlay {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  font-family: var(--font-sans);
}

.bp-verify-inner {
  text-align: center;
}

.bp-verify-inner p {
  color: var(--muted-foreground);
  margin-top: var(--space-4);
}

/* Auth error toast (magic-link error banner) */
.bp-auth-error-banner {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  max-width: 28rem;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--destructive) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--destructive) 20%, transparent);
  color: var(--destructive);
  font-size: var(--text-sm);
  text-align: center;
}

/* Icon fallback placeholder — see governed block at end of file */

/* SchemaRenderer header */
.schema-renderer__header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

.schema-renderer__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--foreground);
}

.schema-renderer__desc {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

/* SortHeader th — cursor handled via th[data-sortable] in bp-table already,
   but SortHeader sets it explicitly. No extra class needed — use data-sortable. */

/* ============================================
 * WIDGET UTILITY CLASSES (inline-style replacements)
 *
 * Added to eliminate inline styles in PCC widgets.
 * All token-based — zero hardcoded values.
 * ============================================ */

/* --- Layout helpers --- */

/* flex row, centered items, wrapping */
.bp-flex-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.bp-flex-row--gap3 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.bp-flex-row--wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.bp-flex-row--between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.bp-flex-row--end {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.bp-flex-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.bp-flex-col--gap2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bp-flex-col--gap3 {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bp-flex-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* Section spacer used inside cards */
.bp-section {
  margin-bottom: var(--space-4);
}

/* Section heading line */
.bp-section__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  margin-bottom: var(--space-2);
  font-family: var(--font-sans);
  margin-top: 0;
}

/* H3 section divider (UI inventory) */
.bp-section-heading {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  margin: var(--space-4) 0 var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

/* --- card body padding variants --- */

.bp-card--padded {
  padding: var(--space-4);
}

.bp-card__body--grid2 {
  padding: var(--space-3);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .bp-card__body--grid2 {
    padding: var(--space-5);
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

/* Milestones + roadmap views */
.bp-view-padded {
  padding: var(--space-3);
}

@media (min-width: 768px) {
  .bp-view-padded {
    padding: var(--space-4) var(--space-5);
  }
}

/* Grid of milestone / module cards — safe minimum with min() */
.bp-auto-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding: var(--space-3);
}

@media (min-width: 768px) {
  .bp-auto-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
  }
}

.bp-auto-grid--ms {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .bp-auto-grid--ms {
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  }
}

.bp-auto-grid--cognito {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .bp-auto-grid--cognito {
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  }
}

/* Roadmap phase list */
.bp-roadmap-phase {
  margin-bottom: var(--space-5);
}

.bp-roadmap-milestones {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: var(--space-4);
  border-left: 2px solid var(--border);
}

/* Progress bar track */
.bp-progress-track {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--muted);
  overflow: hidden;
  margin-top: var(--space-1);
}

/* Progress bar fill — width set via --bp-progress-w custom property */
.bp-progress-fill {
  height: 100%;
  width: var(--bp-progress-w, 0%);
  transition: width var(--duration-normal) var(--ease-default);
}

.bp-progress-fill--done {
  background: var(--success);
}

.bp-progress-fill--partial {
  background: var(--info);
}
.bp-progress-fill--destructive {
  background: var(--destructive);
}

/* --- Text utilities --- */

.bp-text-sm {
  font-size: var(--text-sm);
  color: var(--foreground);
  font-family: var(--font-sans);
}

.bp-text-sm--semibold {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  font-family: var(--font-sans);
}

.bp-text-xs {
  font-size: var(--text-xs);
  color: var(--foreground);
  font-family: var(--font-sans);
}

.bp-text-xs--muted {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
}

.bp-text-xs--muted-block {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  margin-bottom: var(--space-2);
}

.bp-text-xl--bold {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--foreground);
  margin: 0 0 var(--space-1);
}

.bp-text-lg--semibold {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--foreground);
}

.bp-text-2xl--bold {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--foreground);
  line-height: var(--leading-tight);
}

.bp-text-label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
}

.bp-text-destructive {
  color: var(--destructive);
}

.bp-text-center {
  text-align: center;
}

/* muted paragraph (description) */
.bp-description {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  margin: 0;
  line-height: var(--leading-normal);
}

/* muted secondary paragraph with top margin */
.bp-sub-text {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  margin-top: var(--space-2);
}

/* Muted text centered (empty state) */
.bp-empty-text {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  text-align: center;
}

/* Span label above tag cloud */
.bp-tag-label {
  display: block;
  margin-bottom: var(--space-1);
}

/* --- Form inline styles --- */

/* Inline edit form container */
.bp-edit-form {
  padding: var(--space-4);
  background: var(--muted);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Row of form field groups */
.bp-form-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Individual label+input group */
.bp-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.bp-form-field--grow {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

/* Inline select / input within edit form */
.bp-form-select {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.bp-form-input {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

/* --- Table cell helpers --- */

.bp-td--max300 {
  max-width: 300px;
}

/* --- Search width constraint --- */
.bp-search--narrow {
  max-width: 240px;
}

.bp-search--medium {
  max-width: 280px;
  flex: 1;
}

/* --- KV (key-value) row for service detail --- */
.bp-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-1);
}

@media (min-width: 480px) {
  .bp-kv {
    flex-direction: row;
    gap: var(--space-2);
  }
}

.bp-kv__label {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-weight: var(--font-medium);
  min-width: 0;
  flex-shrink: 0;
  font-family: var(--font-sans);
}

@media (min-width: 480px) {
  .bp-kv__label {
    min-width: 120px;
  }
}

.bp-kv__value {
  font-size: var(--text-xs);
  color: var(--foreground);
  font-family: var(--font-sans);
  word-break: break-all;
}

.bp-kv__value--mono {
  font-size: var(--text-xs);
  color: var(--foreground);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* --- Expanded detail panel (UI inventory) --- */
.bp-expanded-detail {
  background: var(--muted);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .bp-expanded-detail {
    padding: var(--space-3) var(--space-4);
  }
}

.bp-expanded-detail__fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1) var(--space-4);
}

@media (min-width: 768px) {
  .bp-expanded-detail__fields {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

.bp-expanded-detail__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: var(--space-2);
}

.bp-expanded-detail__actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.bp-detail-item {
  font-size: var(--text-xs);
}

.bp-detail-item__key {
  font-weight: var(--font-semibold);
  color: var(--foreground);
}

.bp-detail-item__val {
  color: var(--muted-foreground);
  word-break: break-all;
}

/* --- Summary header stat cards (UI inventory) --- */
.bp-summary-header {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.bp-summary-card {
  padding: var(--space-3) var(--space-4);
  min-width: 140px;
  text-align: center;
}

.bp-summary-timestamp {
  align-self: flex-end;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* --- Widget card header block (UI inventory) --- */
.bp-card__intro {
  margin-bottom: var(--space-2);
}

/* --- Alias row in service detail --- */
.bp-alias-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

/* --- Env var tag cloud --- */
.bp-env-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* --- Cognito pool stat extras --- */
.bp-pool-badges {
  display: flex;
  gap: var(--space-2);
}

/* --- Table sortable cursor utility --- */
.bp-th--sortable {
  cursor: pointer;
}

/* --- Badge tiny size (10px) --- */
.bp-badge--tiny {
  font-size: 10px;
}

/* --- Roadmap badge no-shrink --- */
.bp-badge--no-shrink {
  min-width: fit-content;
}

/* --- Muted expanded row cell padding reset --- */
.bp-expanded-cell {
  padding: 0;
}

/* --- Status pill for IAM role cell --- */
.bp-mono--medium {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

/* --- Milestone card gap override --- */
.bp-stat--gap2 {
  gap: var(--space-2);
}

/* ============================================
 * UI INVENTORY WIDGET CLASSES
 * Extracted from inline styles.
 * All token-based — zero hardcoded values.
 * ============================================ */

/* Alert card: centered error/unavailable state */
.bp-alert-card {
  padding: var(--space-6);
  text-align: center;
}

/* Alert title (destructive heading) */
.bp-alert-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--destructive);
}

/* Alert description (muted body below title) */
.bp-alert-desc {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  margin-top: var(--space-2);
}

/* Summary stat label (below the big number) */
.bp-summary-label {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  margin-top: var(--space-1);
}

/* Card description (muted paragraph under heading) */
.bp-card-description {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

/* ============================================
 * MODULES-GRID WIDGET CLASSES
 * Extracted from inline styles.
 * All token-based — zero hardcoded values.
 * ============================================ */

/* Full-width empty state inside a CSS grid */
.bp-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted-foreground);
  padding: var(--space-8);
}

/* Flex row with tight gap (space-1) */
.bp-flex-row--gap1 {
  display: flex;
  gap: var(--space-1);
}

/* Margin-top: space-1 */
.bp-mt-1 {
  margin-top: var(--space-1);
}
.bp-mt-2 {
  margin-top: var(--space-2);
}
.bp-ml-1 {
  margin-left: var(--space-1);
}
.bp-ml-2 {
  margin-left: var(--space-2);
}

/* ============================================
 * SERVICE-DETAIL WIDGET CLASSES
 * Extracted from inline styles.
 * All token-based — zero hardcoded values.
 * ============================================ */

/* Layer item row in service detail */
.bp-layer-item {
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
  color: var(--foreground);
}

/* ============================================
 * INFRA-OVERVIEW WIDGET CLASSES
 * Extracted from inline styles.
 * All token-based — zero hardcoded values.
 * ============================================ */

/* Section header row (flex, centered, gap-2, mb-3) */
.bp-section-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* Section title (h4 reset, sm semibold foreground) */
.bp-section-row__title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--foreground);
}

/* Muted sm text (no margin) */
.bp-text-sm--muted {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
}

/* Mono text with muted colour */
.bp-mono--muted {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* ============================================
 * SHARED WIDGET: COMPONENT GALLERY (shared.component-gallery)
 * ============================================ */

.bp-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.bp-gallery__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.bp-gallery__section-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  font-family: var(--font-sans);
  margin: 0;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.bp-gallery__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.bp-gallery__row-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.bp-gallery__toast-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 420px;
}

.bp-gallery__skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ============================================
 * BADGE OUTLINE variant
 * ============================================ */
.bp-badge--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

/* ============================================
 * CARD HEADER ACTIONS
 * ============================================ */
.bp-card__header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════════════════
   Graph Integration — Modules & Apps, Blueprint Navigator, Site Wiring
   Added 2026-02-26 for v2.0.0 graph integration
   ═══════════════════════════════════════════════════════════════════════ */

/* Widget header — consistent title row with padding */
.bp-widget-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

/* Clickable stat cards (expand/collapse) */
.bp-stat--clickable {
  cursor: pointer;
  transition: box-shadow var(--duration-fast) var(--ease-default);
}
.bp-stat--clickable:hover {
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--primary) 30%, transparent);
}
.bp-stat--clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Selected state for cards */
.bp-stat--selected {
  box-shadow: 0 0 0 2px var(--primary);
}

/* Compact stat card for list items */
.bp-stat--compact {
  padding: var(--space-3) var(--space-4);
}

/* Expanded section inside cards */
.bp-section--expanded {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
  margin-top: var(--space-3);
}

/* Section with top margin (detail panel sections) */
.bp-section--mt {
  margin-top: var(--space-3);
}

/* Detail rows for expanded info */
.bp-detail-row {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  padding: 2px 0;
  align-items: baseline;
}
.bp-detail-row--mb {
  margin-bottom: var(--space-2);
}
.bp-detail-label {
  color: var(--muted-foreground);
  min-width: 90px;
  flex-shrink: 0;
  font-weight: var(--font-medium);
}

/* Node ID code (muted, monospace) */
.bp-node-id-code {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-family: var(--font-mono);
}

/* Flex tags with bottom margin variant */
.bp-flex-tags--mb {
  margin-bottom: var(--space-3);
}

/* Flex row start alignment */
.bp-flex-row--start {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Doc tab loading/empty states */
.bp-doc-loading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.bp-doc-empty {
  padding: var(--space-5);
  text-align: center;
}

.bp-doc-error {
  padding: var(--space-5);
  color: var(--destructive);
  font-size: var(--text-sm);
}

.bp-doc-content {
  padding: var(--space-4) var(--space-5);
}

/* ============================================
 * SHARED WIDGET: SERVICE DETAIL — EXPANDABLE ROWS (shared.service-detail, shared.data-table)
 * ============================================ */

.bp-expandable-row__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--foreground);
  transition: background var(--duration-fast) var(--ease-default);
}

@media (hover: hover) {
  .bp-expandable-row__header:hover {
    background: color-mix(in oklch, var(--muted) 50%, transparent);
  }
}

.bp-expandable-row__header:active {
  background: color-mix(in oklch, var(--muted) 70%, transparent);
}

.bp-expandable-toggle {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.bp-expandable-row__chevron {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  flex-shrink: 0;
}

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

.bp-expandable-body {
  padding: var(--space-4) var(--space-5);
  background: color-mix(in oklch, var(--muted) 30%, transparent);
  border-top: 1px solid var(--border);
}

.bp-expandable-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .bp-expandable-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.bp-expandable-detail-row {
  background: color-mix(in oklch, var(--muted) 20%, transparent);
}

/* JSON compact viewer */
.bp-json--compact {
  max-height: 120px;
  overflow-y: auto;
  font-size: var(--text-xs);
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.bp-json-samples {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Dependency rows */
.bp-dep-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  border-bottom: 1px solid color-mix(in oklch, var(--border) 50%, transparent);
}

.bp-dep-source {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--foreground);
  font-weight: var(--font-medium);
}

.bp-dep-arrow {
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.bp-dep-label {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-style: italic;
}

/* Warning banner */
.bp-warning-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: color-mix(in oklch, var(--warning) 15%, transparent);
  border: 1px solid color-mix(in oklch, var(--warning) 40%, transparent);
  border-radius: var(--radius-md);
  color: var(--warning);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

.bp-warning-banner__icon {
  font-size: var(--text-base);
  flex-shrink: 0;
}

.bp-warning-icon {
  color: var(--warning);
  font-size: var(--text-xs);
}

.bp-tr--warning td:first-child {
  color: var(--warning);
}

.bp-tr--expanded {
  background: color-mix(in oklch, var(--primary) 5%, transparent);
}

/* ============================================
 * SHARED WIDGET: TECH STACK CARDS (shared.infra-overview)
 * ============================================ */

.bp-tech-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-3);
}

@media (min-width: 640px) {
  .bp-tech-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .bp-tech-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.bp-tech-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: box-shadow var(--duration-fast) var(--ease-default);
}

@media (hover: hover) {
  .bp-tech-card:hover {
    box-shadow: var(--shadow-md);
  }
}

.bp-tech-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.bp-tech-card__icon {
  font-size: var(--text-lg);
}

.bp-tech-card__category {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bp-tech-card__name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--foreground);
}

.bp-tech-card__version {
  font-size: var(--text-xs);
  color: var(--primary);
  font-family: var(--font-mono);
}

.bp-tech-card__detail {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* ============================================
 * SHARED WIDGET: LAYER MODEL (shared.infra-overview)
 * ============================================ */

.bp-layer-model {
  padding-top: var(--space-3);
}

.bp-layer-model__header {
  margin-bottom: var(--space-4);
}

.bp-layer-model__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.bp-layer-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bp-layer-box--runtime {
  border-color: color-mix(in oklch, var(--info) 40%, var(--border));
  background: color-mix(in oklch, var(--info) 5%, var(--card));
}

.bp-layer-box--data {
  border-color: color-mix(in oklch, var(--success) 40%, var(--border));
  background: color-mix(in oklch, var(--success) 5%, var(--card));
}

.bp-layer-box--exempt {
  border-color: color-mix(in oklch, var(--muted-foreground) 30%, var(--border));
  background: color-mix(in oklch, var(--muted) 50%, var(--card));
}

.bp-layer-box__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.bp-layer-box__badge {
  flex-shrink: 0;
}

.bp-layer-box__desc {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.bp-layer-box__count {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--muted-foreground);
}

.bp-layer-box__services {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* ============================================
 * TEXT UTILITIES (shared)
 * ============================================ */

.bp-text-xs--muted {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.bp-text-xs {
  font-size: var(--text-xs);
}

/* ============================================
 * BUTTON WARNING VARIANT
 * ============================================ */
.bp-btn--warning {
  background-color: color-mix(in oklch, var(--warning) 15%, transparent);
  color: var(--warning);
  border: 1px solid color-mix(in oklch, var(--warning) 30%, transparent);
}
.bp-btn--warning:hover:not(:disabled) {
  background-color: color-mix(in oklch, var(--warning) 25%, transparent);
}

/* ============================================
 * MODAL CLOSE BUTTON
 * ============================================ */
.bp-modal__close {
  padding: var(--space-1) var(--space-2);
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-size: var(--text-xl);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.bp-modal__close:hover {
  background-color: color-mix(in oklch, var(--muted) 50%, transparent);
  color: var(--foreground);
}

/* ============================================
 * SHARED STATE: EMPTY STATE PATTERNS
 * ============================================ */
/* Full-featured empty state component for tables, lists, and dashboards. */
/* Three layout variants: default (full), compact, and inline.            */
.bp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  text-align: center;
}

.bp-empty-state__icon {
  font-size: 3rem;
  color: var(--muted-foreground);
  margin-bottom: var(--space-3);
  opacity: 0.5;
  line-height: 1;
}

.bp-empty-state__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  font-family: var(--font-sans);
  margin: 0 0 var(--space-1) 0;
}

.bp-empty-state__message {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  max-width: 320px;
  margin: 0 0 var(--space-4) 0;
  line-height: var(--leading-relaxed);
}

.bp-empty-state__action {
  margin-top: var(--space-2);
}

/* Compact variant — tighter spacing for cards and panels */
.bp-empty-state--compact {
  padding: var(--space-4) var(--space-3);
}

.bp-empty-state--compact .bp-empty-state__icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.bp-empty-state--compact .bp-empty-state__title {
  font-size: var(--text-base);
}

.bp-empty-state--compact .bp-empty-state__message {
  font-size: var(--text-xs);
  margin-bottom: var(--space-3);
}

/* Inline variant — horizontal layout for table rows */
.bp-empty-state--inline {
  flex-direction: row;
  gap: var(--space-3);
  text-align: left;
  padding: var(--space-3);
  justify-content: flex-start;
}

.bp-empty-state--inline .bp-empty-state__icon {
  font-size: 1.5rem;
  margin-bottom: 0;
  flex-shrink: 0;
}

.bp-empty-state--inline .bp-empty-state__title {
  font-size: var(--text-sm);
  margin-bottom: 0;
}

.bp-empty-state--inline .bp-empty-state__message {
  font-size: var(--text-xs);
  max-width: none;
  margin-bottom: 0;
}

.bp-empty-state--inline .bp-empty-state__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* ============================================
 * TOAST FIXED VARIANT (top-right positioning)
 * ============================================ */
.bp-toast--fixed {
  position: fixed;
  z-index: 1000;
  left: var(--space-3);
  right: var(--space-3);
  top: var(--space-3);
}
@media (min-width: 480px) {
  .bp-toast--fixed {
    left: auto;
    right: var(--space-4);
    top: var(--space-4);
    max-width: 380px;
  }
}

/* ============================================
 * TRUNCATE UTILITY
 * ============================================ */
.bp-truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

/* ============================================
 * TIMELINE — Vertical Step Progress
 * ============================================ */
.bp-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: var(--space-4);
}
.bp-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-color: var(--border);
}

.bp-timeline__step {
  display: flex;
  flex-direction: column;
  padding: var(--space-2) 0;
  position: relative;
}
.bp-timeline__step-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.bp-timeline__step-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-left: calc(-1 * var(--space-4));
  position: relative;
  z-index: 1;
}
.bp-timeline__step--pending .bp-timeline__step-dot {
  background-color: var(--muted);
  border: 2px solid var(--border);
}
.bp-timeline__step--completed .bp-timeline__step-dot {
  background-color: var(--success);
}
.bp-timeline__step--running .bp-timeline__step-dot {
  background-color: var(--primary);
  animation: bp-timeline-pulse 1.5s ease-in-out infinite;
}
.bp-timeline__step--failed .bp-timeline__step-dot {
  background-color: var(--destructive);
}
@keyframes bp-timeline-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.bp-timeline__step-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}
.bp-timeline__step-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--foreground);
  text-transform: capitalize;
}
.bp-timeline__step-duration {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}
.bp-timeline__step-error {
  font-size: var(--text-xs);
  color: var(--destructive);
  margin-top: var(--space-1);
  margin-left: var(--space-6);
  padding: var(--space-1) var(--space-2);
  background-color: color-mix(in oklch, var(--destructive) 10%, transparent);
  border-radius: var(--radius-sm);
}

/* Timeline failure banner */
.bp-timeline__failure {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background-color: color-mix(in oklch, var(--destructive) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--destructive) 20%, transparent);
  border-radius: var(--radius-md);
  color: var(--destructive);
  font-size: var(--text-sm);
}
.bp-timeline__failure-title {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
}
.bp-timeline__failure-text {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .bp-timeline__step--running .bp-timeline__step-dot {
    animation: none;
  }
}

/* ============================================
 * CALLOUT — Soft Info Box
 * ============================================ */
.bp-callout {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: color-mix(in oklch, var(--primary) 5%, transparent);
  border: 1px solid color-mix(in oklch, var(--primary) 15%, transparent);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--foreground);
  line-height: 1.6;
}
.bp-callout__title {
  font-weight: var(--font-bold);
  margin-bottom: var(--space-1);
}
.bp-callout__text {
  margin: 0;
}
.bp-callout--destructive {
  border-left: 3px solid var(--destructive);
}
.bp-callout--info {
  border-left: 3px solid var(--info);
}
.bp-callout--warning {
  border-left: 3px solid var(--warning);
}



/* ============================================
 * TABLE ROW: selected state
 * ============================================ */

.bp-table__row--selected {
  background: color-mix(in oklch, var(--primary) 8%, transparent);
}

.bp-table tbody tr[style*="cursor: pointer"]:hover {
  background: color-mix(in oklch, var(--muted) 40%, transparent);
}


/* ─── Mobile responsiveness improvements (Task C) ──────────────────── */

/* Toolbar: wrapping and gap on small screens (mobile-first, reinforces line 891) */
.bp-toolbar {
  flex-wrap: wrap;
  gap: var(--space-2);
}

.bp-toolbar__right {
  flex-shrink: 0;
}

/* Card header: mobile-first stacked, side-by-side at 480px+ */
.bp-card__header {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

@media (min-width: 480px) {
  .bp-card__header {
    flex-direction: row;
    align-items: center;
    gap: 0;
  }
}

/* Form fields: full-width and overflow-safe by default (mobile-first) */
.bp-input,
.bp-select,
.bp-textarea {
  max-width: 100%;
  box-sizing: border-box;
}

.bp-field {
  width: 100%;
}

/* Buttons: text overflow protection */
.bp-btn {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Table containers: overflow scroll utility class */
.bp-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* ─── Gradient preview swatch (token-editor Task B) ─────────────────── */
/* --bp-gradient-bg is set via useEffect (GradientPreviewSwatch component) */
.bp-gradient-preview {
  height: 48px;
  border-radius: var(--radius);
  background: var(--bp-gradient-bg, var(--muted));
}

/* ─── Gradient preset grid and card (token-editor Task B) ───────────── */
.bp-token-editor-gradient-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .bp-token-editor-gradient-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .bp-token-editor-gradient-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.bp-token-editor-gradient-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--duration-fast) var(--ease-default),
              border-color var(--duration-fast) var(--ease-default);
  background: var(--card);
}

.bp-token-editor-gradient-card:hover {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in oklch, var(--primary) 40%, transparent);
}

.bp-token-editor-gradient-card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.bp-token-editor-gradient-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
}

.bp-token-editor-gradient-value {
  display: block;
  word-break: break-all;
  color: var(--muted-foreground);
  margin-top: var(--space-1);
}


/* ─── Theme Preset Grid and Cards (token-editor T-PHOENIX-THEME-PRESETS-001) ─ */

/* Swatch card grid — 1 col mobile, 2 at sm, 4 at lg */
.bp-theme-preset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 480px) {
  .bp-theme-preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .bp-theme-preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .bp-theme-preset-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Individual preset card */
.bp-theme-preset-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  transition: box-shadow var(--duration-fast) var(--ease-default),
              border-color var(--duration-fast) var(--ease-default),
              transform var(--duration-fast) var(--ease-out);
}

.bp-theme-preset-card:hover {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in oklch, var(--primary) 50%, transparent);
  transform: translateY(-2px);
}

.bp-theme-preset-card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Active / selected state */
.bp-theme-preset-card--active {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.bp-theme-preset-card--active .bp-theme-preset-name {
  color: var(--accent);
  font-weight: var(--font-semibold);
}

/* Colour swatch strip — shows computed primary→accent gradient.
 * --bp-theme-swatch-bg is set via useEffect in ThemePreviewSwatch. */
.bp-theme-preset-swatch {
  width: 100%;
  height: 64px;
  background: var(--bp-theme-swatch-bg, var(--muted));
  flex-shrink: 0;
}

/* Preset info block below swatch */
.bp-theme-preset-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3) var(--space-3);
}

.bp-theme-preset-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: var(--leading-tight);
}


/* ── State Utilities ─────────────────────────────────────────────────── */
.bp-state-disabled { opacity: var(--state-disabled-opacity); pointer-events: none; }
.bp-state-selected { background: var(--state-selected-bg); border-color: var(--state-selected-border); }
.bp-state-drag-over { background: var(--state-drag-over-bg); border: 2px dashed var(--state-drag-over-border); }
.bp-state-active-sort { background: var(--state-active-sort-bg); }
.bp-state-empty { background: var(--state-empty-bg); }


/* ── Image System ─────────────────────────── */
.bp-img { max-width: 100%; height: auto; display: block; }
.bp-img--rounded { border-radius: var(--radius); }
.bp-img--circle { border-radius: var(--radius-full); }

/* Aspect ratio containers */
.bp-aspect-square { aspect-ratio: var(--aspect-square); }
.bp-aspect-video { aspect-ratio: var(--aspect-video); }
.bp-aspect-photo { aspect-ratio: var(--aspect-photo); }
.bp-aspect-wide { aspect-ratio: var(--aspect-wide); }
.bp-aspect-portrait { aspect-ratio: var(--aspect-portrait); }

/* Avatar */
.bp-avatar { display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full); background: var(--muted); color: var(--muted-foreground);
  font-weight: 600; overflow: hidden; flex-shrink: 0; }
.bp-avatar--xs { width: var(--avatar-xs); height: var(--avatar-xs); font-size: var(--text-xs); }
.bp-avatar--sm { width: var(--avatar-sm); height: var(--avatar-sm); font-size: var(--text-xs); }
.bp-avatar--md { width: var(--avatar-md); height: var(--avatar-md); font-size: var(--text-sm); }
.bp-avatar--lg { width: var(--avatar-lg); height: var(--avatar-lg); font-size: var(--text-lg); }
.bp-avatar--xl { width: var(--avatar-xl); height: var(--avatar-xl); font-size: var(--text-2xl); }
.bp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bp-avatar__fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

/* Image placeholder/skeleton */
.bp-img-placeholder { background: var(--muted); display: flex; align-items: center; justify-content: center;
  color: var(--muted-foreground); font-size: var(--text-sm); }

/* ============================================
 * TOGGLE (bp-toggle)
 * Interactive on/off switch for module enable/disable
 * ============================================ */
.bp-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.bp-toggle__input { opacity: 0; width: 0; height: 0; position: absolute; }
.bp-toggle__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--muted);
  border-radius: var(--radius-full);
  transition: background var(--duration-fast) var(--ease-default);
}
.bp-toggle__slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: var(--radius-full);
  transition: transform var(--duration-fast) var(--ease-default);
}
.bp-toggle__input:checked + .bp-toggle__slider { background: var(--primary); }
.bp-toggle__input:checked + .bp-toggle__slider::before { transform: translateX(20px); }
.bp-toggle__input:focus-visible + .bp-toggle__slider {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.bp-toggle--disabled .bp-toggle__slider { opacity: var(--state-disabled-opacity); cursor: not-allowed; }
.bp-toggle--disabled .bp-toggle__input { pointer-events: none; }

/* Toggle row — label + switch layout */
.bp-toggle-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.bp-toggle-row__label {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  user-select: none;
}

/* Dependency warning banner — shown when disabling a module with dependents */
.bp-toggle-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: color-mix(in oklch, var(--warning) 12%, transparent);
  border: 1px solid color-mix(in oklch, var(--warning) 35%, transparent);
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
}
.bp-toggle-warning__icon {
  font-size: var(--text-sm);
  flex-shrink: 0;
  line-height: 1.4;
}
.bp-toggle-warning__text {
  font-size: var(--text-xs);
  color: var(--foreground);
  line-height: var(--leading-relaxed);
}

/* ─── Checkbox label wrapper (overrides raw checkbox styles above) ──── */
.bp-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2, 0.5rem);
  width: auto;
  height: auto;
  cursor: pointer;
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--font-semibold);
  line-height: var(--leading-normal);
}

.bp-checkbox input[type="checkbox"] {
  margin-top: 0.2em;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Description text after checkbox label — block display, indented to align with label text */
.bp-content-form__field > .bp-text-muted.bp-text-sm {
  display: block;
  padding-left: calc(16px + var(--space-2));
  margin-top: 0;
  margin-bottom: var(--space-2);
}

/* ─── Wizard max-width on desktop ───────────────────────────────────── */
.bp-wizard-step-content {
  max-width: 100%;
  padding: var(--space-4) 0;
}

/* ============================================
 * GLOBAL MOBILE RESPONSIVE OVERRIDES
 * Mobile-first: base styles are mobile,
 * min-width breakpoints scale up to desktop.
 * G9 compliance: no horizontal scroll >= 320px.
 * ============================================ */

/* Content scroll area — touch-friendly, stable on mobile */
.bp-content {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none; /* prevent elastic bounce scroll from propagating */
}

/* Header refresh button — 44px touch target on mobile */
.bp-header__refresh {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .bp-header__refresh {
    min-width: 0;
    min-height: 0;
  }
}


/* Tables — ensure horizontal scroll hint (position:relative for scroll indicator) */
.bp-table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Search bars — mobile-first: full width base, constrained at 640px+ */
.bp-search--constrained,
.bp-search--sm,
.bp-search--narrow,
.bp-search--medium {
  max-width: none;
  width: 100%;
}

@media (min-width: 640px) {
  .bp-search--constrained {
    max-width: 280px;
    width: auto;
  }

  .bp-search--sm {
    max-width: 240px;
    width: auto;
  }

  .bp-search--narrow {
    max-width: 240px;
    width: auto;
  }

  .bp-search--medium {
    max-width: 280px;
    width: auto;
  }
}

/* Summary header — mobile-first: stacked base, row at 480px+ */
.bp-summary-header {
  flex-direction: column;
}

.bp-summary-card {
  min-width: 0;
  width: 100%;
}

@media (min-width: 480px) {
  .bp-summary-header {
    flex-direction: row;
  }

  .bp-summary-card {
    min-width: 140px;
    width: auto;
  }
}

/* Sidebar collapsed — on mobile, collapsed has no effect (open/close used instead) */
/* Base: collapsed overrides don't shrink sidebar width */
.bp-sidebar--collapsed {
  width: 260px;
}

.bp-sidebar--collapsed .bp-sidebar__item-label,
.bp-sidebar--collapsed .bp-sidebar__brand-text,
.bp-sidebar--collapsed .bp-sidebar__user {
  display: flex;
}

.bp-sidebar--collapsed .bp-sidebar__item {
  justify-content: flex-start;
  padding: var(--space-3);
}

.bp-sidebar--collapsed .bp-sidebar__nav {
  padding: var(--space-3) var(--space-2);
}

/* Desktop: collapsed sidebar shrinks to icon-only */
@media (min-width: 768px) {
  .bp-sidebar--collapsed {
    width: 64px;
  }

  .bp-sidebar--collapsed .bp-sidebar__item-label,
  .bp-sidebar--collapsed .bp-sidebar__brand-text,
  .bp-sidebar--collapsed .bp-sidebar__user {
    display: none;
  }

  .bp-sidebar--collapsed .bp-sidebar__item {
    justify-content: center;
    padding: var(--space-2);
  }

  .bp-sidebar--collapsed .bp-sidebar__nav {
    padding: var(--space-3) var(--space-1);
  }
}


/* Blueprint navigator layout — split view */
.bp-split-view {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding: var(--space-3);
  min-height: 400px;
}
@media (min-width: 640px) {
  .bp-split-view {
    padding: var(--space-4) var(--space-5);
  }
}
@media (min-width: 769px) {
  .bp-split-view {
    grid-template-columns: 2fr 3fr;
  }
}
.bp-split-view__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 600px;
  overflow-y: auto;
}
.bp-split-view__detail {
  position: sticky;
  top: 0;
  max-height: 600px;
  overflow-y: auto;
}

/* Breadcrumb navigation */
.bp-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 40%, transparent);
}
.bp-breadcrumb__item {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--text-sm);
  transition: background var(--duration-fast) var(--ease-default);
}
.bp-breadcrumb__item:hover {
  background: color-mix(in oklch, var(--primary) 10%, transparent);
}
.bp-breadcrumb__item--active {
  color: var(--foreground);
  font-weight: var(--font-semibold);
}
.bp-breadcrumb__sep {
  color: var(--muted-foreground);
  margin: 0 2px;
}

/* Toolbar wrapping for multiple filter rows */
.bp-toolbar--wrap { flex-wrap: wrap; gap: var(--space-2); }

/* Card detail variant — right panel in split view */
.bp-card--detail {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

/* OVERVIEW DASHBOARD (pcc.overview-dashboard)
 * ============================================ */

/* Hero KPI row — 2→5 columns responsive */
.bp-kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

@media (min-width: 640px) {
  .bp-kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .bp-kpi-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

/* KPI card */
.bp-kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  transition: box-shadow var(--duration-fast) var(--ease-default),
              transform var(--duration-fast) var(--ease-default);
}

.bp-kpi-card--btn {
  cursor: pointer;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: box-shadow var(--duration-fast) var(--ease-default),
              transform var(--duration-fast) var(--ease-default);
  font: inherit;
}

.bp-kpi-card--btn:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

@media (hover: hover) {
  .bp-kpi-card--btn:hover {
    box-shadow: var(--shadow-md);
  }
}

.bp-kpi-card--btn:active {
  transform: translateY(0);
}

.bp-kpi-card__value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--foreground);
  line-height: 1;
}

.bp-kpi-card__value--success { color: var(--success); }
.bp-kpi-card__value--warning { color: var(--warning); }
.bp-kpi-card__value--destructive { color: var(--destructive); }
.bp-kpi-card__value--info { color: var(--info); }

.bp-kpi-card__label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bp-kpi-card__sub {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* Dashboard grid — 1 col → 2 col */
.bp-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

@media (min-width: 900px) {
  .bp-dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Progress rings row */
.bp-rings-row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

/* SVG progress ring card */
.bp-ring-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 100px;
}

.bp-ring-wrap {
  position: relative;
  width: 80px;
  height: 80px;
}

.bp-ring-svg {
  width: 80px;
  height: 80px;
}

.bp-ring__track {
  stroke: var(--muted);
}

.bp-ring__fill {
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--ring-pct, 0));
  transition: stroke-dashoffset 0.8s var(--ease-default);
}

.bp-ring__fill--primary { stroke: var(--primary); }
.bp-ring__fill--success { stroke: var(--success); }
.bp-ring__fill--warning { stroke: var(--warning); }
.bp-ring__fill--info { stroke: var(--info); }
.bp-ring__fill--destructive { stroke: var(--destructive); }

.bp-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-ring-label__pct {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--foreground);
}

.bp-ring-card__name {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--muted-foreground);
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-ring-card__count {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* Activity feed */
.bp-activity-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
  max-height: 280px;
  overflow-y: auto;
}

.bp-activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--muted) 50%, transparent);
  font-size: var(--text-xs);
  flex-wrap: wrap;
}

.bp-activity-item__actor {
  flex-shrink: 0;
}

.bp-activity-item__action {
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.bp-activity-item__target {
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-activity-item__time {
  color: var(--muted-foreground);
  flex-shrink: 0;
  margin-left: auto;
}

/* Roadmap summary bars */
.bp-roadmap-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.bp-roadmap-summary__phase {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.bp-roadmap-summary__bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Overview dashboard wrapper */
.bp-overview-dashboard .bp-section__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ============================================
 * MARKDOWN RENDERER (bp-markdown)
 * ============================================ */

.bp-markdown {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--foreground);
  line-height: 1.7;
  max-width: 72ch;
}

.bp-md-h1 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--foreground);
  margin: var(--space-5) 0 var(--space-3);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-2);
}

.bp-md-h2 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  margin: var(--space-4) 0 var(--space-2);
}

.bp-md-h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  margin: var(--space-4) 0 var(--space-2);
}

.bp-md-h4 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  margin: var(--space-3) 0 var(--space-1);
}

.bp-md-p {
  margin: 0 0 var(--space-3);
  color: var(--foreground);
}

.bp-md-ul,
.bp-md-ol {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
}

.bp-md-li {
  margin-bottom: var(--space-1);
  color: var(--foreground);
}

.bp-md-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-5) 0;
}

.bp-md-blockquote {
  border-left: 3px solid var(--primary);
  padding-left: var(--space-4);
  margin: var(--space-3) 0;
  color: var(--muted-foreground);
  font-style: italic;
}

.bp-inline-code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: color-mix(in oklch, var(--muted) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--foreground);
}

.bp-code-block {
  background: color-mix(in oklch, var(--muted) 60%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  margin: var(--space-3) 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--foreground);
  line-height: 1.6;
  white-space: pre;
}

.bp-text-bold {
  font-weight: var(--font-bold);
}

.bp-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (hover: hover) {
  .bp-link:hover {
    color: var(--primary);
    opacity: 0.8;
  }
}

/* ─── WCAG 2.5.8 Touch Target Fix (min 44px) ──────────────────────── */
.bp-btn {
  min-height: 44px;
}

.bp-btn--sm {
  min-height: 44px;
}

.bp-tabs__tab {
  min-height: 44px;
}

.bp-select {
  min-height: 44px;
}

.bp-filter-pill {
  min-height: 44px;
}

.bp-input {
  min-height: 44px;
}

/* ─── Checkbox label spacing fix (wizard Step 3) ──────────────────── */
.bp-content-form__field > .bp-checkbox {
  margin-bottom: var(--space-1);
}

.bp-content-form__field .bp-checkbox + .bp-checkbox {
  margin-top: var(--space-2);
}


/* ============================================
 * SHARED UTILITIES: COLOUR INPUT
 * ============================================ */

.bp-color-input {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 100%;
  min-width: 0;
}

.bp-color-input__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  overflow: hidden;
}

.bp-color-input__picker {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}

.bp-color-input__picker::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.bp-color-input__picker::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

.bp-color-input__picker::-moz-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

.bp-color-input__hex {
  width: 7.2em;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
}

.bp-color-input__hex:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--ring) 25%, transparent);
}

.bp-color-input__rgb {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}





/* ── PROJECT BOARD COMPLIANCE (shared utility) ─────────────────── */

.bp-compliance-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--font-bold);
}

.bp-compliance-dot--ok {
  background: color-mix(in oklch, var(--success) 15%, transparent);
  color: var(--success);
}

.bp-compliance-dot--missing {
  background: color-mix(in oklch, var(--destructive) 15%, transparent);
  color: var(--destructive);
}

.bp-td--center {
  text-align: center;
}

.bp-synced-indicator {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-style: italic;
}

/* Ledger / tabbed views — vertical card spacing inside tab panels */
.bp-tabs__panel > .bp-card + .bp-card {
  margin-top: var(--space-4);
}

/* Toolbar filter selects — override width:100% from shared input reset */
.bp-filters .bp-select {
  width: auto;
  min-width: 140px;
}
.bp-toolbar__left .bp-filters {
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════
 * SHELL LAYOUT OVERRIDES (sidebar, header, toolbar, content area)
 * Promoted from ui/pcc/src/pcc.overrides.css — shared across all surfaces
 * ═══════════════════════════════════════════════════════════════════ */

/* ── Sidebar ─────────────────────────────────────────── */
.bp-sidebar { z-index: 40; box-shadow: 1px 0 0 color-mix(in oklch, var(--border) 10%, transparent); }
.bp-sidebar--mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
@media (min-width: 768px) {
  .bp-sidebar { z-index: 10; box-shadow: 1px 0 0 color-mix(in oklch, var(--border) 10%, transparent); }
  .bp-sidebar--mobile-open { box-shadow: 1px 0 0 color-mix(in oklch, var(--border) 10%, transparent); }
}
.bp-sidebar__item {
  padding: var(--space-3); min-height: 44px;
  color: color-mix(in oklch, var(--sidebar-fg) 75%, transparent);
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 768px) {
  .bp-sidebar__item { padding: var(--space-2) var(--space-3); min-height: 0; }
}
@media (hover: hover) {
  .bp-sidebar__item:hover {
    background: color-mix(in oklch, var(--sidebar-fg) 15%, transparent);
    color: var(--sidebar-fg);
  }
}
a.bp-sidebar__item { text-decoration: none; color: inherit; }
.bp-sidebar__item:active {
  background: color-mix(in oklch, var(--sidebar-fg) 18%, transparent);
  color: var(--sidebar-fg);
}
.bp-sidebar__brand { border-bottom-color: color-mix(in oklch, var(--sidebar-fg) 15%, transparent); }
.bp-sidebar__logo { background: color-mix(in oklch, var(--sidebar-fg) 18%, transparent); }
.bp-sidebar__footer {
  padding: var(--space-3) var(--space-3);
  border-top-color: color-mix(in oklch, var(--sidebar-fg) 15%, transparent);
}

/* Sidebar backdrop (mobile overlay) */
.bp-sidebar-backdrop { display: none; }
.bp-sidebar-backdrop--visible {
  display: block; position: fixed; inset: 0; z-index: 35;
  background: oklch(0 0 0 / 0.4); animation: bp-backdrop-in 0.2s ease-out;
}
@keyframes bp-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 768px) { .bp-sidebar-backdrop--visible { display: none; } }

/* Sidebar action buttons */
.bp-sidebar__actions { display: flex; gap: var(--space-1); }
.bp-sidebar__action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-md);
  border: none; background: transparent;
  color: color-mix(in oklch, var(--sidebar-fg) 70%, transparent);
  cursor: pointer; transition: all var(--duration-fast) var(--ease-default);
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 768px) { .bp-sidebar__action-btn { width: 32px; height: 32px; } }
@media (hover: hover) {
  .bp-sidebar__action-btn:hover {
    background: color-mix(in oklch, var(--sidebar-fg) 15%, transparent);
    color: var(--sidebar-fg);
  }
}

/* Build badge — version/governance indicator in sidebar footer */
.bp-sidebar__build-badge {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
  text-align: center;
  opacity: 0.8;
  line-height: 1.4;
}
.bp-sidebar__build-badge-label {
  display: block;
  font-weight: 600;
  color: var(--accent-foreground);
}
.bp-sidebar__build-badge-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
}
.bp-sidebar--collapsed .bp-sidebar__build-badge {
  padding: var(--space-1);
}
.bp-sidebar--collapsed .bp-sidebar__build-badge-meta {
  display: none;
}

/* Dark mode: sidebar stays dark (uses background/foreground instead of primary tokens
   which invert in dark mode). The sidebar is persistent dark chrome. */
:is([data-theme="dark"], .dark) .bp-sidebar {
  background: var(--background);
  color: var(--foreground);
  border-color: var(--border);
}
:is([data-theme="dark"], .dark) .bp-sidebar__brand {
  border-bottom-color: var(--border);
}
:is([data-theme="dark"], .dark) .bp-sidebar__item {
  color: color-mix(in oklch, var(--foreground) 70%, transparent);
}
:is([data-theme="dark"], .dark) .bp-sidebar__item:hover {
  background: color-mix(in oklch, var(--foreground) 8%, transparent);
  color: var(--foreground);
}
:is([data-theme="dark"], .dark) .bp-sidebar__item--active {
  color: var(--foreground);
}
:is([data-theme="dark"], .dark) .bp-sidebar__footer {
  border-top-color: var(--border);
}
:is([data-theme="dark"], .dark) .bp-sidebar__action-btn {
  color: color-mix(in oklch, var(--foreground) 70%, transparent);
}
:is([data-theme="dark"], .dark) .bp-sidebar__action-btn:hover {
  background: color-mix(in oklch, var(--foreground) 15%, transparent);
  color: var(--foreground);
}
.bp-sidebar__action-btn:active {
  background: color-mix(in oklch, var(--sidebar-fg) 20%, transparent);
  color: var(--sidebar-fg);
}
.bp-sidebar--collapsed .bp-sidebar__action-btn svg { transform: rotate(180deg); }

/* ── Header ──────────────────────────────────────────── */
.bp-header { padding: 0 var(--space-3); gap: var(--space-2); }
@media (min-width: 768px) { .bp-header { padding: 0 var(--space-6); } }

/* Hamburger (mobile only) */
.bp-header__hamburger {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: none; background: transparent;
  color: var(--foreground); cursor: pointer; border-radius: var(--radius-md);
  flex-shrink: 0; transition: background var(--duration-fast) var(--ease-default);
}
.bp-header__hamburger:active, .bp-header__hamburger:hover { background: var(--muted); }
/* Brief attention pulse on first paint — draws eye to navigation on mobile */
@keyframes bp-hamburger-pulse { 0%, 100% { background: transparent; } 50% { background: var(--muted); } }
.bp-header__hamburger { animation: bp-hamburger-pulse 1.5s ease-in-out 0.5s 2; }
@media (min-width: 768px) { .bp-header__hamburger { display: none; animation: none; } }

/* Breadcrumb (flex, truncating) */
.bp-header__breadcrumb { flex: 1; min-width: 0; overflow: hidden; }
.bp-header__crumb-root {
  font-size: var(--text-sm); color: var(--muted-foreground);
  font-weight: var(--font-medium); flex-shrink: 0;
}
.bp-header__crumb-active {
  font-size: var(--text-sm); color: var(--foreground); font-weight: var(--font-semibold);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Refresh button */
.bp-header__refresh {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--background);
  color: var(--muted-foreground); cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}
@media (min-width: 768px) {
  .bp-header__refresh { width: 32px; height: 32px; }
}
.bp-header__refresh:active, .bp-header__refresh:hover {
  background: var(--muted); color: var(--foreground);
  border-color: color-mix(in oklch, var(--foreground) 20%, transparent);
}
.bp-header__refresh--spinning svg { animation: bp-spin 0.7s linear infinite; }

/* Logout button — visible on mobile (sidebar hidden), hidden on desktop (sidebar has it) */
.bp-header__logout {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--background);
  color: var(--muted-foreground); cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}
.bp-header__logout:active, .bp-header__logout:hover {
  background: var(--muted); color: var(--destructive);
  border-color: color-mix(in oklch, var(--destructive) 30%, transparent);
}
@media (min-width: 768px) {
  .bp-header__logout { display: none; }
}

/* ── Content Area ────────────────────────────────────── */
.bp-content {
  transition: opacity var(--duration-fast) var(--ease-default),
              transform var(--duration-fast) var(--ease-default);
}
.bp-content--transitioning { opacity: 0; transform: translateY(4px); }

/* ── Loading Spinner Alias ───────────────────────────── */
.bp-loading-spinner {
  width: 1.5rem; height: 1.5rem; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: var(--radius-full);
  animation: bp-spin 0.7s linear infinite;
}

/* ── Table Column Hiding ─────────────────────────────── */
.bp-table th:nth-child(n+5), .bp-table td:nth-child(n+5) { display: none; }
@media (min-width: 640px) {
  .bp-table th:nth-child(n+5), .bp-table td:nth-child(n+5) { display: table-cell; }
}

/* ── Toolbar (PCC mobile: column) ────────────────────── */
.bp-toolbar { flex-direction: column; gap: var(--space-2); padding: var(--space-3); }
.bp-toolbar__left { flex-direction: column; width: 100%; }
@media (min-width: 640px) {
  .bp-toolbar {
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: var(--space-3); padding: var(--space-3) var(--space-5); flex-wrap: wrap;
  }
  .bp-toolbar__left { flex-direction: row; align-items: center; gap: var(--space-3); flex: 1; width: auto; }
}

/* ── Sidebar Children (expandable sub-nav) ───────────── */
.bp-sidebar__group { display: flex; flex-direction: column; }
.bp-sidebar__chevron {
  margin-left: auto; font-size: 0.65rem; transition: transform var(--duration-fast) var(--ease-default);
  color: color-mix(in oklch, var(--sidebar-fg) 50%, transparent);
}
.bp-sidebar__chevron--open { transform: rotate(90deg); }
.bp-sidebar__children {
  display: flex; flex-direction: column; gap: var(--space-1);
  padding-left: calc(var(--space-3) + 18px + var(--space-2));
  padding-top: var(--space-2); padding-bottom: var(--space-2);
}
.bp-sidebar__child {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); min-height: 32px;
  border: none; background: transparent; cursor: pointer; text-align: left; width: 100%;
  font-size: var(--text-xs); color: color-mix(in oklch, var(--sidebar-fg) 60%, transparent);
  border-radius: var(--radius-sm); transition: all var(--duration-fast) var(--ease-default);
}
@media (hover: hover) {
  .bp-sidebar__child:hover {
    background: color-mix(in oklch, var(--sidebar-fg) 12%, transparent);
    color: var(--sidebar-fg);
  }
}
.bp-sidebar__child--active {
  background: color-mix(in oklch, var(--sidebar-fg) 15%, transparent);
  color: var(--sidebar-fg); font-weight: var(--font-medium);
}
.bp-sidebar--collapsed .bp-sidebar__children { display: none; }
.bp-sidebar--collapsed .bp-sidebar__chevron { display: none; }

/* ── Layout Variants (schema-driven via boot-config shellLayout) ─────
   selector strategy: bp-shell--{variant} on bp-app root.
   sidebar-left = default, no class modifier needed.
   ─────────────────────────────────────────────────────────────────── */

/* header-nav: horizontal nav bar, no sidebar, full-width content */
.bp-shell--header-nav { flex-direction: column; }
.bp-shell--header-nav .bp-main { margin-left: 0; width: 100%; }

.bp-header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-4);
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  height: 48px;
  flex-shrink: 0;
  scrollbar-width: none;
}
.bp-header-nav::-webkit-scrollbar { display: none; }

.bp-header-nav__brand {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--sidebar-foreground);
  white-space: nowrap;
  margin-right: var(--space-3);
  flex-shrink: 0;
}

.bp-header-nav__spacer { flex: 1; }

.bp-header-nav__user {
  font-size: var(--text-xs);
  color: color-mix(in oklch, var(--sidebar-foreground) 60%, transparent);
  white-space: nowrap;
  margin-right: var(--space-2);
}

.bp-header-nav__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: color-mix(in oklch, var(--sidebar-foreground) 75%, transparent);
  cursor: pointer;
  border: none;
  background: transparent;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
  transition: background var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .bp-header-nav__tab:hover {
    background: color-mix(in oklch, var(--sidebar-foreground) 12%, transparent);
    color: var(--sidebar-foreground);
  }
}
.bp-header-nav__tab--active {
  background: color-mix(in oklch, var(--sidebar-foreground) 15%, transparent);
  color: var(--sidebar-foreground);
  font-weight: var(--font-medium);
}
.bp-header-nav__tab--action {
  color: color-mix(in oklch, var(--sidebar-foreground) 50%, transparent);
}

/* no-sidebar: content area only — no nav chrome (kiosk / embedded) */
.bp-shell--no-sidebar .bp-main { margin-left: 0; width: 100%; }

/* ── Reduced Motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bp-loading-spinner, .bp-header__refresh--spinning svg { animation-duration: 1.5s; }
  .bp-header__hamburger { animation: none; }
  .bp-content--transitioning { transition: none; }
  .bp-sidebar { transition: none; }
}
