/* Brand tokens and components: panel/brand is synced from bartwo-brand-identity (scripts/sync-brand.mjs), never edited here.
   Use their b2-* classes; this file only lays out the panel and covers what the brand has no component for, from tokens. *//* Bartwo design tokens. Generated by scripts/build.mjs from tokens/bartwo.tokens.json. Do not edit. */
:root {
  --b2-color-brand-50: #FFF5ED;
  --b2-color-brand-100: #FFE9DC;
  --b2-color-brand-200: #FFD1BC;
  --b2-color-brand-300: #FFAF92;
  --b2-color-brand-400: #FF845F;
  --b2-color-brand-500: #EE5D3A;
  --b2-color-brand-600: #D63A11;
  --b2-color-brand-700: #B42A0C;
  --b2-color-brand-800: #911F0C;
  --b2-color-brand-900: #6E180C;
  --b2-color-brand-950: #4B0F08;
  --b2-color-neutral-50: #FFF8F1;
  --b2-color-neutral-100: #F7EFE9;
  --b2-color-neutral-200: #E6E1DE;
  --b2-color-neutral-300: #D0CECD;
  --b2-color-neutral-400: #A5A5A7;
  --b2-color-neutral-500: #7E8084;
  --b2-color-neutral-600: #66696F;
  --b2-color-neutral-700: #4F545D;
  --b2-color-neutral-800: #3A414B;
  --b2-color-neutral-900: #1E2631;
  --b2-color-neutral-950: #0F1824;
  --b2-color-success-50: #EDFBF2;
  --b2-color-success-100: #D9F6E4;
  --b2-color-success-200: #B5ECCA;
  --b2-color-success-300: #89DBAC;
  --b2-color-success-400: #57C58C;
  --b2-color-success-500: #16AD6E;
  --b2-color-success-600: #00925A;
  --b2-color-success-700: #00784A;
  --b2-color-success-800: #00603A;
  --b2-color-success-900: #00482A;
  --b2-color-success-950: #1A3328;
  --b2-color-warning-50: #FCF7E9;
  --b2-color-warning-100: #F9EDCF;
  --b2-color-warning-200: #F3DAA2;
  --b2-color-warning-300: #E8C06D;
  --b2-color-warning-400: #D8A22C;
  --b2-color-warning-500: #BE8700;
  --b2-color-warning-600: #A36E00;
  --b2-color-warning-700: #8A5900;
  --b2-color-warning-800: #714400;
  --b2-color-warning-900: #583100;
  --b2-color-warning-950: #3E1E00;
  --b2-color-error-50: #FFF4F4;
  --b2-color-error-100: #FFE7E7;
  --b2-color-error-200: #FFCFCF;
  --b2-color-error-300: #FFACAE;
  --b2-color-error-400: #FF7F87;
  --b2-color-error-500: #F84960;
  --b2-color-error-600: #DE1F46;
  --b2-color-error-700: #BB0C37;
  --b2-color-error-800: #96072A;
  --b2-color-error-900: #72091F;
  --b2-color-error-950: #4E0714;
  --b2-color-info-50: #F1F8FF;
  --b2-color-info-100: #E2EFFF;
  --b2-color-info-200: #C4DFFF;
  --b2-color-info-300: #9BCAFF;
  --b2-color-info-400: #6BB1FD;
  --b2-color-info-500: #4496EB;
  --b2-color-info-600: #227CD3;
  --b2-color-info-700: #1466B2;
  --b2-color-info-800: #0E518F;
  --b2-color-info-900: #0B3D6C;
  --b2-color-info-950: #072849;
  --b2-color-white: #FFFFFF;
  --b2-color-logo-orange: var(--b2-color-brand-500);
  --b2-color-logo-ink: #1A1A1A;
  --b2-color-mascot-orange: #FF6532;
  --b2-color-mascot-shade: var(--b2-color-brand-600);
  --b2-color-mascot-cream: #FFE9D3;
  --b2-color-mascot-slate: var(--b2-color-neutral-800);
  --b2-color-mascot-tongue: #F1716D;
  --b2-color-mascot-burrow: var(--b2-color-success-950);
  --b2-font-display: Outfit, Rubik, ui-sans-serif, system-ui, sans-serif;
  --b2-font-body: Figtree, Rubik, ui-sans-serif, system-ui, sans-serif;
  --b2-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --b2-font-weight-light: 300;
  --b2-font-weight-regular: 400;
  --b2-font-weight-medium: 500;
  --b2-font-weight-semibold: 600;
  --b2-font-weight-bold: 700;
  --b2-font-size-caption: 0.8125rem;
  --b2-font-size-sm: 0.875rem;
  --b2-font-size-md: 1rem;
  --b2-font-size-lg: 1.25rem;
  --b2-font-size-xl: 1.5625rem;
  --b2-font-size-2xl: 2rem;
  --b2-font-size-3xl: 2.5rem;
  --b2-font-size-4xl: 3.1875rem;
  --b2-font-size-5xl: 4rem;
  --b2-font-size-6xl: 5.0625rem;
  --b2-font-line-height-tight: 1.1;
  --b2-font-line-height-snug: 1.2;
  --b2-font-line-height-normal: 1.5;
  --b2-font-line-height-relaxed: 1.65;
  --b2-space-0: 0px;
  --b2-space-1: 0.25rem;
  --b2-space-2: 0.5rem;
  --b2-space-3: 0.75rem;
  --b2-space-4: 1rem;
  --b2-space-5: 1.25rem;
  --b2-space-6: 1.5rem;
  --b2-space-8: 2rem;
  --b2-space-10: 2.5rem;
  --b2-space-12: 3rem;
  --b2-space-16: 4rem;
  --b2-space-24: 6rem;
  --b2-space-32: 8rem;
  --b2-space-0-5: 0.125rem;
  --b2-radius-stem: 2px;
  --b2-radius-sm: 6px;
  --b2-radius-md: 10px;
  --b2-radius-lg: 16px;
  --b2-radius-xl: 24px;
  --b2-radius-bowl: 9999px;
  --b2-border-width-hairline: 1px;
  --b2-border-width-thick: 2px;
  --b2-border-width-double-gap: 4px;
  --b2-control-height-sm: 32px;
  --b2-control-height-md: 40px;
  --b2-control-height-lg: 48px;
  --b2-control-padding-sm: 12px;
  --b2-control-padding-md: 16px;
  --b2-control-padding-lg: 20px;
  --b2-icon-size-sm: 16px;
  --b2-icon-size-md: 20px;
  --b2-icon-size-lg: 24px;
  --b2-icon-stroke: 1.5px;
  --b2-mascot-size-xs: 48px;
  --b2-mascot-size-sm: 96px;
  --b2-mascot-size-md: 192px;
  --b2-mascot-size-lg: 384px;
  --b2-mascot-min-body: 64px;
  --b2-mascot-min-head: 32px;
  --b2-breakpoint-sm: 600px;
  --b2-breakpoint-md: 900px;
  --b2-breakpoint-lg: 1200px;
  --b2-breakpoint-xl: 1500px;
  --b2-grid-container: 1200px;
  --b2-grid-gutter-sm: 16px;
  --b2-grid-gutter-md: 24px;
  --b2-grid-gutter-lg: 32px;
  --b2-grid-margin-sm: 16px;
  --b2-grid-margin-md: 32px;
  --b2-grid-margin-lg: 48px;
  --b2-grid-columns-sm: 4;
  --b2-grid-columns-md: 8;
  --b2-grid-columns-lg: 12;
  --b2-duration-instant: 80ms;
  --b2-duration-quick: 140ms;
  --b2-duration-base: 220ms;
  --b2-duration-slow: 360ms;
  --b2-duration-mascot: 600ms;
  --b2-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --b2-easing-enter: cubic-bezier(0, 0, 0.2, 1);
  --b2-easing-exit: cubic-bezier(0.4, 0, 1, 1);
  --b2-easing-waddle: cubic-bezier(0.34, 1.4, 0.64, 1);
  --b2-bg-canvas: var(--b2-color-neutral-50);
  --b2-bg-surface: var(--b2-color-white);
  --b2-bg-sunken: var(--b2-color-neutral-100);
  --b2-bg-raised: var(--b2-color-white);
  --b2-bg-feature: var(--b2-color-mascot-cream);
  --b2-bg-inverse: var(--b2-color-neutral-900);
  --b2-text-primary: var(--b2-color-neutral-900);
  --b2-text-secondary: var(--b2-color-neutral-700);
  --b2-text-muted: var(--b2-color-neutral-600);
  --b2-text-inverse: var(--b2-color-neutral-50);
  --b2-text-link: var(--b2-color-brand-700);
  --b2-text-on-brand: var(--b2-color-white);
  --b2-border-subtle: var(--b2-color-neutral-200);
  --b2-border-default: var(--b2-color-neutral-300);
  --b2-border-strong: var(--b2-color-neutral-500);
  --b2-brand-fill: var(--b2-color-brand-600);
  --b2-brand-fill-hover: var(--b2-color-brand-700);
  --b2-brand-fill-active: var(--b2-color-brand-800);
  --b2-brand-subtle: var(--b2-color-brand-50);
  --b2-brand-subtle-text: var(--b2-color-brand-800);
  --b2-brand-border: var(--b2-color-brand-300);
  --b2-brand-logo: var(--b2-color-brand-500);
  --b2-brand-focus: var(--b2-color-brand-600);
  --b2-success-fg: var(--b2-color-success-700);
  --b2-success-bg: var(--b2-color-success-50);
  --b2-success-border: var(--b2-color-success-200);
  --b2-success-fill: var(--b2-color-success-700);
  --b2-success-on-fill: var(--b2-color-white);
  --b2-warning-fg: var(--b2-color-warning-700);
  --b2-warning-bg: var(--b2-color-warning-50);
  --b2-warning-border: var(--b2-color-warning-200);
  --b2-warning-fill: var(--b2-color-warning-400);
  --b2-warning-on-fill: var(--b2-color-neutral-950);
  --b2-error-fg: var(--b2-color-error-700);
  --b2-error-bg: var(--b2-color-error-50);
  --b2-error-border: var(--b2-color-error-200);
  --b2-error-fill: var(--b2-color-error-700);
  --b2-error-on-fill: var(--b2-color-white);
  --b2-info-fg: var(--b2-color-info-700);
  --b2-info-bg: var(--b2-color-info-50);
  --b2-info-border: var(--b2-color-info-200);
  --b2-info-fill: var(--b2-color-info-700);
  --b2-info-on-fill: var(--b2-color-white);
  --b2-shadow-sm: 0px 1px 2px 0px rgb(18 23 29 / 0.08);
  --b2-shadow-md: 0px 1px 3px 0px rgb(18 23 29 / 0.06), 0px 4px 12px -2px rgb(18 23 29 / 0.08);
  --b2-shadow-lg: 0px 2px 6px 0px rgb(18 23 29 / 0.06), 0px 12px 32px -4px rgb(18 23 29 / 0.12);
  --b2-shadow-xl: 0px 4px 12px 0px rgb(18 23 29 / 0.08), 0px 24px 56px -8px rgb(18 23 29 / 0.18);
  /* Composed from the tokens above */
  --b2-radius-signature-sm: var(--b2-radius-stem) var(--b2-radius-sm) var(--b2-radius-sm) var(--b2-radius-sm);
  --b2-radius-signature-md: var(--b2-radius-stem) var(--b2-radius-md) var(--b2-radius-md) var(--b2-radius-md);
  --b2-radius-signature-lg: var(--b2-radius-stem) var(--b2-radius-lg) var(--b2-radius-lg) var(--b2-radius-lg);
  --b2-focus-ring: 0 0 0 2px var(--b2-bg-canvas), 0 0 0 4px var(--b2-brand-focus);
  color-scheme: light;
}
[data-theme="dark"] {
  --b2-bg-canvas: var(--b2-color-neutral-950);
  --b2-bg-surface: var(--b2-color-neutral-900);
  --b2-bg-sunken: var(--b2-color-neutral-950);
  --b2-bg-raised: var(--b2-color-neutral-900);
  --b2-bg-feature: var(--b2-color-brand-950);
  --b2-bg-inverse: var(--b2-color-neutral-50);
  --b2-text-primary: var(--b2-color-neutral-50);
  --b2-text-secondary: var(--b2-color-neutral-300);
  --b2-text-muted: var(--b2-color-neutral-400);
  --b2-text-inverse: var(--b2-color-neutral-900);
  --b2-text-link: var(--b2-color-brand-400);
  --b2-text-on-brand: var(--b2-color-white);
  --b2-border-subtle: var(--b2-color-neutral-800);
  --b2-border-default: var(--b2-color-neutral-700);
  --b2-border-strong: var(--b2-color-neutral-500);
  --b2-brand-fill: var(--b2-color-brand-600);
  --b2-brand-fill-hover: var(--b2-color-brand-700);
  --b2-brand-fill-active: var(--b2-color-brand-800);
  --b2-brand-subtle: var(--b2-color-brand-950);
  --b2-brand-subtle-text: var(--b2-color-brand-200);
  --b2-brand-border: var(--b2-color-brand-700);
  --b2-brand-logo: var(--b2-color-brand-500);
  --b2-brand-focus: var(--b2-color-brand-400);
  --b2-success-fg: var(--b2-color-success-300);
  --b2-success-bg: var(--b2-color-success-950);
  --b2-success-border: var(--b2-color-success-800);
  --b2-success-fill: var(--b2-color-success-700);
  --b2-success-on-fill: var(--b2-color-white);
  --b2-warning-fg: var(--b2-color-warning-300);
  --b2-warning-bg: var(--b2-color-warning-950);
  --b2-warning-border: var(--b2-color-warning-800);
  --b2-warning-fill: var(--b2-color-warning-400);
  --b2-warning-on-fill: var(--b2-color-neutral-950);
  --b2-error-fg: var(--b2-color-error-300);
  --b2-error-bg: var(--b2-color-error-950);
  --b2-error-border: var(--b2-color-error-800);
  --b2-error-fill: var(--b2-color-error-700);
  --b2-error-on-fill: var(--b2-color-white);
  --b2-info-fg: var(--b2-color-info-300);
  --b2-info-bg: var(--b2-color-info-950);
  --b2-info-border: var(--b2-color-info-800);
  --b2-info-fill: var(--b2-color-info-700);
  --b2-info-on-fill: var(--b2-color-white);
  --b2-shadow-sm: 0px 1px 2px 0px rgb(0 0 0 / 0.3);
  --b2-shadow-md: 0px 4px 12px -2px rgb(0 0 0 / 0.4);
  --b2-shadow-lg: 0px 12px 32px -4px rgb(0 0 0 / 0.5);
  --b2-shadow-xl: 0px 24px 56px -8px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --b2-bg-canvas: var(--b2-color-neutral-950);
    --b2-bg-surface: var(--b2-color-neutral-900);
    --b2-bg-sunken: var(--b2-color-neutral-950);
    --b2-bg-raised: var(--b2-color-neutral-900);
    --b2-bg-feature: var(--b2-color-brand-950);
    --b2-bg-inverse: var(--b2-color-neutral-50);
    --b2-text-primary: var(--b2-color-neutral-50);
    --b2-text-secondary: var(--b2-color-neutral-300);
    --b2-text-muted: var(--b2-color-neutral-400);
    --b2-text-inverse: var(--b2-color-neutral-900);
    --b2-text-link: var(--b2-color-brand-400);
    --b2-text-on-brand: var(--b2-color-white);
    --b2-border-subtle: var(--b2-color-neutral-800);
    --b2-border-default: var(--b2-color-neutral-700);
    --b2-border-strong: var(--b2-color-neutral-500);
    --b2-brand-fill: var(--b2-color-brand-600);
    --b2-brand-fill-hover: var(--b2-color-brand-700);
    --b2-brand-fill-active: var(--b2-color-brand-800);
    --b2-brand-subtle: var(--b2-color-brand-950);
    --b2-brand-subtle-text: var(--b2-color-brand-200);
    --b2-brand-border: var(--b2-color-brand-700);
    --b2-brand-logo: var(--b2-color-brand-500);
    --b2-brand-focus: var(--b2-color-brand-400);
    --b2-success-fg: var(--b2-color-success-300);
    --b2-success-bg: var(--b2-color-success-950);
    --b2-success-border: var(--b2-color-success-800);
    --b2-success-fill: var(--b2-color-success-700);
    --b2-success-on-fill: var(--b2-color-white);
    --b2-warning-fg: var(--b2-color-warning-300);
    --b2-warning-bg: var(--b2-color-warning-950);
    --b2-warning-border: var(--b2-color-warning-800);
    --b2-warning-fill: var(--b2-color-warning-400);
    --b2-warning-on-fill: var(--b2-color-neutral-950);
    --b2-error-fg: var(--b2-color-error-300);
    --b2-error-bg: var(--b2-color-error-950);
    --b2-error-border: var(--b2-color-error-800);
    --b2-error-fill: var(--b2-color-error-700);
    --b2-error-on-fill: var(--b2-color-white);
    --b2-info-fg: var(--b2-color-info-300);
    --b2-info-bg: var(--b2-color-info-950);
    --b2-info-border: var(--b2-color-info-800);
    --b2-info-fill: var(--b2-color-info-700);
    --b2-info-on-fill: var(--b2-color-white);
    --b2-shadow-sm: 0px 1px 2px 0px rgb(0 0 0 / 0.3);
    --b2-shadow-md: 0px 4px 12px -2px rgb(0 0 0 / 0.4);
    --b2-shadow-lg: 0px 12px 32px -4px rgb(0 0 0 / 0.5);
    --b2-shadow-xl: 0px 24px 56px -8px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

/* Typography styles */
.b2-type-display {
  font-family: var(--b2-font-display);
  font-size: var(--b2-font-size-5xl);
  font-weight: var(--b2-font-weight-medium);
  line-height: var(--b2-font-line-height-tight);
  letter-spacing: -1.28px;
}
.b2-type-h1 {
  font-family: var(--b2-font-display);
  font-size: var(--b2-font-size-4xl);
  font-weight: var(--b2-font-weight-medium);
  line-height: var(--b2-font-line-height-tight);
  letter-spacing: -1.02px;
}
.b2-type-h2 {
  font-family: var(--b2-font-display);
  font-size: var(--b2-font-size-3xl);
  font-weight: var(--b2-font-weight-medium);
  line-height: 1.15;
  letter-spacing: -0.6px;
}
.b2-type-h3 {
  font-family: var(--b2-font-display);
  font-size: var(--b2-font-size-2xl);
  font-weight: var(--b2-font-weight-medium);
  line-height: var(--b2-font-line-height-snug);
  letter-spacing: -0.32px;
}
.b2-type-h4 {
  font-family: var(--b2-font-display);
  font-size: var(--b2-font-size-xl);
  font-weight: var(--b2-font-weight-semibold);
  line-height: 1.25;
  letter-spacing: 0px;
}
.b2-type-h5 {
  font-family: var(--b2-font-display);
  font-size: var(--b2-font-size-lg);
  font-weight: var(--b2-font-weight-semibold);
  line-height: 1.3;
  letter-spacing: 0px;
}
.b2-type-body-lg {
  font-family: var(--b2-font-body);
  font-size: var(--b2-font-size-lg);
  font-weight: var(--b2-font-weight-regular);
  line-height: var(--b2-font-line-height-relaxed);
  letter-spacing: 0px;
}
.b2-type-body {
  font-family: var(--b2-font-body);
  font-size: var(--b2-font-size-md);
  font-weight: var(--b2-font-weight-regular);
  line-height: var(--b2-font-line-height-normal);
  letter-spacing: 0px;
}
.b2-type-body-sm {
  font-family: var(--b2-font-body);
  font-size: var(--b2-font-size-sm);
  font-weight: var(--b2-font-weight-regular);
  line-height: var(--b2-font-line-height-normal);
  letter-spacing: 0px;
}
.b2-type-label {
  font-family: var(--b2-font-body);
  font-size: var(--b2-font-size-sm);
  font-weight: var(--b2-font-weight-medium);
  line-height: 1.4;
  letter-spacing: 0px;
}
.b2-type-caption {
  font-family: var(--b2-font-body);
  font-size: var(--b2-font-size-caption);
  font-weight: var(--b2-font-weight-regular);
  line-height: 1.4;
  letter-spacing: 0.13px;
}
.b2-type-overline {
  font-family: var(--b2-font-body);
  font-size: var(--b2-font-size-caption);
  font-weight: var(--b2-font-weight-semibold);
  line-height: 1.4;
  letter-spacing: 2.08px;
  text-transform: uppercase;
}
.b2-type-code {
  font-family: var(--b2-font-mono);
  font-size: var(--b2-font-size-sm);
  font-weight: var(--b2-font-weight-regular);
  line-height: var(--b2-font-line-height-relaxed);
  letter-spacing: 0px;
}

/* Inline double border: line : gap = 1 : 4, the logo's outline-to-ribbon ratio.
   Set --b2-double-color and --b2-double-bg (the element's own background). */
.b2-double {
  box-shadow:
    inset 0 0 0 var(--b2-border-width-hairline) var(--b2-double-color, currentColor),
    inset 0 0 0 calc(var(--b2-border-width-hairline) + var(--b2-border-width-double-gap)) var(--b2-double-bg, var(--b2-bg-surface)),
    inset 0 0 0 calc(2 * var(--b2-border-width-hairline) + var(--b2-border-width-double-gap)) var(--b2-double-color, currentColor);
}

/* Mascot: a full-body pose stands on a cream disc in product UI, in both themes.
   On dark surfaces the slate feet, hands and tail would otherwise disappear. Put it on the <img>. */
.b2-mascot-disc {
  background: radial-gradient(circle closest-side at 50% 58%, var(--b2-color-mascot-cream) 97%, transparent 100%);
}

@media (prefers-reduced-motion: reduce) {
  :root { --b2-duration-quick: 0ms; --b2-duration-base: 0ms; --b2-duration-slow: 0ms; --b2-duration-mascot: 0ms; }
}

/* Bartwo components. Reference CSS for the specs in docs/components.md.
   Needs dist/bartwo.css (tokens) loaded first. Every value below is a token.
   The .is-hover / .is-focus / .is-active classes only exist so the guide can show states side by side. */

/* ---------- Button ---------- */
.b2-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--b2-space-2);
  height: var(--b2-control-height-md); padding: 0 var(--b2-control-padding-md);
  font: var(--b2-font-weight-semibold) var(--b2-font-size-sm)/1 var(--b2-font-body);
  border: 0; border-radius: var(--b2-radius-signature-md); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color var(--b2-duration-quick) var(--b2-easing-standard), box-shadow var(--b2-duration-quick) var(--b2-easing-standard), transform var(--b2-duration-instant) var(--b2-easing-standard);
}
.b2-btn svg { width: var(--b2-icon-size-md); height: var(--b2-icon-size-md); flex: none; }
.b2-btn:focus-visible, .b2-btn.is-focus { outline: none; box-shadow: var(--b2-focus-ring); }
.b2-btn:active:not(:disabled), .b2-btn.is-active { transform: translateY(1px); }
.b2-btn--sm { height: var(--b2-control-height-sm); padding: 0 var(--b2-control-padding-sm); font-size: var(--b2-font-size-caption); }
.b2-btn--sm svg { width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); }
.b2-btn--lg { height: var(--b2-control-height-lg); padding: 0 var(--b2-control-padding-lg); font-size: var(--b2-font-size-md); }
.b2-btn--icon { padding: 0; aspect-ratio: 1; }

