/* ============================================================================
   BayStore Design System — Components
   Reusable UI primitives built on the tokens in colors_and_type.css.
   Load colors_and_type.css FIRST, then this file.
   Prefix: .bs-*
   ============================================================================ */

/* ----- BUTTONS -------------------------------------------------------------- */
.bs-btn {
  --_h: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--_h);
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.bs-btn:active { transform: translateY(0.5px) scale(0.992); }
.bs-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.bs-btn .bs-i { width: 16px; height: 16px; flex: none; }

.bs-btn--primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.bs-btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.bs-btn--primary:active { background: var(--primary-active); }

.bs-btn--default {
  background: var(--bg-surface-2);
  color: var(--fg-1);
  border-color: var(--border-default);
}
.bs-btn--default:hover { background: var(--bg-surface-3); border-color: var(--border-strong); }

.bs-btn--ghost {
  background: transparent;
  color: var(--fg-2);
  border-color: transparent;
}
.bs-btn--ghost:hover { background: var(--bg-surface-2); color: var(--fg-1); }

.bs-btn--danger {
  background: transparent;
  color: var(--st-failed);
  border-color: var(--st-failed-border);
}
.bs-btn--danger:hover { background: var(--st-failed-bg); }

.bs-btn--sm { --_h: 28px; padding: 0 var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-sm); }
.bs-btn--lg { --_h: 44px; padding: 0 var(--space-6); font-size: var(--text-md); }
.bs-btn--icon { padding: 0; width: var(--_h); }
.bs-btn:disabled, .bs-btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ----- STATUS PILLS (lifecycle) -------------------------------------------- */
.bs-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 22px;
  padding: 0 var(--space-2) 0 var(--space-2);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.01em;
  border: 1px solid var(--_bd, var(--border-default));
  background: var(--_bg, var(--bg-surface-2));
  color: var(--_fg, var(--fg-2));
  white-space: nowrap;
}
.bs-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--_dot, var(--fg-3));
  box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--_dot, var(--fg-3)) 20%, transparent);
  flex: none;
}
.bs-status[data-status="pending"]      { --_fg: var(--st-pending);      --_bg: var(--st-pending-bg);      --_bd: var(--st-pending-border);      --_dot: var(--st-pending); }
.bs-status[data-status="provisioning"] { --_fg: var(--st-provisioning); --_bg: var(--st-provisioning-bg); --_bd: var(--st-provisioning-border); --_dot: var(--st-provisioning); }
.bs-status[data-status="active"]       { --_fg: var(--st-active);       --_bg: var(--st-active-bg);       --_bd: var(--st-active-border);       --_dot: var(--st-active); }
.bs-status[data-status="suspended"]    { --_fg: var(--st-suspended);    --_bg: var(--st-suspended-bg);    --_bd: var(--st-suspended-border);    --_dot: var(--st-suspended); }
.bs-status[data-status="upgrading"]    { --_fg: var(--st-upgrading);    --_bg: var(--st-upgrading-bg);    --_bd: var(--st-upgrading-border);    --_dot: var(--st-upgrading); }
.bs-status[data-status="failed"]       { --_fg: var(--st-failed);       --_bg: var(--st-failed-bg);       --_bd: var(--st-failed-border);       --_dot: var(--st-failed); }
.bs-status[data-status="deleted"]      { --_fg: var(--st-deleted);      --_bg: var(--st-deleted-bg);      --_bd: var(--st-deleted-border);      --_dot: var(--st-deleted); }

/* Animated dot for in-progress states */
.bs-status[data-status="provisioning"]::before,
.bs-status[data-status="upgrading"]::before {
  animation: bs-pulse 1.4s var(--ease-in-out) infinite;
}
@keyframes bs-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .bs-status::before { animation: none !important; }
}

/* ----- TAGS / BADGES -------------------------------------------------------- */
.bs-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 20px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.02em;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--fg-3);
}
.bs-tag--accent { background: var(--primary-subtle); border-color: var(--primary-subtle-border); color: var(--primary-text); }
.bs-tag--sun { background: var(--sun-subtle); border-color: var(--sun-subtle-border); color: var(--sun-text); }

/* ----- SUN BUTTON (secondary warm accent) ------------------------------------ */
.bs-btn--sun {
  background: var(--sun-color);
  color: #2A1B02;
  border-color: var(--sun-color);
}
.bs-btn--sun:hover { filter: brightness(1.07); }

/* ----- INPUTS --------------------------------------------------------------- */
.bs-field { display: flex; flex-direction: column; gap: var(--space-2); }
.bs-label {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-2);
}
.bs-input, .bs-select, .bs-textarea {
  height: 38px;
  padding: 0 var(--space-3);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--fg-1);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  width: 100%;
}
.bs-textarea { height: auto; padding: var(--space-3); line-height: var(--leading-normal); resize: vertical; }
.bs-input::placeholder, .bs-textarea::placeholder { color: var(--fg-4); }
.bs-input:focus, .bs-select:focus, .bs-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.bs-input--mono { font-family: var(--font-mono); font-size: var(--text-sm); }