.b2-btn--primary { background: var(--b2-brand-fill); color: var(--b2-text-on-brand); }
.b2-btn--primary:hover, .b2-btn--primary.is-hover { background: var(--b2-brand-fill-hover); }
.b2-btn--primary:active, .b2-btn--primary.is-active { background: var(--b2-brand-fill-active); }

.b2-btn--secondary { background: var(--b2-bg-surface); color: var(--b2-text-primary); box-shadow: inset 0 0 0 var(--b2-border-width-hairline) var(--b2-border-strong); }
.b2-btn--secondary:hover, .b2-btn--secondary.is-hover { background: var(--b2-bg-sunken); }
.b2-btn--secondary:focus-visible, .b2-btn--secondary.is-focus { box-shadow: inset 0 0 0 var(--b2-border-width-hairline) var(--b2-border-strong), var(--b2-focus-ring); }

.b2-btn--ghost { background: transparent; color: var(--b2-text-primary); }
.b2-btn--ghost:hover, .b2-btn--ghost.is-hover { background: var(--b2-bg-sunken); }

.b2-btn--danger { background: var(--b2-error-fill); color: var(--b2-error-on-fill); }
.b2-btn--danger:hover, .b2-btn--danger.is-hover { background: var(--b2-color-error-800); }
.b2-btn--danger:active, .b2-btn--danger.is-active { background: var(--b2-color-error-900); }

.b2-btn:disabled, .b2-btn[aria-disabled="true"] {
  background: var(--b2-bg-sunken); color: var(--b2-text-muted); box-shadow: none; cursor: not-allowed; transform: none;
}
.b2-btn[aria-busy="true"] { cursor: progress; }
.b2-btn[aria-busy="true"] > :not(.b2-spinner) { visibility: hidden; }
.b2-btn[aria-busy="true"] > .b2-spinner { position: absolute; inset: 0; margin: auto; }

/* ---------- Spinner (a bowl with a gap) ---------- */
.b2-spinner {
  display: inline-block; width: 1.125rem; height: 1.125rem; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: b2-spin 700ms linear infinite;
}
@keyframes b2-spin { to { transform: rotate(1turn); } }

/* ---------- Fields ---------- */
.b2-field { display: grid; gap: var(--b2-space-2); align-content: start; } /* rows stay packed when a neighbour makes the field taller */
.b2-label { font: var(--b2-font-weight-medium) var(--b2-font-size-sm)/1.4 var(--b2-font-body); color: var(--b2-text-primary); }
.b2-label .b2-optional { font-weight: var(--b2-font-weight-regular); color: var(--b2-text-secondary); }
.b2-hint { font: var(--b2-font-size-caption)/1.4 var(--b2-font-body); color: var(--b2-text-secondary); margin: 0; }
.b2-error-text { display: flex; gap: var(--b2-space-1); align-items: flex-start; font: var(--b2-font-weight-medium) var(--b2-font-size-caption)/1.4 var(--b2-font-body); color: var(--b2-error-fg); margin: 0; }
.b2-error-text svg { width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); flex: none; margin-top: 1px; }

/* Info toggletip beside a label: a button opens a popover with background detail. */
.b2-label-row { display: flex; align-items: center; gap: var(--b2-space-1); }
.b2-info {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -4px 0; padding: 0; /* 24px target, no extra row height */
  border: 0; border-radius: var(--b2-radius-bowl); background: none; color: var(--b2-text-secondary); cursor: pointer;
  transition: color var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-info svg { width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); }