/* Validation & non-editable states.
   Drive validity with aria-invalid (preferred) or the .is-invalid class so the
   state is exposed to assistive tech, not just painted. */
.bs-input[aria-invalid="true"], .bs-select[aria-invalid="true"], .bs-textarea[aria-invalid="true"],
.bs-input.is-invalid, .bs-select.is-invalid, .bs-textarea.is-invalid {
  border-color: var(--st-failed);
  background: color-mix(in srgb, var(--st-failed) 6%, var(--bg-surface-2));
}
.bs-input[aria-invalid="true"]:focus, .bs-select[aria-invalid="true"]:focus, .bs-textarea[aria-invalid="true"]:focus,
.bs-input.is-invalid:focus, .bs-select.is-invalid:focus, .bs-textarea.is-invalid:focus {
  border-color: var(--st-failed);
  box-shadow: 0 0 0 3px var(--st-failed-bg);
}
.bs-input:disabled, .bs-select:disabled, .bs-textarea:disabled,
.bs-input[aria-disabled="true"], .bs-select[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-inset);
}
.bs-input[readonly], .bs-textarea[readonly] {
  background: var(--bg-inset);
  border-style: dashed;
  color: var(--fg-2);
  cursor: default;
}

/* Field messages. .bs-hint is neutral help; .bs-msg--error pairs with an invalid
   control. Keep the voice operational: state what is wrong and what to do. */
.bs-hint, .bs-msg {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  color: var(--fg-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.bs-msg--error { color: var(--st-failed); }
.bs-msg--error::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--st-failed); flex: none;
}

/* Affix wrapper — leading/trailing slot for unit, prefix path, or inline action. */
.bs-input-group { position: relative; display: flex; align-items: center; }
.bs-input-group .bs-input { padding-right: 64px; }
.bs-input-group .bs-affix {
  position: absolute; right: var(--space-3);
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--fg-4); pointer-events: none;
}

/* ----- SELECT (native, custom chevron) -------------------------------------- */
.bs-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: var(--space-8);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%237C8694' stroke-width='1.4' stroke-linecap='round'><path d='M2.5 4.5L6 8l3.5-3.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  cursor: pointer;
}

/* ----- CHECKBOX & RADIO -----------------------------------------------------
   Native input, custom box. Keyboard, indeterminate, and disabled all work.
   Wrap in <label class="bs-check"> with the input + a <span> text node. */
.bs-check, .bs-radio {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--fg-2);
  cursor: pointer;
  user-select: none;
}
.bs-check > input, .bs-radio > input {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px; margin: 0;
  flex: none;
  display: grid; place-content: center;
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.bs-check > input { border-radius: var(--radius-xs); }
.bs-radio > input { border-radius: var(--radius-full); }
.bs-check > input::after {
  content: ""; width: 10px; height: 10px;
  clip-path: polygon(13% 50%, 34% 71%, 87% 18%, 96% 27%, 34% 89%, 4% 59%);
  background: var(--primary-fg); transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.bs-check > input:indeterminate::after {
  clip-path: none; width: 9px; height: 2px; border-radius: 1px; transform: scale(1);
}
.bs-radio > input::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary-fg); transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.bs-check > input:checked, .bs-radio > input:checked,
.bs-check > input:indeterminate {
  background-color: var(--primary); border-color: var(--primary);
}
.bs-check > input:checked::after, .bs-radio > input:checked::after { transform: scale(1); }
.bs-check > input:focus-visible, .bs-radio > input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.bs-check > input:disabled, .bs-radio > input:disabled { opacity: 0.45; cursor: not-allowed; }
.bs-check:has(input:disabled), .bs-radio:has(input:disabled) { color: var(--fg-4); cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
  .bs-check > input::after, .bs-radio > input::after { transition: none; }
}

/* ----- TOGGLE (boolean setting) ---------------------------------------------
   For on/off settings that take effect immediately. Use a checkbox + role; the
   track is the input, the knob is ::after. */
.bs-toggle { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-family: var(--font-sans); font-size: var(--text-sm); color: var(--fg-2); }
.bs-toggle > input {
  appearance: none; -webkit-appearance: none;
  position: relative; width: 34px; height: 20px; margin: 0; flex: none;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.bs-toggle > input::after {
  content: ""; position: absolute; top: 50%; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--fg-3);
  transform: translateY(-50%);
  transition: transform var(--dur) var(--ease-spring), background var(--dur) var(--ease-out);
}
.bs-toggle > input:checked { background-color: var(--primary); border-color: var(--primary); }
.bs-toggle > input:checked::after { transform: translate(14px, -50%); background: var(--primary-fg); }
.bs-toggle > input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.bs-toggle > input:disabled { opacity: 0.45; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .bs-toggle > input, .bs-toggle > input::after { transition: none; } }

/* ----- CARDS / PANELS ------------------------------------------------------- */
.bs-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.bs-card--pad { padding: var(--space-6); }
.bs-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

/* ----- KBD / CODE ----------------------------------------------------------- */
.bs-kbd {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-bottom-width: 2px;
  color: var(--fg-3);
}

/* ----- CAPABILITY METER (plan capability map) ------------------------------ */
.bs-meter { height: 6px; border-radius: var(--radius-full); background: var(--bg-inset); overflow: hidden; }
.bs-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }

/* ----- DIVIDER -------------------------------------------------------------- */
.bs-hr { height: 1px; background: var(--border-subtle); border: 0; }

/* ----- SCROLLBARS (subtle, technical) -------------------------------------- */
.bs-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.bs-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
.bs-scroll::-webkit-scrollbar-track { background: transparent; }

/* ----- TABLE ----------------------------------------------------------------
   The product is full of structured state, so the table is a first-class
   primitive (was previously re-implemented per kit). Long identifiers in the
   first column truncate rather than wrap. Add .bs-table--fixed for predictable
   column widths; put .bs-truncate on any cell content that must clip.
---------------------------------------------------------------------------- */
.bs-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.bs-table--fixed { table-layout: fixed; }
.bs-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-4);
  font-weight: var(--weight-medium);
  padding: 11px var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-inset);
}
.bs-table tbody td {
  padding: 13px var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--fg-2);
  vertical-align: middle;
}
.bs-table tbody tr:last-child td { border-bottom: 0; }
.bs-table--rows tbody tr { cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
.bs-table--rows tbody tr:hover { background: var(--bg-surface-2); }
.bs-table td.bs-num, .bs-table th.bs-num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "zero" 1, "tnum" 1; }
.bs-truncate { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----- TOAST ----------------------------------------------------------------
   Transient confirmation of a lifecycle operation. Bottom-center by default.
---------------------------------------------------------------------------- */
.bs-toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 11px var(--space-4);
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--fg-1);
  box-shadow: var(--shadow-pop);
  z-index: 50;
  animation: bs-toast-in var(--dur) var(--ease-out);
}
@keyframes bs-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .bs-toast { animation: none; } }

/* ----- EMPTY STATE ----------------------------------------------------------
   Calm, declarative empty/zero states. Voice stays operational: say what is
   absent and the one action that fills it ("No instances yet. Provision one.").
---------------------------------------------------------------------------- */
.bs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-11) var(--space-5);
  text-align: center;
}
.bs-empty .bs-empty-ic {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-3);
}
.bs-empty .bs-empty-t { font-family: var(--font-display); font-weight: var(--weight-semibold); font-size: var(--text-md); color: var(--fg-1); }
.bs-empty .bs-empty-s { font-size: var(--text-sm); color: var(--fg-3); max-width: 320px; line-height: var(--leading-normal); }

/* ============================================================================
   DESIGN SYSTEM EXTENSIONS
   Reusable primitives appended below. Follow the same conventions:
   token-only, .bs-* prefix, no raw letter-spacing literals, no external imports.
   ============================================================================ */

/* ----- ALERT ----------------------------------------------------------------
   Callout block for contextual status messages. Variants map to lifecycle-
   adjacent semantic roles. Use .bs-alert-title for a bold heading and place
   any icon in .bs-i inside the element root.
   aria-live="polite" recommended on dynamically-inserted alerts.
---------------------------------------------------------------------------- */
.bs-alert {
  --_accent: var(--primary);
  --_fill:   var(--primary-subtle);
  --_border: var(--primary-subtle-border);
  position: relative;
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-4) calc(var(--space-4) + 3px + var(--space-3));
  border: 1px solid var(--_border);
  border-radius: var(--radius-md);
  background: var(--_fill);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--fg-2);
  line-height: var(--leading-normal);
}
/* Colored left accent stripe */
.bs-alert::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: var(--radius-xs) 0 0 var(--radius-xs);
  background: var(--_accent);
}
.bs-alert .bs-i {
  flex: none;
  width: 16px; height: 16px;
  color: var(--_accent);
  margin-top: 1px;
}
.bs-alert-title {
  display: block;
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--fg-1);
  margin-bottom: var(--space-1);
}