.b2-info:hover, .b2-field:has(.b2-info-tip:popover-open) .b2-info { color: var(--b2-text-primary); }
.b2-info:focus-visible { outline: none; box-shadow: var(--b2-focus-ring); }
/* One bubble look for the info toggletip and the tooltip */
.b2-info-tip, .b2-tooltip {
  font: var(--b2-font-size-caption)/1.4 var(--b2-font-body); color: var(--b2-text-inverse); background: var(--b2-bg-inverse);
  border: 0; border-radius: var(--b2-radius-sm); box-shadow: var(--b2-shadow-md);
}
.b2-info-tip { max-width: 280px; margin: auto; padding: var(--b2-space-2) var(--b2-space-3); }
/* Anchored above the button where supported; elsewhere the popover opens centred. */
@supports (position-area: top) {
  .b2-info-tip { inset: auto; margin: var(--b2-space-2) 0; overflow: visible; position-area: top span-right; position-try-fallbacks: flip-block; container-type: anchored; }
  /* arrow under the bubble, over the centre of the 24px button; moves to the top edge when the bubble flips below */
  .b2-info-tip::after {
    content: ""; position: absolute; top: calc(100% - 1px); left: 12px; width: 14px; height: 7px; margin-left: -7px; /* 1px under the edge: no seam */
    background: inherit; clip-path: polygon(0 0, 100% 0, 50% 100%);
  }
  @container anchored(fallback: flip-block) {
    .b2-info-tip::after { top: auto; bottom: calc(100% - 1px); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
  }
}

.b2-input, .b2-select > select, .b2-textarea {
  width: 100%; height: var(--b2-control-height-md); padding: 0 var(--b2-space-3);
  /* 16px stops iOS zooming into the field */
  font: var(--b2-font-weight-regular) var(--b2-font-size-md)/1.5 var(--b2-font-body); color: var(--b2-text-primary);
  background: var(--b2-bg-surface); border: var(--b2-border-width-hairline) solid var(--b2-border-strong); border-radius: var(--b2-radius-md);
  transition: border-color var(--b2-duration-quick) var(--b2-easing-standard), box-shadow var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-textarea { height: auto; min-height: 96px; padding: 10px var(--b2-space-3); resize: vertical; }
.b2-input::placeholder, .b2-textarea::placeholder { color: var(--b2-text-muted); }
.b2-input:hover, .b2-select > select:hover, .b2-textarea:hover, .b2-input.is-hover { border-color: var(--b2-text-secondary); }
.b2-input:focus, .b2-select > select:focus, .b2-textarea:focus, .b2-input.is-focus { outline: none; border-color: var(--b2-brand-focus); box-shadow: var(--b2-focus-ring); }
.b2-input[aria-invalid="true"], .b2-select > select[aria-invalid="true"], .b2-textarea[aria-invalid="true"] { border-color: var(--b2-error-fg); }
.b2-input[aria-invalid="true"]:focus, .b2-textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 2px var(--b2-bg-canvas), 0 0 0 4px var(--b2-error-fg); }
.b2-input:disabled, .b2-select > select:disabled, .b2-textarea:disabled { background: var(--b2-bg-sunken); color: var(--b2-text-muted); border-color: var(--b2-border-subtle); cursor: not-allowed; }
.b2-input--sm, .b2-select--sm > select { height: var(--b2-control-height-sm); font-size: var(--b2-font-size-sm); }
.b2-input--lg, .b2-select--lg > select { height: var(--b2-control-height-lg); }

/* align-self: a stretched grid or flex cell would push the chevron off the field's centre */
.b2-select { position: relative; display: block; align-self: start; color: var(--b2-text-secondary); }
.b2-select > select { appearance: none; padding-right: var(--b2-space-10); cursor: pointer; }
.b2-select::after {
  content: ""; position: absolute; right: var(--b2-space-3); top: 50%; width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm);
  transform: translateY(-50%); background: currentColor; pointer-events: none;
  transition: transform var(--b2-duration-quick) var(--b2-easing-standard);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.b2-select:has(> select:open)::after { transform: translateY(-50%) rotate(180deg); }

/* The open list: our own panel where the browser supports customisable select; elsewhere the native list shows. */
@supports (appearance: base-select) {
  .b2-select > select, .b2-select > select::picker(select) { appearance: base-select; }
  .b2-select > select { display: flex; align-items: center; }
  .b2-select > select::picker-icon { display: none; }
  .b2-select > select::picker(select) {
    margin-block: var(--b2-space-1); padding: var(--b2-space-1); min-width: anchor-size(width);
    /* open below; flip up only when it doesn't fit (the browser default picks whichever side is bigger) */
    position-try-order: normal; position-try-fallbacks: flip-block;
    background: var(--b2-bg-raised); color: var(--b2-text-primary);
    border: var(--b2-border-width-hairline) solid var(--b2-border-default); border-radius: var(--b2-radius-md);
    box-shadow: var(--b2-shadow-md);
    transition: opacity var(--b2-duration-quick) var(--b2-easing-standard), overlay var(--b2-duration-quick) allow-discrete, display var(--b2-duration-quick) allow-discrete;
  }
  .b2-select > select:not(:open)::picker(select) { opacity: 0; }
  @starting-style { .b2-select > select:open::picker(select) { opacity: 0; } }
  .b2-select > select option {
    display: flex; align-items: center; gap: var(--b2-space-2); min-height: var(--b2-control-height-md); padding: 0 var(--b2-space-3);
    border-radius: var(--b2-radius-sm); font: var(--b2-font-weight-regular) var(--b2-font-size-md)/1.5 var(--b2-font-body); cursor: pointer;
  }
  .b2-select > select option:hover, .b2-select > select option:focus-visible { background: var(--b2-bg-sunken); outline: none; }
  /* inset ring: an outer ring would be covered by the next option and clipped by the panel */
  .b2-select > select option:focus-visible { box-shadow: inset 0 0 0 2px var(--b2-brand-focus); }
  .b2-select > select option:checked { background: var(--b2-brand-subtle); color: var(--b2-brand-subtle-text); font-weight: var(--b2-font-weight-medium); }
  .b2-select > select option::checkmark { order: 1; margin-inline-start: auto; }
  .b2-select > select option:disabled { color: var(--b2-text-muted); cursor: not-allowed; background: none; }
}

/* ---------- Checkbox, radio, switch ---------- */
.b2-check { display: inline-flex; gap: 10px; align-items: flex-start; font: var(--b2-font-size-md)/1.5 var(--b2-font-body); color: var(--b2-text-primary); cursor: pointer; }
.b2-check input {
  appearance: none; flex: none; margin: 2px 0 0; width: 20px; height: 20px; cursor: pointer;
  background: var(--b2-bg-surface); border: 1.5px solid var(--b2-border-strong);
  transition: background-color var(--b2-duration-quick) var(--b2-easing-standard), border-color var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-check input[type="checkbox"] { border-radius: 2px 5px 5px 5px; }
.b2-check input[type="radio"] { border-radius: 50%; }
.b2-check input:hover, .b2-check input.is-hover { border-color: var(--b2-text-secondary); }
.b2-check input:focus-visible, .b2-check input.is-focus { outline: none; box-shadow: var(--b2-focus-ring); }
.b2-check input[type="checkbox"]:checked, .b2-check input[type="checkbox"]:indeterminate {
  border-color: var(--b2-brand-fill); background: var(--b2-brand-fill) center / 14px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3'%3E%3Cpath d='m4.5 12.5 5 5 10-11'/%3E%3C/svg%3E");
}
.b2-check input[type="checkbox"]:indeterminate { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E"); }
/* A bowl inside a bowl, like the symbol's two circles */
.b2-check input[type="radio"]:checked { border-color: var(--b2-brand-fill); background: radial-gradient(circle, var(--b2-brand-fill) 0 4px, var(--b2-bg-surface) 4.5px); }
.b2-check input[role="switch"] {
  position: relative; width: 36px; height: 20px; border: 0; border-radius: var(--b2-radius-bowl); background: var(--b2-border-strong);
}
.b2-check input[role="switch"]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--b2-color-white);
  transition: transform var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-check input[role="switch"]:checked { background: var(--b2-brand-fill); }
.b2-check input[role="switch"]:checked::before { transform: translateX(16px); }
.b2-check input:disabled { background-color: var(--b2-bg-sunken); border-color: var(--b2-border-subtle); cursor: not-allowed; }
.b2-check input[role="switch"]:disabled { background: var(--b2-border-subtle); }
.b2-check:has(input:disabled) { color: var(--b2-text-muted); cursor: not-allowed; }
.b2-check small { display: block; font-size: var(--b2-font-size-caption); color: var(--b2-text-secondary); }

/* ---------- Card ---------- */
.b2-card { background: var(--b2-bg-surface); color: var(--b2-text-primary); border: var(--b2-border-width-hairline) solid var(--b2-border-subtle); border-radius: var(--b2-radius-signature-md); padding: var(--b2-space-6); }
.b2-card--raised { box-shadow: var(--b2-shadow-sm); }
.b2-card--interactive { cursor: pointer; transition: box-shadow var(--b2-duration-quick) var(--b2-easing-standard), border-color var(--b2-duration-quick) var(--b2-easing-standard); }
.b2-card--interactive:hover, .b2-card--interactive.is-hover { border-color: var(--b2-border-default); box-shadow: var(--b2-shadow-md); }
.b2-card--interactive:focus-within, .b2-card--interactive.is-focus { box-shadow: var(--b2-focus-ring); }
.b2-card__title { font: var(--b2-font-weight-semibold) var(--b2-font-size-lg)/1.3 var(--b2-font-display); margin: 0 0 var(--b2-space-1); }
.b2-card__meta { font-size: var(--b2-font-size-sm); color: var(--b2-text-secondary); margin: 0; }
.b2-card__footer { display: flex; gap: var(--b2-space-2); justify-content: flex-end; margin-top: var(--b2-space-5); padding-top: var(--b2-space-4); border-top: var(--b2-border-width-hairline) solid var(--b2-border-subtle); }

/* ---------- Tooltip ---------- */
/* Short label on hover (after a pause) or keyboard focus (at once). Esc hides it via .is-dismissed (see docs).
   Side: top (default), --bottom, --left, --right. Alignment: centre (default), --start, --end. The arrow points at the trigger. */
.b2-tooltip-wrap { position: relative; display: inline-flex; }
.b2-tooltip {
  --_gap: var(--b2-space-2); --_tx: -50%; --_ty: 0%; --_dx: 0px; --_dy: 3px;
  position: absolute; bottom: calc(100% + var(--_gap)); left: 50%; z-index: 10;
  width: max-content; max-width: 240px; padding: var(--b2-space-1) var(--b2-space-2);
  opacity: 0; visibility: hidden; transform: translate(calc(var(--_tx) + var(--_dx)), calc(var(--_ty) + var(--_dy)));
  transition: opacity var(--b2-duration-quick) var(--b2-easing-standard), transform var(--b2-duration-quick) var(--b2-easing-standard), visibility 0s linear var(--b2-duration-quick);
}
/* bridge over the gap so the pointer can move onto the tooltip without it closing */
.b2-tooltip::before { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: var(--_gap); }
/* arrow: 12 × 6 visible, same fill as the bubble. It is drawn 14 × 7 and tucked 1px under the bubble's edge,
   so no anti-aliased seam shows where the two meet. */
.b2-tooltip::after {
  content: ""; position: absolute; top: calc(100% - 1px); left: 50%; width: 14px; height: 7px; margin-left: -7px;
  background: inherit; clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.b2-tooltip--bottom { bottom: auto; top: calc(100% + var(--_gap)); --_dy: -3px; }
.b2-tooltip--bottom::before { top: auto; bottom: 100%; }
.b2-tooltip--bottom::after { top: auto; bottom: calc(100% - 1px); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.b2-tooltip--left, .b2-tooltip--right { bottom: auto; top: 50%; --_tx: 0%; --_ty: -50%; --_dy: 0px; }
.b2-tooltip--left { left: auto; right: calc(100% + var(--_gap)); --_dx: 3px; }
.b2-tooltip--right { left: calc(100% + var(--_gap)); --_dx: -3px; }
.b2-tooltip--left::before, .b2-tooltip--right::before { top: 0; bottom: 0; height: auto; width: var(--_gap); }
.b2-tooltip--left::before { left: 100%; right: auto; }
.b2-tooltip--right::before { right: 100%; left: auto; }
.b2-tooltip--left::after, .b2-tooltip--right::after { top: 50%; width: 7px; height: 14px; margin: -7px 0 0; }
.b2-tooltip--left::after { left: calc(100% - 1px); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.b2-tooltip--right::after { left: auto; right: calc(100% - 1px); clip-path: polygon(100% 0, 100% 100%, 0 50%); }
/* start / end: the bubble lines up with the trigger's edge; the arrow sits 14px in, the centre of a 28px target */
.b2-tooltip--start:not(.b2-tooltip--left, .b2-tooltip--right) { left: 0; --_tx: 0%; }
.b2-tooltip--end:not(.b2-tooltip--left, .b2-tooltip--right) { left: auto; right: 0; --_tx: 0%; }
.b2-tooltip--start:not(.b2-tooltip--left, .b2-tooltip--right)::after { left: 14px; }
.b2-tooltip--end:not(.b2-tooltip--left, .b2-tooltip--right)::after { left: auto; right: 14px; margin: 0 -7px 0 0; }
.b2-tooltip--start:is(.b2-tooltip--left, .b2-tooltip--right) { top: 0; --_ty: 0%; }
.b2-tooltip--end:is(.b2-tooltip--left, .b2-tooltip--right) { top: auto; bottom: 0; --_ty: 0%; }
.b2-tooltip--start:is(.b2-tooltip--left, .b2-tooltip--right)::after { top: 14px; }
.b2-tooltip--end:is(.b2-tooltip--left, .b2-tooltip--right)::after { top: auto; bottom: 14px; margin: 0 0 -7px; }
.b2-tooltip-wrap:hover > .b2-tooltip { opacity: 1; visibility: visible; --_dx: 0px; --_dy: 0px; transition-delay: 400ms; }
.b2-tooltip-wrap:has(:focus-visible) > .b2-tooltip, .b2-tooltip-wrap.is-open > .b2-tooltip { opacity: 1; visibility: visible; --_dx: 0px; --_dy: 0px; transition-delay: 0s; }
.b2-tooltip-wrap.is-dismissed > .b2-tooltip { display: none; }

/* ---------- Badge ---------- */
.b2-badge {
  display: inline-flex; align-items: center; gap: var(--b2-space-1); height: 22px; padding: 0 var(--b2-space-2);
  font: var(--b2-font-weight-semibold) var(--b2-font-size-caption)/1 var(--b2-font-body); white-space: nowrap;
  border-radius: var(--b2-radius-signature-sm); background: var(--b2-bg-sunken); color: var(--b2-text-secondary);
}
.b2-badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b2-badge--brand { background: var(--b2-brand-subtle); color: var(--b2-brand-subtle-text); }
.b2-badge--success { background: var(--b2-success-bg); color: var(--b2-success-fg); }
.b2-badge--warning { background: var(--b2-warning-bg); color: var(--b2-warning-fg); }
.b2-badge--error { background: var(--b2-error-bg); color: var(--b2-error-fg); }
.b2-badge--info { background: var(--b2-info-bg); color: var(--b2-info-fg); }

/* ---------- Alert and toast ---------- */
.b2-alert {
  --_fg: var(--b2-info-fg); --_bg: var(--b2-info-bg); --_border: var(--b2-info-border);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--b2-space-3); align-items: start;
  padding: var(--b2-space-3) var(--b2-space-4); background: var(--_bg); color: var(--b2-text-primary);
  border: var(--b2-border-width-hairline) solid var(--_border); border-radius: var(--b2-radius-signature-md);
  font: var(--b2-font-size-sm)/1.5 var(--b2-font-body);
}
.b2-alert > svg { width: var(--b2-icon-size-md); height: var(--b2-icon-size-md); color: var(--_fg); margin-top: 1px; }
.b2-alert__title { display: block; font-weight: var(--b2-font-weight-semibold); color: var(--_fg); }
.b2-alert p { margin: 2px 0 0; }
.b2-alert--success { --_fg: var(--b2-success-fg); --_bg: var(--b2-success-bg); --_border: var(--b2-success-border); }
.b2-alert--warning { --_fg: var(--b2-warning-fg); --_bg: var(--b2-warning-bg); --_border: var(--b2-warning-border); }
.b2-alert--error { --_fg: var(--b2-error-fg); --_bg: var(--b2-error-bg); --_border: var(--b2-error-border); }

.b2-toast {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--b2-space-3); align-items: center;
  width: min(400px, 100%); padding: var(--b2-space-3) var(--b2-space-3) var(--b2-space-3) var(--b2-space-4);
  background: var(--b2-bg-raised); color: var(--b2-text-primary); border: var(--b2-border-width-hairline) solid var(--b2-border-subtle);
  border-radius: var(--b2-radius-signature-md); box-shadow: var(--b2-shadow-md); font: var(--b2-font-size-sm)/1.45 var(--b2-font-body);
}
.b2-toast > svg { width: var(--b2-icon-size-md); height: var(--b2-icon-size-md); }
.b2-toast > img { width: var(--b2-mascot-size-xs); height: var(--b2-mascot-size-xs); border-radius: 50%; }
.b2-toast b { display: block; font-weight: var(--b2-font-weight-semibold); }
.b2-toast span { color: var(--b2-text-secondary); }

/* ---------- Modal (native <dialog>) ---------- */
.b2-modal {
  width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--b2-radius-signature-lg);
  background: var(--b2-bg-raised); color: var(--b2-text-primary); box-shadow: var(--b2-shadow-xl);
}
.b2-modal::backdrop { background: rgb(15 24 36 / 0.55); }
.b2-modal[open] { animation: b2-modal-in var(--b2-duration-slow) var(--b2-easing-enter); }
@keyframes b2-modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.b2-modal__header { display: flex; align-items: flex-start; gap: var(--b2-space-4); padding: var(--b2-space-6) var(--b2-space-6) 0; }
.b2-modal__title { flex: 1; margin: 0; font: var(--b2-font-weight-semibold) var(--b2-font-size-xl)/1.25 var(--b2-font-display); }
.b2-modal__body { padding: var(--b2-space-3) var(--b2-space-6) 0; color: var(--b2-text-secondary); }
.b2-modal__footer { display: flex; flex-wrap: wrap; gap: var(--b2-space-2); justify-content: flex-end; padding: var(--b2-space-6); }

/* ---------- Table ---------- */
.b2-table-wrap { overflow: auto; background: var(--b2-bg-surface); border: var(--b2-border-width-hairline) solid var(--b2-border-subtle); border-radius: var(--b2-radius-signature-md); }
.b2-table { width: 100%; border-collapse: collapse; font: var(--b2-font-size-sm)/1.4 var(--b2-font-body); color: var(--b2-text-primary); }
.b2-table th {
  position: sticky; top: 0; height: 40px; padding: 0 var(--b2-space-4); text-align: left; white-space: nowrap;
  font-weight: var(--b2-font-weight-semibold); font-size: var(--b2-font-size-caption); color: var(--b2-text-secondary);
  background: var(--b2-bg-sunken); border-bottom: var(--b2-border-width-hairline) solid var(--b2-border-default);
}
.b2-table td { height: 48px; padding: 0 var(--b2-space-4); border-bottom: var(--b2-border-width-hairline) solid var(--b2-border-subtle); }
.b2-table tbody tr:last-child td { border-bottom: 0; }
.b2-table tbody tr:hover td, .b2-table tbody tr.is-hover td { background: var(--b2-bg-canvas); }
.b2-table tbody tr[aria-selected="true"] td { background: var(--b2-brand-subtle); }
.b2-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.b2-table--dense td { height: 40px; }

/* ---------- Tabs ---------- */
.b2-tabs { display: flex; gap: var(--b2-space-1); border-bottom: var(--b2-border-width-hairline) solid var(--b2-border-subtle); overflow-x: auto; }
.b2-tabs [role="tab"] {
  height: var(--b2-control-height-md); padding: 0 var(--b2-space-3); margin-bottom: -1px; background: none; border: 0;
  border-bottom: var(--b2-border-width-thick) solid transparent; border-radius: var(--b2-radius-stem) var(--b2-radius-sm) 0 0;
  font: var(--b2-font-weight-medium) var(--b2-font-size-sm)/1 var(--b2-font-body); color: var(--b2-text-secondary); cursor: pointer; white-space: nowrap;
  transition: color var(--b2-duration-quick) var(--b2-easing-standard), border-color var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-tabs [role="tab"]:hover, .b2-tabs [role="tab"].is-hover { color: var(--b2-text-primary); background: var(--b2-bg-sunken); }
.b2-tabs [role="tab"][aria-selected="true"] { color: var(--b2-text-primary); border-bottom-color: var(--b2-brand-fill); }
.b2-tabs [role="tab"]:focus-visible, .b2-tabs [role="tab"].is-focus { outline: none; box-shadow: var(--b2-focus-ring); }
.b2-tabs [role="tab"]:disabled { color: var(--b2-text-muted); cursor: not-allowed; background: none; }

/* ---------- Navigation ---------- */
.b2-topnav { display: flex; align-items: center; gap: var(--b2-space-6); height: 64px; padding: 0 var(--b2-space-6); background: var(--b2-bg-surface); border-bottom: var(--b2-border-width-hairline) solid var(--b2-border-subtle); }
.b2-topnav__logo { display: block; height: 32px; flex: none; }
.b2-topnav__logo svg, .b2-topnav__logo img { height: 100%; width: auto; display: block; }
.b2-topnav__links { display: flex; gap: var(--b2-space-1); margin: 0; padding: 0; list-style: none; }
.b2-topnav__links a, .b2-sidenav a {
  display: flex; align-items: center; gap: var(--b2-space-3); padding: 0 var(--b2-space-3); height: var(--b2-control-height-md);
  font: var(--b2-font-weight-medium) var(--b2-font-size-sm)/1 var(--b2-font-body); color: var(--b2-text-secondary); text-decoration: none;
  border-radius: var(--b2-radius-signature-sm); transition: background-color var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-topnav__links a:hover, .b2-sidenav a:hover, .b2-topnav__links a.is-hover, .b2-sidenav a.is-hover { background: var(--b2-bg-sunken); color: var(--b2-text-primary); }
.b2-topnav__links a[aria-current="page"] { color: var(--b2-text-primary); box-shadow: inset 0 calc(-1 * var(--b2-border-width-thick)) 0 var(--b2-brand-fill); border-radius: var(--b2-radius-stem) var(--b2-radius-sm) 0 0; }
.b2-topnav__links a:focus-visible, .b2-sidenav a:focus-visible { outline: none; box-shadow: var(--b2-focus-ring); }
.b2-sidenav { display: grid; gap: 2px; width: 240px; padding: var(--b2-space-4); background: var(--b2-bg-surface); }
.b2-sidenav a svg { width: var(--b2-icon-size-md); height: var(--b2-icon-size-md); flex: none; }
.b2-sidenav a[aria-current="page"] { background: var(--b2-brand-subtle); color: var(--b2-brand-subtle-text); }
.b2-sidenav__group { margin: var(--b2-space-4) var(--b2-space-3) var(--b2-space-1); font: var(--b2-font-weight-semibold) var(--b2-font-size-caption)/1.4 var(--b2-font-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--b2-text-muted); }

/* ---------- Empty state ---------- */
.b2-empty { display: flex; flex-direction: column; align-items: center; gap: var(--b2-space-3); max-width: 440px; margin: 0 auto; padding: var(--b2-space-12) var(--b2-space-6); text-align: center; }
.b2-empty > img { height: var(--b2-mascot-size-md); width: auto; margin-bottom: var(--b2-space-2); }
.b2-empty__title { margin: 0; font: var(--b2-font-weight-semibold) var(--b2-font-size-xl)/1.25 var(--b2-font-display); color: var(--b2-text-primary); }
.b2-empty__text { margin: 0; color: var(--b2-text-secondary); }
.b2-empty__actions { display: flex; flex-wrap: wrap; gap: var(--b2-space-3); justify-content: center; margin-top: var(--b2-space-2); }
.b2-empty--compact { padding: var(--b2-space-8) var(--b2-space-4); }
.b2-empty--compact > img { height: var(--b2-mascot-size-sm); }
.b2-empty--compact .b2-empty__title { font-size: var(--b2-font-size-lg); }

/* ---------- Utility ---------- */
.b2-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Hidden native inputs behind slots, chips and segmented controls: still focusable and announced */
.b2-slot > input, .b2-chip > input, .b2-segmented input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }

/* ---------- Menu (row actions; native popover) ---------- */
.b2-menu {
  min-width: 180px; margin: auto; padding: var(--b2-space-1);
  background: var(--b2-bg-raised); color: var(--b2-text-primary);
  border: var(--b2-border-width-hairline) solid var(--b2-border-default); border-radius: var(--b2-radius-md); box-shadow: var(--b2-shadow-md);
}
@supports (position-area: bottom) {
  .b2-menu { inset: auto; margin: var(--b2-space-1) 0; position-area: bottom span-left; position-try-fallbacks: flip-block, flip-inline; }
  .b2-menu--start { position-area: bottom span-right; }
}
.b2-menu__item {
  display: flex; align-items: center; gap: var(--b2-space-2); width: 100%; min-height: var(--b2-control-height-md); padding: 0 var(--b2-space-3);
  border: 0; border-radius: var(--b2-radius-sm); background: none; color: inherit; text-align: left; text-decoration: none; cursor: pointer;
  font: var(--b2-font-weight-regular) var(--b2-font-size-sm)/1.4 var(--b2-font-body);
}
.b2-menu__item svg { width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); flex: none; color: var(--b2-text-secondary); }
.b2-menu__item:hover, .b2-menu__item:focus-visible, .b2-menu__item.is-hover { background: var(--b2-bg-sunken); outline: none; }
.b2-menu__item:focus-visible { box-shadow: inset 0 0 0 2px var(--b2-brand-focus); }
.b2-menu__item--danger, .b2-menu__item--danger svg { color: var(--b2-error-fg); }
.b2-menu__item:disabled { color: var(--b2-text-muted); background: none; cursor: not-allowed; }
.b2-menu__sep { height: 1px; margin: var(--b2-space-1) calc(-1 * var(--b2-space-1)); border: 0; background: var(--b2-border-subtle); }

/* ---------- Pagination ---------- */
.b2-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: var(--b2-space-1); font: var(--b2-font-size-sm)/1 var(--b2-font-body); color: var(--b2-text-secondary); }
.b2-pagination__summary { margin-right: auto; font-variant-numeric: tabular-nums; }
.b2-pagination__item {
  display: inline-grid; place-items: center; min-width: var(--b2-control-height-sm); height: var(--b2-control-height-sm); padding: 0 var(--b2-space-2);
  border: 0; border-radius: var(--b2-radius-sm); background: none; color: var(--b2-text-secondary); text-decoration: none; cursor: pointer;
  font: var(--b2-font-weight-medium) var(--b2-font-size-sm)/1 var(--b2-font-body); font-variant-numeric: tabular-nums;
  transition: background-color var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-pagination__item svg { width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); }
.b2-pagination__item:hover, .b2-pagination__item.is-hover { background: var(--b2-bg-sunken); color: var(--b2-text-primary); }
.b2-pagination__item:focus-visible { outline: none; box-shadow: var(--b2-focus-ring); }
.b2-pagination__item[aria-current="page"] { background: var(--b2-brand-subtle); color: var(--b2-brand-subtle-text); font-weight: var(--b2-font-weight-semibold); }
.b2-pagination__item[aria-disabled="true"] { color: var(--b2-text-muted); background: none; pointer-events: none; }
.b2-pagination__gap { min-width: var(--b2-control-height-sm); text-align: center; }

/* ---------- Calendar and time slots ---------- */
.b2-calendar { display: inline-grid; gap: var(--b2-space-3); padding: var(--b2-space-4); background: var(--b2-bg-surface); border: var(--b2-border-width-hairline) solid var(--b2-border-subtle); border-radius: var(--b2-radius-md); }
.b2-calendar__head { display: flex; align-items: center; justify-content: space-between; gap: var(--b2-space-2); }
.b2-calendar__title { margin: 0; font: var(--b2-font-weight-semibold) var(--b2-font-size-md)/1.3 var(--b2-font-display); color: var(--b2-text-primary); }
.b2-calendar table { border-collapse: collapse; }
.b2-calendar th, .b2-calendar td { background: none; border: 0; }
.b2-calendar th { width: var(--b2-control-height-md); height: var(--b2-control-height-sm); font: var(--b2-font-weight-medium) var(--b2-font-size-caption)/1 var(--b2-font-body); color: var(--b2-text-muted); }
.b2-calendar td { padding: 1px; text-align: center; }
.b2-calendar__day {
  position: relative; display: inline-grid; place-items: center; width: var(--b2-control-height-md); height: var(--b2-control-height-md);
  border: 0; border-radius: var(--b2-radius-bowl); background: none; color: var(--b2-text-primary); cursor: pointer;
  font: var(--b2-font-weight-regular) var(--b2-font-size-sm)/1 var(--b2-font-body); font-variant-numeric: tabular-nums;
  transition: background-color var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-calendar__day:hover, .b2-calendar__day.is-hover { background: var(--b2-bg-sunken); }
.b2-calendar__day:focus-visible { outline: none; box-shadow: var(--b2-focus-ring); }
.b2-calendar__day.is-outside { color: var(--b2-text-muted); }
.b2-calendar__day[aria-current="date"] { font-weight: var(--b2-font-weight-semibold); }
.b2-calendar__day[aria-current="date"]::after { content: ""; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--b2-brand-fill); }
.b2-calendar__day[aria-pressed="true"] { background: var(--b2-brand-fill); color: var(--b2-text-on-brand); font-weight: var(--b2-font-weight-semibold); }
.b2-calendar__day[aria-pressed="true"]::after { background: var(--b2-text-on-brand); }
.b2-calendar__day:disabled { color: var(--b2-text-muted); background: none; cursor: not-allowed; }

.b2-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: var(--b2-space-2); margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.b2-slots > legend { margin-bottom: var(--b2-space-2); padding: 0; }
.b2-slot { position: relative; display: flex; }
.b2-slot > span {
  display: grid; place-items: center; width: 100%; height: var(--b2-control-height-md); cursor: pointer;
  border: var(--b2-border-width-hairline) solid var(--b2-border-strong); border-radius: var(--b2-radius-sm); background: var(--b2-bg-surface); color: var(--b2-text-primary);
  font: var(--b2-font-weight-medium) var(--b2-font-size-sm)/1 var(--b2-font-body); font-variant-numeric: tabular-nums;
  transition: background-color var(--b2-duration-quick) var(--b2-easing-standard), border-color var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-slot:hover > span, .b2-slot.is-hover > span { border-color: var(--b2-text-secondary); }
.b2-slot > input:checked + span { background: var(--b2-brand-fill); border-color: var(--b2-brand-fill); color: var(--b2-text-on-brand); }
.b2-slot > input:focus-visible + span { box-shadow: var(--b2-focus-ring); }
.b2-slot > input:disabled + span { background: var(--b2-bg-sunken); border-color: var(--b2-border-subtle); color: var(--b2-text-muted); text-decoration: line-through; cursor: not-allowed; }

/* ---------- Input group: prefix, suffix, buttons (search, number) ---------- */
.b2-input-group {
  display: flex; align-items: center; height: var(--b2-control-height-md); overflow: hidden;
  background: var(--b2-bg-surface); border: var(--b2-border-width-hairline) solid var(--b2-border-strong); border-radius: var(--b2-radius-md);
  transition: border-color var(--b2-duration-quick) var(--b2-easing-standard), box-shadow var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-input-group:hover { border-color: var(--b2-text-secondary); }
.b2-input-group:focus-within { border-color: var(--b2-brand-focus); box-shadow: var(--b2-focus-ring); }
.b2-input-group:has(> input[aria-invalid="true"]) { border-color: var(--b2-error-fg); }
.b2-input-group:has(> input[aria-invalid="true"]):focus-within { box-shadow: 0 0 0 2px var(--b2-bg-canvas), 0 0 0 4px var(--b2-error-fg); }
.b2-input-group:has(> input:disabled) { background: var(--b2-bg-sunken); border-color: var(--b2-border-subtle); color: var(--b2-text-muted); }
/* the group draws the frame and the focus ring; the input inside never does, whatever global focus styles exist */
.b2-input-group > input, .b2-input-group > input:focus, .b2-input-group > input:focus-visible {
  flex: 1; min-width: 0; height: 100%; padding: 0 var(--b2-space-3); border: 0; border-radius: 0; outline: none; box-shadow: none; background: transparent;
  font: var(--b2-font-weight-regular) var(--b2-font-size-md)/1.5 var(--b2-font-body); color: var(--b2-text-primary);
}
.b2-input-group > input::placeholder { color: var(--b2-text-muted); }
.b2-input-group > input:disabled { color: var(--b2-text-muted); cursor: not-allowed; }
.b2-input-group__addon { display: flex; align-items: center; height: 100%; padding: 0 var(--b2-space-3); flex: none; white-space: nowrap; color: var(--b2-text-secondary); font: var(--b2-font-size-md)/1 var(--b2-font-body); }
.b2-input-group__addon:first-child { padding-right: 0; }
.b2-input-group__addon:last-child { padding-left: 0; }
.b2-input-group__addon svg { width: var(--b2-icon-size-md); height: var(--b2-icon-size-md); }
.b2-input-group__btn {
  display: grid; place-items: center; width: var(--b2-control-height-md); height: 100%; flex: none; padding: 0;
  border: 0; background: none; color: var(--b2-text-secondary); cursor: pointer;
  transition: background-color var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-input-group__btn svg { width: var(--b2-icon-size-md); height: var(--b2-icon-size-md); }
.b2-input-group__btn:hover { background: var(--b2-bg-sunken); color: var(--b2-text-primary); }
.b2-input-group__btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--b2-brand-focus); }
.b2-input-group__btn:disabled { color: var(--b2-text-muted); background: none; cursor: not-allowed; }
.b2-input-group--sm { height: var(--b2-control-height-sm); }
.b2-input-group--sm > input, .b2-input-group--sm .b2-input-group__addon { font-size: var(--b2-font-size-sm); }
.b2-input-group--sm .b2-input-group__btn { width: var(--b2-control-height-sm); }
/* Number: − value + */
.b2-number { width: calc(2 * var(--b2-control-height-md) + 64px); }
.b2-number > input { padding: 0; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.b2-number > input::-webkit-inner-spin-button, .b2-number > input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.b2-number > .b2-input-group__btn:first-child { border-right: var(--b2-border-width-hairline) solid var(--b2-border-subtle); }
.b2-number > .b2-input-group__btn:last-child { border-left: var(--b2-border-width-hairline) solid var(--b2-border-subtle); }
/* Chips inside the field (multi-select) */
.b2-input-group--chips { height: auto; min-height: var(--b2-control-height-md); flex-wrap: wrap; gap: var(--b2-space-1); padding: var(--b2-space-1); }
.b2-input-group--chips > input, .b2-input-group--chips > input:focus, .b2-input-group--chips > input:focus-visible { height: var(--_inner); min-width: 120px; padding: 0 var(--b2-space-2); }
/* chips sit concentric with the field: 4px inset all round, so radius 10 − 4 = 6 and height 40 − 2 (border) − 8 = 30 */
.b2-input-group--chips { --_inner: calc(var(--b2-control-height-md) - 2 * var(--b2-border-width-hairline) - 2 * var(--b2-space-1)); }
.b2-input-group--chips > .b2-chip { height: var(--_inner); border-radius: var(--b2-radius-sm); }

/* ---------- Combobox list (search with suggestions) ---------- */
.b2-combobox { position: relative; }
.b2-listbox {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20; max-height: 280px; overflow: auto;
  margin: var(--b2-space-1) 0 0; padding: var(--b2-space-1); list-style: none;
  background: var(--b2-bg-raised); color: var(--b2-text-primary);
  border: var(--b2-border-width-hairline) solid var(--b2-border-default); border-radius: var(--b2-radius-md); box-shadow: var(--b2-shadow-md);
}
.b2-listbox [role="option"] {
  /* no gap: the text and its <mark> are separate flex items and must stay joined */
  display: flex; align-items: center; min-height: var(--b2-control-height-md); padding: 0 var(--b2-space-3);
  border-radius: var(--b2-radius-sm); cursor: pointer; font: var(--b2-font-weight-regular) var(--b2-font-size-md)/1.4 var(--b2-font-body); white-space: pre;
}
.b2-listbox [role="option"]:hover { background: var(--b2-bg-sunken); }
/* focus stays in the input, which already shows the ring; the active option is marked by its background */
.b2-listbox [role="option"].is-active { background: var(--b2-bg-sunken); }
.b2-listbox [role="option"][aria-selected="true"] { background: var(--b2-brand-subtle); color: var(--b2-brand-subtle-text); font-weight: var(--b2-font-weight-medium); }
.b2-listbox [role="option"][aria-selected="true"]::after { content: ""; width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); margin-left: auto; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E") center / contain no-repeat; }
.b2-listbox mark { background: none; color: inherit; font-weight: var(--b2-font-weight-semibold); }
.b2-listbox__empty { padding: var(--b2-space-3); color: var(--b2-text-secondary); font-size: var(--b2-font-size-sm); }

/* ---------- File upload ---------- */
.b2-dropzone {
  position: relative; display: grid; justify-items: center; align-content: center; gap: var(--b2-space-2); padding: var(--b2-space-8) var(--b2-space-6); text-align: center;
  background: var(--b2-bg-surface); color: var(--b2-text-secondary); border: var(--b2-border-width-hairline) dashed var(--b2-border-strong); border-radius: var(--b2-radius-md);
  font: var(--b2-font-size-sm)/1.5 var(--b2-font-body); cursor: pointer;
  transition: background-color var(--b2-duration-quick) var(--b2-easing-standard), border-color var(--b2-duration-quick) var(--b2-easing-standard);
}
/* the file input covers the zone: click opens the picker, dropping a file fills it */
.b2-dropzone > input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.b2-dropzone > svg { width: var(--b2-icon-size-lg); height: var(--b2-icon-size-lg); }
.b2-dropzone strong { color: var(--b2-text-primary); font-weight: var(--b2-font-weight-semibold); }
.b2-dropzone small { font-size: var(--b2-font-size-caption); }
.b2-dropzone:hover { border-color: var(--b2-text-secondary); }
.b2-dropzone:has(> input:focus-visible) { box-shadow: var(--b2-focus-ring); }
.b2-dropzone.is-dragover { background: var(--b2-brand-subtle); border-color: var(--b2-brand-focus); color: var(--b2-brand-subtle-text); }
.b2-file {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--b2-space-3); padding: var(--b2-space-3);
  background: var(--b2-bg-surface); border: var(--b2-border-width-hairline) solid var(--b2-border-subtle); border-radius: var(--b2-radius-md);
  font: var(--b2-font-size-sm)/1.4 var(--b2-font-body);
}
.b2-file > img, .b2-file__icon { width: var(--b2-control-height-lg); height: var(--b2-control-height-lg); border-radius: var(--b2-radius-sm); object-fit: cover; background: var(--b2-bg-sunken); display: grid; place-items: center; color: var(--b2-text-secondary); }
.b2-file__icon svg { width: var(--b2-icon-size-md); height: var(--b2-icon-size-md); }
.b2-file__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--b2-font-weight-medium); color: var(--b2-text-primary); }
.b2-file__meta { display: block; color: var(--b2-text-secondary); font-size: var(--b2-font-size-caption); }
.b2-file .b2-progress { margin-top: var(--b2-space-1); }

/* ---------- Chips: filters (checkbox) and tags (removable) ---------- */
.b2-chip {
  position: relative; display: inline-flex; align-items: center; gap: var(--b2-space-1); height: var(--b2-control-height-sm); padding: 0 var(--b2-space-3);
  border: var(--b2-border-width-hairline) solid var(--b2-border-default); border-radius: var(--b2-radius-bowl); background: var(--b2-bg-surface); color: var(--b2-text-primary);
  font: var(--b2-font-weight-medium) var(--b2-font-size-sm)/1 var(--b2-font-body); white-space: nowrap;
  transition: background-color var(--b2-duration-quick) var(--b2-easing-standard), border-color var(--b2-duration-quick) var(--b2-easing-standard);
}
label.b2-chip { cursor: pointer; }
label.b2-chip:hover, .b2-chip.is-hover { background: var(--b2-bg-sunken); }
.b2-chip svg { width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); }
.b2-chip:has(> input:checked) { background: var(--b2-brand-subtle); border-color: var(--b2-brand-border); color: var(--b2-brand-subtle-text); padding-left: var(--b2-space-2); }
.b2-chip:has(> input:checked)::before { content: ""; width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E") center / contain no-repeat; }
.b2-chip:has(> input:focus-visible) { box-shadow: var(--b2-focus-ring); }
.b2-chip:has(> input:disabled) { color: var(--b2-text-muted); background: var(--b2-bg-sunken); border-color: var(--b2-border-subtle); cursor: not-allowed; }
.b2-chip__remove {
  display: grid; place-items: center; width: 20px; height: 20px; margin-right: calc(-1 * var(--b2-space-1)); padding: 0;
  border: 0; border-radius: var(--b2-radius-bowl); background: none; color: var(--b2-text-secondary); cursor: pointer;
}
.b2-chip__remove svg { width: 14px; height: 14px; }
.b2-chip__remove:hover { background: var(--b2-bg-sunken); color: var(--b2-text-primary); }
.b2-chip__remove:focus-visible { outline: none; box-shadow: var(--b2-focus-ring); }
.b2-chip--sm { height: 26px; padding: 0 var(--b2-space-2); font-size: var(--b2-font-size-caption); }
.b2-chip-group { display: flex; flex-wrap: wrap; gap: var(--b2-space-2); margin: 0; padding: 0; border: 0; min-inline-size: 0; }

/* ---------- Segmented control (radios) ---------- */
/* Equal-width segments; one raised thumb slides to the checked one. :has() reads the count (2–4) and the checked index. */
.b2-segmented {
  --_n: 2; --_i: 0;
  position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  margin: 0; padding: 2px; border: 0; min-inline-size: 0; background: var(--b2-bg-sunken); border-radius: var(--b2-radius-md);
}
.b2-segmented:has(> label:nth-of-type(3)) { --_n: 3; }
.b2-segmented:has(> label:nth-of-type(4)) { --_n: 4; }
.b2-segmented:has(> label:nth-of-type(2) > input:checked) { --_i: 1; }
.b2-segmented:has(> label:nth-of-type(3) > input:checked) { --_i: 2; }
.b2-segmented:has(> label:nth-of-type(4) > input:checked) { --_i: 3; }
.b2-segmented::before {
  content: ""; position: absolute; top: 2px; bottom: 2px; left: 2px;
  width: calc((100% - 4px - (var(--_n) - 1) * 2px) / var(--_n));
  background: var(--b2-bg-surface); border-radius: var(--b2-radius-sm); box-shadow: var(--b2-shadow-sm);
  transform: translateX(calc(var(--_i) * (100% + 2px)));
  transition: transform var(--b2-duration-base) var(--b2-easing-standard);
}
.b2-segmented:not(:has(input:checked))::before { opacity: 0; }
.b2-segmented > label { position: relative; z-index: 1; display: flex; }
.b2-segmented span {
  display: flex; align-items: center; justify-content: center; gap: var(--b2-space-2); width: 100%; height: calc(var(--b2-control-height-md) - 4px); padding: 0 var(--b2-space-4);
  border-radius: var(--b2-radius-sm); color: var(--b2-text-secondary); cursor: pointer; white-space: nowrap;
  font: var(--b2-font-weight-medium) var(--b2-font-size-sm)/1 var(--b2-font-body);
  transition: color var(--b2-duration-base) var(--b2-easing-standard);
}
.b2-segmented span svg { width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); }
.b2-segmented label:hover span, .b2-segmented input:checked + span { color: var(--b2-text-primary); }
.b2-segmented input:focus-visible + span { box-shadow: var(--b2-focus-ring); }
.b2-segmented input:disabled + span { color: var(--b2-text-muted); cursor: not-allowed; }
.b2-segmented--sm span { height: calc(var(--b2-control-height-sm) - 4px); padding: 0 var(--b2-space-3); font-size: var(--b2-font-size-caption); }
.b2-segmented--block { display: grid; }