/* Modifier: info (primary/ocean) — default, explicit alias */
.bs-alert--info {
  --_accent: var(--primary);
  --_fill:   var(--primary-subtle);
  --_border: var(--primary-subtle-border);
}
/* Modifier: success (active green) */
.bs-alert--success {
  --_accent: var(--st-active);
  --_fill:   var(--st-active-bg);
  --_border: var(--st-active-border);
}
/* Modifier: warn (pending amber) */
.bs-alert--warn {
  --_accent: var(--st-pending);
  --_fill:   var(--st-pending-bg);
  --_border: var(--st-pending-border);
}
/* Modifier: danger (failed red) */
.bs-alert--danger {
  --_accent: var(--st-failed);
  --_fill:   var(--st-failed-bg);
  --_border: var(--st-failed-border);
}

/* ----- ACCORDION ------------------------------------------------------------
   Built on native <details>/<summary> for keyboard and a11y for free.
   Each item is a .bs-accordion-item wrapping a <details>.
   Place a <i data-lucide="chevron-down" aria-hidden="true"> in the summary
   to get the rotating chevron; site.js calls createIcons().
---------------------------------------------------------------------------- */
.bs-accordion {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
}
.bs-accordion-item {
  border-bottom: 1px solid var(--border-subtle);
}
.bs-accordion-item:last-child {
  border-bottom: 0;
}
.bs-accordion-item > details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--fg-1);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background var(--dur-fast) var(--ease-out);
}
/* Remove Safari/Firefox disclosure marker */
.bs-accordion-item > details > summary::-webkit-details-marker { display: none; }
.bs-accordion-item > details > summary::marker { content: none; }
.bs-accordion-item > details > summary:hover {
  background: var(--bg-surface-2);
}
.bs-accordion-item > details > summary:focus-visible {
  outline: none;
  box-shadow: inset var(--focus-ring);
}
/* Chevron icon inside summary rotates when open */
.bs-accordion-item > details > summary .bs-i {
  flex: none;
  width: 16px; height: 16px;
  color: var(--fg-3);
  transition: transform var(--dur) var(--ease-out);
}
.bs-accordion-item > details[open] > summary .bs-i {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .bs-accordion-item > details > summary .bs-i,
  .bs-accordion-item > details > summary { transition: none; }
}
/* Panel body */
.bs-accordion-item > details > .bs-accordion-panel {
  padding: 0 var(--space-5) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--fg-2);
  line-height: var(--leading-relaxed);
}

/* ----- BREADCRUMB -----------------------------------------------------------
   Inline-flex trail of links. Mono separators visually recede.
   Set aria-current="page" on the current item's <span> or <a>.
---------------------------------------------------------------------------- */
.bs-breadcrumb {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}
.bs-breadcrumb a {
  color: var(--fg-3);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.bs-breadcrumb a:hover { color: var(--fg-1); }
.bs-breadcrumb-sep {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-4);
  user-select: none;
}
.bs-breadcrumb [aria-current="page"],
.bs-breadcrumb-current {
  color: var(--fg-2);
  font-weight: var(--weight-medium);
}

/* ----- STAT -----------------------------------------------------------------
   Metric display block. .bs-stat-value is the number;
   .bs-stat-label is a mono eyebrow; .bs-stat-delta is a signed indicator.
---------------------------------------------------------------------------- */
.bs-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.bs-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "zero" 1, "tnum" 1;
}
.bs-stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  line-height: 1;
}
.bs-stat-delta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-3);
}
.bs-stat-delta--up   { color: var(--st-active); }
.bs-stat-delta--down { color: var(--st-failed); }

/* ----- TABS -----------------------------------------------------------------
   Horizontal tablist. Wire visibility switching in consuming JS.
   .bs-tab.is-active / aria-selected="true" marks the selected tab.
   Includes [role=tab]-friendly styles; no JS required for styling.
---------------------------------------------------------------------------- */
.bs-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}
.bs-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-2);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  user-select: none;
}
.bs-tab:hover { color: var(--fg-1); }
.bs-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.bs-tab.is-active,
.bs-tab[aria-selected="true"] {
  color: var(--fg-1);
  border-bottom-color: var(--primary);
}

/* ----- SKELETON -------------------------------------------------------------
   Placeholder block for loading states. The shimmer uses a gradient sweep.
   Under prefers-reduced-motion: render a static muted block, no animation.
---------------------------------------------------------------------------- */
@keyframes bs-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.bs-skeleton {
  display: block;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--bg-surface-2) 25%,
    var(--bg-surface-3) 50%,
    var(--bg-surface-2) 75%
  );
  background-size: 200% 100%;
  animation: bs-shimmer 1.6s var(--ease-in-out) infinite;
}
.bs-skeleton--text {
  height: 1em;
  border-radius: var(--radius-xs);
}
.bs-skeleton--block {
  width: 100%;
  border-radius: var(--radius-md);
}
@media (prefers-reduced-motion: reduce) {
  .bs-skeleton {
    background: var(--bg-surface-2);
    animation: none;
  }
}