/* ---------- Skeleton ---------- */
.b2-skeleton {
  display: block; height: 12px; border-radius: var(--b2-radius-stem);
  background: linear-gradient(90deg, var(--b2-bg-sunken) 25%, var(--b2-border-subtle) 50%, var(--b2-bg-sunken) 75%) 0 0 / 200% 100%;
  animation: b2-shimmer 1.4s var(--b2-easing-standard) infinite;
}
@keyframes b2-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.b2-skeleton--title { height: 20px; width: 60%; }
.b2-skeleton--circle { width: var(--b2-control-height-md); height: var(--b2-control-height-md); border-radius: var(--b2-radius-bowl); flex: none; }
.b2-skeleton--block { height: 120px; border-radius: var(--b2-radius-md); }

/* ---------- Drawer (native <dialog>, with the modal's parts) ---------- */
.b2-modal.b2-drawer {
  width: min(420px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto;
  border-radius: var(--b2-radius-lg) 0 0 var(--b2-radius-lg);
}
.b2-modal.b2-drawer[open] { display: flex; flex-direction: column; animation: b2-drawer-in var(--b2-duration-slow) var(--b2-easing-enter); }
.b2-drawer .b2-modal__body { flex: 1; overflow: auto; padding-bottom: var(--b2-space-6); }
.b2-drawer .b2-modal__footer { padding: var(--b2-space-4) var(--b2-space-6); border-top: var(--b2-border-width-hairline) solid var(--b2-border-subtle); }
.b2-modal.b2-drawer--start { margin: 0 auto 0 0; border-radius: 0 var(--b2-radius-lg) var(--b2-radius-lg) 0; }
.b2-modal.b2-drawer--start[open] { animation-name: b2-drawer-in-start; }
@keyframes b2-drawer-in { from { transform: translateX(100%); } }
@keyframes b2-drawer-in-start { from { transform: translateX(-100%); } }

/* ---------- Progress and steps ---------- */
.b2-progress { appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: var(--b2-radius-bowl); background: var(--b2-bg-sunken); overflow: hidden; }
.b2-progress::-webkit-progress-bar { background: var(--b2-bg-sunken); border-radius: var(--b2-radius-bowl); }
.b2-progress::-webkit-progress-value { background: var(--b2-brand-fill); border-radius: var(--b2-radius-bowl); transition: width var(--b2-duration-base) var(--b2-easing-standard); }
.b2-progress::-moz-progress-bar { background: var(--b2-brand-fill); border-radius: var(--b2-radius-bowl); }
.b2-progress--success::-webkit-progress-value { background: var(--b2-success-fill); }
.b2-progress--success::-moz-progress-bar { background: var(--b2-success-fill); }

.b2-steps { display: flex; margin: 0; padding: 0; list-style: none; counter-reset: b2-step; overflow-x: auto; }
.b2-steps > li {
  counter-increment: b2-step; display: flex; flex: 1; align-items: center; gap: var(--b2-space-2); min-width: max-content;
  font: var(--b2-font-weight-medium) var(--b2-font-size-sm)/1.3 var(--b2-font-body); color: var(--b2-text-secondary);
}
.b2-steps > li:last-child { flex: none; }
.b2-steps > li::before {
  content: counter(b2-step); display: grid; place-items: center; width: 28px; height: 28px; flex: none; box-sizing: border-box;
  border: 1.5px solid var(--b2-border-strong); border-radius: var(--b2-radius-bowl); background: var(--b2-bg-surface);
  font: var(--b2-font-weight-semibold) var(--b2-font-size-caption)/1 var(--b2-font-body); color: var(--b2-text-secondary);
}
.b2-steps > li:not(:last-child)::after { content: ""; flex: 1; min-width: var(--b2-space-6); height: 2px; margin: 0 var(--b2-space-2); border-radius: var(--b2-radius-bowl); background: var(--b2-border-default); }
.b2-steps > li[aria-current="step"] { color: var(--b2-text-primary); }
.b2-steps > li[aria-current="step"]::before { border-color: var(--b2-brand-fill); background: var(--b2-brand-subtle); color: var(--b2-brand-subtle-text); }
.b2-steps > li.is-complete { color: var(--b2-text-primary); }
.b2-steps > li.is-complete::before { content: ""; border-color: var(--b2-brand-fill); background: var(--b2-brand-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E") center / 16px no-repeat; }
.b2-steps > li.is-complete:not(:last-child)::after { background: var(--b2-brand-fill); }
/* narrow screens: numbers for every step, the label for the current one only */
@media (max-width: 600px) {
  .b2-steps > li:not([aria-current="step"]) > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .b2-steps > li { min-width: 0; }
}

/* ---------- Avatar ---------- */
.b2-avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; overflow: hidden; border-radius: var(--b2-radius-bowl);
  background: var(--b2-bg-feature); color: var(--b2-brand-subtle-text); user-select: none;
  font: var(--b2-font-weight-semibold) var(--b2-font-size-caption)/1 var(--b2-font-body); text-transform: uppercase;
}
.b2-avatar > img { width: 100%; height: 100%; object-fit: cover; }
.b2-avatar--sm { width: 24px; height: 24px; }
.b2-avatar--lg { width: var(--b2-control-height-md); height: var(--b2-control-height-md); font-size: var(--b2-font-size-sm); }
.b2-avatar--xl { width: 56px; height: 56px; font-size: var(--b2-font-size-lg); }
.b2-avatar--more { background: var(--b2-bg-sunken); color: var(--b2-text-secondary); text-transform: none; }
.b2-avatar-group { display: inline-flex; }
.b2-avatar-group > .b2-avatar { box-shadow: 0 0 0 2px var(--b2-bg-surface); }
.b2-avatar-group > .b2-avatar + .b2-avatar { margin-left: calc(-1 * var(--b2-space-2)); }

/* ---------- Accordion (<details>) ---------- */
.b2-accordion { border-top: var(--b2-border-width-hairline) solid var(--b2-border-subtle); }
.b2-accordion > details { border-bottom: var(--b2-border-width-hairline) solid var(--b2-border-subtle); interpolate-size: allow-keywords; }
.b2-accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--b2-space-4); min-height: 56px; padding: var(--b2-space-3) 0;
  list-style: none; cursor: pointer; font: var(--b2-font-weight-semibold) var(--b2-font-size-md)/1.4 var(--b2-font-body); color: var(--b2-text-primary);
}
.b2-accordion summary::-webkit-details-marker { display: none; }
.b2-accordion summary::after {
  content: ""; width: var(--b2-icon-size-md); height: var(--b2-icon-size-md); flex: none; background: var(--b2-text-secondary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--b2-duration-quick) var(--b2-easing-standard);
}
.b2-accordion details[open] > summary::after { transform: rotate(180deg); }
.b2-accordion summary:focus-visible { outline: none; box-shadow: var(--b2-focus-ring); border-radius: var(--b2-radius-sm); }
.b2-accordion details::details-content { block-size: 0; overflow: clip; transition: block-size var(--b2-duration-base) var(--b2-easing-standard), content-visibility var(--b2-duration-base) allow-discrete; }
.b2-accordion details[open]::details-content { block-size: auto; }
.b2-accordion__body { padding: 0 0 var(--b2-space-5); color: var(--b2-text-secondary); font: var(--b2-font-size-md)/1.6 var(--b2-font-body); }
.b2-accordion__body > :first-child { margin-top: 0; }
.b2-accordion__body > :last-child { margin-bottom: 0; }

/* ---------- Breadcrumb ---------- */
.b2-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--b2-space-1); margin: 0; padding: 0; list-style: none; font: var(--b2-font-size-sm)/1.4 var(--b2-font-body); color: var(--b2-text-secondary); }
.b2-breadcrumb li { display: flex; align-items: center; gap: var(--b2-space-1); }
.b2-breadcrumb li + li::before { content: ""; width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); background: var(--b2-text-muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6l-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6l-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.b2-breadcrumb a { color: var(--b2-text-secondary); text-decoration: none; border-radius: var(--b2-radius-stem); }
.b2-breadcrumb a:hover { color: var(--b2-text-primary); text-decoration: underline; text-underline-offset: 3px; }
.b2-breadcrumb a:focus-visible { outline: none; box-shadow: var(--b2-focus-ring); }
.b2-breadcrumb [aria-current="page"] { color: var(--b2-text-primary); font-weight: var(--b2-font-weight-medium); }

/* ---------- Stat (dashboard number) ---------- */
.b2-stat { display: grid; gap: var(--b2-space-1); }
.b2-stat__label { margin: 0; font: var(--b2-font-weight-medium) var(--b2-font-size-sm)/1.4 var(--b2-font-body); color: var(--b2-text-secondary); }
.b2-stat__value { margin: 0; font: var(--b2-font-weight-semibold) var(--b2-font-size-3xl)/1.1 var(--b2-font-display); color: var(--b2-text-primary); font-variant-numeric: tabular-nums; }
.b2-stat__delta { display: inline-flex; align-items: center; gap: var(--b2-space-1); font: var(--b2-font-weight-semibold) var(--b2-font-size-caption)/1.4 var(--b2-font-body); color: var(--b2-text-secondary); }
.b2-stat__delta svg { width: var(--b2-icon-size-sm); height: var(--b2-icon-size-sm); }
.b2-stat__delta--positive { color: var(--b2-success-fg); }
.b2-stat__delta--negative { color: var(--b2-error-fg); }
.b2-stat__delta span { font-weight: var(--b2-font-weight-regular); color: var(--b2-text-secondary); }

/* ---------- Marketing sections (site) ---------- */
.b2-hero { display: grid; gap: var(--b2-space-8); align-items: center; padding: var(--b2-space-16) 0; }
.b2-hero__copy { display: grid; gap: var(--b2-space-5); justify-items: start; }
.b2-hero__copy > * { margin: 0; }
.b2-hero__copy > .b2-type-display { font-size: clamp(var(--b2-font-size-3xl), 8vw, var(--b2-font-size-5xl)); overflow-wrap: break-word; }
.b2-hero__copy .b2-type-body-lg { max-width: 56ch; color: var(--b2-text-secondary); }
.b2-hero__actions { display: flex; flex-wrap: wrap; gap: var(--b2-space-3); margin-top: var(--b2-space-2); }
@media (min-width: 900px) { .b2-hero--media { grid-template-columns: 1.1fr 0.9fr; } }

.b2-pricing { display: grid; gap: var(--b2-space-6); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; }
.b2-plan { display: flex; flex-direction: column; gap: var(--b2-space-4); }
.b2-plan > * { margin: 0; }
.b2-plan__name { font: var(--b2-font-weight-semibold) var(--b2-font-size-lg)/1.3 var(--b2-font-display); color: var(--b2-text-primary); }
.b2-plan__price { display: flex; align-items: baseline; gap: var(--b2-space-1); color: var(--b2-text-secondary); font-size: var(--b2-font-size-sm); }
.b2-plan__price strong { font: var(--b2-font-weight-semibold) var(--b2-font-size-4xl)/1 var(--b2-font-display); color: var(--b2-text-primary); font-variant-numeric: tabular-nums; }
.b2-plan__features { display: grid; gap: var(--b2-space-2); padding: 0; list-style: none; font: var(--b2-font-size-sm)/1.5 var(--b2-font-body); color: var(--b2-text-primary); }
.b2-plan__features li { display: flex; gap: var(--b2-space-2); }
.b2-plan__features li::before { content: ""; width: var(--b2-icon-size-md); height: var(--b2-icon-size-md); flex: none; background: var(--b2-success-fg); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E") center / contain no-repeat; }
.b2-plan .b2-btn { width: 100%; margin-top: auto; }

.b2-quote { display: grid; align-content: start; gap: var(--b2-space-5); margin: 0; }
.b2-quote > svg { width: var(--b2-icon-size-lg); height: var(--b2-icon-size-lg); color: var(--b2-brand-logo); }
.b2-quote blockquote { margin: 0; font: var(--b2-font-weight-medium) var(--b2-font-size-xl)/1.45 var(--b2-font-display); color: var(--b2-text-primary); text-wrap: pretty; }
.b2-quote figcaption { display: flex; align-items: center; gap: var(--b2-space-3); font: var(--b2-font-size-sm)/1.4 var(--b2-font-body); color: var(--b2-text-secondary); }
.b2-quote figcaption b { display: block; color: var(--b2-text-primary); font-weight: var(--b2-font-weight-semibold); }

.b2-cta-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--b2-space-6);
  padding: var(--b2-space-10) var(--b2-space-8); border-radius: var(--b2-radius-signature-lg); background: var(--b2-bg-feature); color: var(--b2-text-primary);
}
.b2-cta-band__title { margin: 0; max-width: 24ch; font: var(--b2-font-weight-semibold) var(--b2-font-size-3xl)/1.15 var(--b2-font-display); }
.b2-cta-band__text { margin: var(--b2-space-2) 0 0; color: var(--b2-text-secondary); }
.b2-cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--b2-space-3); }
/* On brand-600 white text passes AA at every size (4.70:1); never the orange logo here */
.b2-cta-band--brand { background: var(--b2-brand-fill); color: var(--b2-text-on-brand); }
.b2-cta-band--brand .b2-cta-band__text { color: var(--b2-text-on-brand); }
.b2-btn--on-brand { background: var(--b2-text-on-brand); color: var(--b2-color-brand-800); }
.b2-btn--on-brand:hover, .b2-btn--on-brand.is-hover { background: var(--b2-color-brand-50); }
.b2-btn--on-brand:focus-visible { box-shadow: 0 0 0 2px var(--b2-brand-fill), 0 0 0 4px var(--b2-text-on-brand); }

.b2-footer { padding: var(--b2-space-12) var(--b2-space-6) var(--b2-space-8); background: var(--b2-bg-sunken); color: var(--b2-text-secondary); font: var(--b2-font-size-sm)/1.6 var(--b2-font-body); }
.b2-footer__grid { display: grid; gap: var(--b2-space-8); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.b2-footer__brand { display: grid; gap: var(--b2-space-3); align-content: start; }
.b2-footer__brand svg, .b2-footer__brand img { height: 32px; width: auto; }
.b2-footer__brand p { margin: 0; max-width: 32ch; }
.b2-footer__title { margin: 0 0 var(--b2-space-3); font: var(--b2-font-weight-semibold) var(--b2-font-size-caption)/1.4 var(--b2-font-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--b2-text-primary); }
.b2-footer ul { display: grid; gap: var(--b2-space-2); margin: 0; padding: 0; list-style: none; }
.b2-footer a { color: var(--b2-text-secondary); text-decoration: none; border-radius: var(--b2-radius-stem); }
.b2-footer a:hover { color: var(--b2-text-primary); text-decoration: underline; text-underline-offset: 3px; }
.b2-footer a:focus-visible { outline: none; box-shadow: var(--b2-focus-ring); }
.b2-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--b2-space-4); margin-top: var(--b2-space-10); padding-top: var(--b2-space-6); border-top: var(--b2-border-width-hairline) solid var(--b2-border-default); font-size: var(--b2-font-size-caption); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .b2-spinner { animation-duration: 1600ms; } /* still shows progress, slower */
  .b2-modal[open] { animation: none; }
  .b2-btn:active:not(:disabled) { transform: none; }
  .b2-skeleton { animation: none; }
  .b2-segmented::before { transition: none; }
  .b2-modal.b2-drawer[open] { animation: none; }
  .b2-accordion details::details-content { transition: none; }
}
@font-face {
  font-family: 'Outfit';
  src: url('/fonts/Outfit.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/Figtree.ttf') format('truetype');
  font-weight: 300 900;
  font-display: swap;
}

/* panel names mapped onto the brand's theme tokens */
:root {
  --b2-orange: var(--b2-brand-fill);
  --b2-orange-dark: var(--b2-brand-fill-hover);
  --b2-offwhite: var(--b2-bg-canvas);
  --b2-white: var(--b2-bg-surface);
  --b2-ink: var(--b2-text-primary);
  --b2-muted: var(--b2-text-muted);
  --b2-line: var(--b2-border-subtle);
  --b2-mint: var(--b2-success-bg);
  --b2-mint-ink: var(--b2-success-fg);
  --b2-peach: var(--b2-brand-subtle);
  --b2-peach-ink: var(--b2-brand-subtle-text);
  --b2-cream: var(--b2-warning-bg);
  --b2-cream-ink: var(--b2-warning-fg);
  --b2-radius-pill: var(--b2-radius-bowl);
  --b2-ease-out: var(--b2-easing-standard);
  --b2-dur-micro: var(--b2-duration-quick);
  --b2-dur-ui: var(--b2-duration-base);
}

* {
  box-sizing: border-box;
}
html,
body {
  overscroll-behavior: none; /* no rubber-band stretch: the sticky sidebar would bounce with the page */
}
body {
  margin: 0;
  background: var(--b2-offwhite);
  color: var(--b2-ink);
  font: 400 16px/1.6 var(--b2-font-body);
}
h1 {
  margin: 0 0 24px;
  font-family: var(--b2-font-display);
  font-size: 32px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.03em;
}
a {
  color: var(--b2-ink);
  font-weight: 600;
  text-decoration: none;
}
a:hover {
  color: var(--b2-orange);
}

/* menu group headings and form section headings */
.form-heading {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding-top: 24px;
  border-top: 1.5px solid var(--b2-line);
  font-size: 18px;
  letter-spacing: -0.02em;
}
.fields fieldset > .form-heading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* field help, required marker, errors */
.req {
  color: var(--b2-orange);
}
.fields fieldset {
  display: contents; /* keep the two-column grid; `disabled` still reaches every control */
  border: 0;
  padding: 0;
  margin: 0;
}
/* unread marker + counters */
.unread {
  font-weight: 800;
}
.unread::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--b2-orange);
}
/* overview */
.ov-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.ov-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.ov-main,
.ov-side {
  display: grid;
  gap: 20px;
}
.ov-body .b2-card,
.ov-kpis .b2-card {
  max-width: none;
}
.ov-body h3 {
  margin: 0 0 12px;
}
.kpi {
  display: grid;
  gap: 4px;
  align-content: start;
  color: var(--b2-ink);
}
a.kpi:hover {
  color: var(--b2-ink);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.07);
}
.num {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.readout {
  margin: 0 0 12px;
  font-weight: 700;
  min-height: 1.6em;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 160px;
  border-bottom: 1.5px solid var(--b2-line);
}
.bar-col {
  flex: 1;
  height: 100%; /* the whole column is the hover target, not just the thin bar */
  display: flex;
  align-items: flex-end;
  border-radius: 4px 4px 0 0;
  outline-offset: 2px;
}
.bar {
  width: 100%;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--b2-orange);
  transition: background var(--b2-dur-micro) var(--b2-ease-out);
}
.bar.empty {
  background: var(--b2-line);
}
.bar.on {
  background: var(--b2-orange-dark);
}
.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 13px;
  color: var(--b2-muted);
}
.table-view {
  margin-top: 12px;
  font-size: 14px;
}
.table-view summary {
  cursor: pointer;
  color: var(--b2-muted);
  font-weight: 600;
}
.table-view table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
}
.table-view th,
.table-view td {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid var(--b2-line);
}
.top {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.top-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}
.top-name {
  display: grid;
  min-width: 0;
}
.top-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-bar {
  display: block;
  height: 6px;
  margin-top: 6px;
  border-radius: 3px;
  background: var(--b2-offwhite);
}
.top-bar > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--b2-orange);
}
.qa-list {
  display: grid;
  gap: 8px;
}
.qa {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--b2-line);
  border-radius: var(--b2-radius-sm);
  background: var(--b2-white);
  color: var(--b2-ink);
  font: 700 15px/1.2 var(--b2-font-body);
  text-align: left;
  transition: border-color var(--b2-dur-micro) var(--b2-ease-out);
}
.qa:hover:not(:disabled) {
  border-color: var(--b2-orange);
  color: var(--b2-ink);
}
.qa small {
  margin-left: auto;
  color: var(--b2-muted);
  font-weight: 600;
}
.activity {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.activity li {
  display: grid;
}

/* dropdown (views/Select.vue) */
.select {
  position: relative;
}
/* frame from b2-input (button) and b2-listbox (list) */
.select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--b2-space-4);
  text-align: left;
  cursor: pointer;
}
.select-btn .placeholder {
  color: var(--b2-muted);
}
.select-btn .chevron {
  flex-shrink: 0;
  color: var(--b2-muted);
  transition: rotate var(--b2-dur-micro) var(--b2-ease-out);
}
.select-btn[aria-expanded='true'] .chevron {
  rotate: 180deg;
}
.select-list {
  max-height: 260px;
}
.select-list.up {
  top: auto;
  bottom: calc(100% + 6px);
}
/* rich-text toolbar variant: borderless, hugs its text */
.select.compact .select-btn {
  width: auto;
  height: var(--b2-control-height-sm);
  gap: var(--b2-space-2);
  padding: 0 var(--b2-space-2);
  border-color: transparent;
  background: transparent;
  font-size: var(--b2-font-size-sm);
  font-weight: var(--b2-font-weight-semibold);
}
.select.compact .select-btn:hover:not(:disabled) {
  border-color: transparent;
  background: var(--b2-bg-sunken);
}
.select.compact .select-list {
  right: auto;
  min-width: 160px;
}

a:focus-visible {
  outline: none;
  box-shadow: var(--b2-focus-ring);
}
/* layout */
.shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
.nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 16px;
  background: var(--b2-white);
  border-right: 1px solid var(--b2-line);
}
.nav-logo {
  display: block;
  width: 120px; /* brand minimum for the wordmark on screen */
  margin: 0 8px 24px;
}
/* b2-sidenav inside the panel's own sticky column; parent links stay marked on their child pages */
.nav .b2-sidenav {
  width: auto;
  padding: 0;
  background: none;
}
.nav .b2-sidenav a.router-link-exact-active,
.nav .b2-sidenav a.router-link-active:not([href='/']) {
  background: var(--b2-brand-subtle);
  color: var(--b2-brand-subtle-text);
}
.nav .b2-sidenav .b2-badge {
  margin-left: auto;
}
.nav-scroll {
  flex: 1;
  min-height: 0; /* lets the flex child shrink so only the links scroll; logo and footer stay put */
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.nav-foot {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  padding: 0 8px;
}
.main {
  padding: 40px 48px;
}
.mobile-bar,
.nav-backdrop {
  display: none;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  margin: -40px -48px 24px;
  padding: 8px 48px;
  background: var(--b2-offwhite);
  border-bottom: 1px solid var(--b2-line);
}
.topbar:not(:has(#topbar-left > *, #topbar-actions > *)) {
  display: none;
}
.topbar h1 {
  margin: 0;
  white-space: nowrap;
  font-size: 20px;
}
.topbar .back {
  margin: 0;
  white-space: nowrap;
}
.topbar .row {
  justify-content: flex-start;
}
/* looks like the brand's b2-segmented, but buttons with aria-pressed (each carries a missing-translation badge) */
.locale-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--b2-radius-md);
  background: var(--b2-bg-sunken);
}
.locale-switch button {
  display: inline-flex;
  align-items: center;
  gap: var(--b2-space-2);
  height: calc(var(--b2-control-height-md) - 4px);
  padding: 0 var(--b2-space-4);
  border: 0;
  border-radius: var(--b2-radius-sm);
  background: transparent;
  color: var(--b2-text-secondary);
  font: var(--b2-font-weight-medium) var(--b2-font-size-sm)/1 var(--b2-font-body);
  cursor: pointer;
}
.locale-switch button:hover {
  color: var(--b2-text-primary);
}
.locale-switch button:focus-visible {
  outline: none;
  box-shadow: var(--b2-focus-ring);
}
.locale-switch button[aria-pressed='true'] {
  background: var(--b2-bg-surface);
  color: var(--b2-text-primary);
  box-shadow: var(--b2-shadow-sm);
}
.reference {
  padding-left: 8px;
  border-left: 3px solid var(--b2-peach);
}
.publish {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
}
.b2-card.fields {
  max-width: 1040px;
}
.b2-card.fields,
.items {
  margin-inline: auto; /* capped at 1040px: centred rather than hugging the sidebar */
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.fields .b2-field {
  display: grid;
  gap: 6px;
  align-content: start;
}
.b2-field.wide,
.fields > .row {
  grid-column: 1 / -1;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: var(--b2-space-1);
  margin-bottom: 8px;
  font-size: 14px;
}

/* lists */
.items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  max-width: 1040px;
}
.items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--b2-white);
  border-radius: var(--b2-radius-lg);
  font-weight: 600;
  transition: box-shadow var(--b2-dur-micro) var(--b2-ease-out);
}
.items li:hover {
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.07);
}
.sub {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1.5px solid var(--b2-line);
  border-radius: var(--b2-radius-sm);
}

/* login */
.login {
  max-width: 380px;
  margin: 12vh auto;
  display: grid;
  gap: var(--b2-space-3);
  padding: var(--b2-space-10) var(--b2-space-8);
}
.login img {
  width: 140px;
  margin-bottom: 8px;
}
.login h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.page-spinner {
  display: block;
  width: 28px;
  height: 28px;
  margin: var(--b2-space-12) auto;
  color: var(--b2-brand-fill);
}

/* media fields */
.stack {
  display: grid;
  gap: var(--b2-space-3);
  justify-items: start;
}
.media-preview {
  max-width: min(360px, 100%);
  border-radius: var(--b2-radius-md);
}
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--b2-space-2);
}
.thumb {
  display: grid;
  justify-items: center;
  gap: var(--b2-space-1);
  width: 120px;
  margin: 0;
}
.thumb img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--b2-radius-md);
}
.thumb.dropped img {
  opacity: 0.35;
}
.thumb.added img {
  outline: 2px dashed var(--b2-brand-fill);
  outline-offset: -2px;
}

@media (max-width: 1100px) {
  .ov-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ov-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    display: block; /* a grid row would stretch the top bar and stop it from sticking */
  }
  /* sidebar becomes a drawer, opened from the bar at the top */
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 16px;
    background: var(--b2-white);
    border-bottom: 1px solid var(--b2-line);
  }
  .mobile-bar .nav-logo {
    margin: 0;
  }
  .nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(280px, 85vw);
    height: 100dvh;
    translate: -100% 0;
    visibility: hidden;
    transition: translate 300ms var(--b2-ease-out), visibility 0s 300ms;
  }
  .nav.open {
    translate: 0 0;
    visibility: visible;
    transition: translate 300ms var(--b2-ease-out);
  }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(26, 26, 26, 0.4);
  }
  .main {
    padding: 24px 16px;
  }
  .topbar {
    top: 56px;
    margin: -24px -16px 16px;
    padding: 8px 16px;
  }
  .topbar,
  .topbar .row {
    gap: 10px;
  }
  .topbar #topbar-left {
    min-width: 0;
  }
  .topbar #topbar-actions {
    flex-shrink: 0;
  }
  /* no room for back link + title + language + publish + Kaydet: keep the arrow (text stays for screen readers) and drop the title */
  .topbar #topbar-left:has(.back) h1 {
    display: none;
  }
  .topbar .back-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .topbar,
  .topbar .row {
    gap: 8px;
  }
  .locale-switch button {
    padding: 0 var(--b2-space-3);
  }
  .b2-card {
    padding: var(--b2-space-5);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
