/* biticaret Design System components. GENERATED by scripts/build-components.mjs. Do not edit. */

/* shared/base.css: the color scheme per theme, box-sizing and the body font inside every bt- element. */

/* Native controls (date and number fields, scrollbars, checkmarks) follow the theme. With no data-theme
   the page follows the OS: tokens.css switches to dark under prefers-color-scheme: dark with
   `:root:not([data-theme="light"])` (it sets color-scheme there too, and its higher specificity wins over
   the plain `:root` here). Dark comes last: on <html data-theme="dark"> both rules match with equal
   specificity. */
:root,
[data-theme="light"] {
  color-scheme: light;
}
[data-theme="dark"] {
  color-scheme: dark;
}

/* Zero specificity. */
:where([class^="bt-"], [class*=" bt-"]),
:where([class^="bt-"], [class*=" bt-"]) *,
:where([class^="bt-"], [class*=" bt-"]) *::before,
:where([class^="bt-"], [class*=" bt-"]) *::after {
  box-sizing: border-box;
}

:where([class^="bt-"], [class*=" bt-"]) {
  font-family: var(--bt-font-sans);
}

/* Hidden on screen, read by screen readers (labelHidden, Spinner labels, Text visuallyHidden). */
.bt-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* GENERATED by scripts/build-components.mjs from tokens.json type styles. Do not edit. */
/* The type scale: each style is a .bt-text-<name> utility and the Text variant .bt-Text--<variant>; sizes, line heights and weights are tokens. */
.bt-text-display,
.bt-Text--display { font-family: var(--bt-font-display); font-size: var(--bt-font-size-850); line-height: var(--bt-font-line-height-950); font-weight: var(--bt-font-weight-bold); letter-spacing: -0.025em; }
.bt-text-heading-3xl,
.bt-Text--heading3xl { font-family: var(--bt-font-display); font-size: var(--bt-font-size-650); line-height: var(--bt-font-line-height-800); font-weight: var(--bt-font-weight-bold); letter-spacing: -0.02em; }
.bt-text-heading-2xl,
.bt-Text--heading2xl { font-family: var(--bt-font-display); font-size: var(--bt-font-size-550); line-height: var(--bt-font-line-height-700); font-weight: var(--bt-font-weight-bold); letter-spacing: -0.015em; }
.bt-text-heading-xl,
.bt-Text--headingXl { font-family: var(--bt-font-display); font-size: var(--bt-font-size-500); line-height: var(--bt-font-line-height-700); font-weight: var(--bt-font-weight-bold); letter-spacing: -0.01em; }
.bt-text-heading-lg,
.bt-Text--headingLg { font-family: var(--bt-font-display); font-size: var(--bt-font-size-425); line-height: var(--bt-font-line-height-600); font-weight: var(--bt-font-weight-bold); letter-spacing: -0.005em; }
.bt-text-heading-md,
.bt-Text--headingMd { font-family: var(--bt-font-display); font-size: var(--bt-font-size-375); line-height: var(--bt-font-line-height-500); font-weight: var(--bt-font-weight-bold); }
.bt-text-heading-sm,
.bt-Text--headingSm { font-family: var(--bt-font-display); font-size: var(--bt-font-size-350); line-height: var(--bt-font-line-height-500); font-weight: var(--bt-font-weight-bold); }
.bt-text-heading-xs,
.bt-Text--headingXs { font-family: var(--bt-font-display); font-size: var(--bt-font-size-312); line-height: var(--bt-font-line-height-450); font-weight: var(--bt-font-weight-bold); }
.bt-text-body-lg,
.bt-Text--bodyLg { font-family: var(--bt-font-sans); font-size: var(--bt-font-size-375); line-height: var(--bt-font-line-height-600); font-weight: var(--bt-font-weight-regular); }
.bt-text-body-md,
.bt-Text--bodyMd { font-family: var(--bt-font-sans); font-size: var(--bt-font-size-350); line-height: var(--bt-font-line-height-500); font-weight: var(--bt-font-weight-regular); }
.bt-text-body-sm,
.bt-Text--bodySm { font-family: var(--bt-font-sans); font-size: var(--bt-font-size-312); line-height: var(--bt-font-line-height-450); font-weight: var(--bt-font-weight-regular); }
.bt-text-body-xs,
.bt-Text--bodyXs { font-family: var(--bt-font-sans); font-size: var(--bt-font-size-275); line-height: var(--bt-font-line-height-400); font-weight: var(--bt-font-weight-regular); }
.bt-text-body-md-strong { font-family: var(--bt-font-sans); font-size: var(--bt-font-size-350); line-height: var(--bt-font-line-height-500); font-weight: var(--bt-font-weight-semibold); }
.bt-text-label-md,
.bt-Text--labelMd { font-family: var(--bt-font-sans); font-size: var(--bt-font-size-337); line-height: var(--bt-font-line-height-500); font-weight: var(--bt-font-weight-semibold); }
.bt-text-label-sm,
.bt-Text--labelSm { font-family: var(--bt-font-sans); font-size: var(--bt-font-size-300); line-height: var(--bt-font-line-height-400); font-weight: var(--bt-font-weight-semibold); }
.bt-text-overline,
.bt-Text--overline { font-family: var(--bt-font-sans); font-size: var(--bt-font-size-275); line-height: var(--bt-font-line-height-400); font-weight: var(--bt-font-weight-semibold); letter-spacing: 0.08em; text-transform: uppercase; }
.bt-text-code-md,
.bt-Text--codeMd { font-family: var(--bt-font-mono); font-size: var(--bt-font-size-325); line-height: var(--bt-font-line-height-500); font-weight: var(--bt-font-weight-regular); }
.bt-text-code-sm,
.bt-Text--codeSm { font-family: var(--bt-font-mono); font-size: var(--bt-font-size-300); line-height: var(--bt-font-line-height-400); font-weight: var(--bt-font-weight-regular); }

/* shared/elements.css: the looks only a bt-* element draws, with no React component behind them: FileField, FieldGrid
   and Disclosure. ProgressBar and the rest share their React component's CSS. */

/* FileField: a real file input, transparent, over a drawn button and the chosen names. */
.bt-FileField {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  min-width: 0;
  min-height: var(--bt-size-control-md);
}
.bt-FileField__Input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.bt-FileField__Input:disabled { cursor: default; }
.bt-FileField__Button { flex: none; }
.bt-FileField__Name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--bt-text-secondary);
  /* body-md: type sizes are not var() tokens */
  font-size: 14px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-FileField__Input:hover + .bt-FileField__Button { background: var(--bt-btn-bg-hover); border-color: var(--bt-btn-border-hover); }
.bt-FileField__Input:focus-visible + .bt-FileField__Button { box-shadow: var(--bt-shadow-focus); }
.bt-FileField--error .bt-FileField__Button { --bt-btn-border: var(--bt-border-critical); --bt-btn-border-hover: var(--bt-border-critical); }
/* By the input's state, so a <fieldset disabled> around the field counts too. */
.bt-FileField__Input:disabled + .bt-FileField__Button,
.bt-FileField__Input:disabled:hover + .bt-FileField__Button {
  background: var(--bt-fill-disabled);
  border-color: transparent;
  color: var(--bt-text-disabled);
}
.bt-FileField__Input:disabled ~ .bt-FileField__Name { color: var(--bt-text-disabled); }

/* FieldGrid: as many columns as fit the minimum (never wider than the grid). The minimum comes in as a custom
   property; phones stack whatever it is. 480px is breakpoint-sm: media queries cannot read var(). */
.bt-FieldGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(var(--bt-FieldGrid-min, 12rem), 100%), 1fr));
  gap: var(--bt-space-300);
  align-items: start;
  min-width: 0;
}
.bt-FieldGrid > * { min-width: 0; }
/* One field takes one column, not the whole row: empty tracks are kept (auto-fill) instead of collapsed. */
.bt-FieldGrid:has(> :only-child) { grid-template-columns: repeat(auto-fill, minmax(min(var(--bt-FieldGrid-min, 12rem), 100%), 1fr)); }
@media (max-width: 479.98px) {
  .bt-FieldGrid { grid-template-columns: minmax(0, 1fr); }
}

/* Disclosure: a native <details>; the chevron replaces the marker and turns when open. */
.bt-Disclosure { min-width: 0; color: var(--bt-text); }
.bt-Disclosure__Summary {
  display: flex;
  align-items: center;
  gap: var(--bt-space-100);
  width: fit-content;
  max-width: 100%;
  border-radius: var(--bt-radius-100);
  cursor: pointer;
  list-style: none;
}
.bt-Disclosure__Summary::-webkit-details-marker { display: none; }
.bt-Disclosure__Summary:focus { outline: none; }
.bt-Disclosure__Summary:focus-visible { box-shadow: var(--bt-shadow-focus); }
.bt-Disclosure__Icon {
  display: inline-flex;
  flex: none;
  color: var(--bt-text-secondary);
  transition: transform var(--bt-duration-fast) var(--bt-ease-standard);
}
[dir="rtl"] .bt-Disclosure__Icon { transform: scaleX(-1); }
.bt-Disclosure[open] > .bt-Disclosure__Summary .bt-Disclosure__Icon { transform: rotate(90deg); }
.bt-Disclosure__Content { padding-block-start: var(--bt-space-200); }

@media (prefers-reduced-motion: reduce) {
  .bt-Disclosure__Icon { transition: none; }
}

@media (forced-colors: active) {
  .bt-FileField__Input:focus-visible + .bt-FileField__Button,
  .bt-Disclosure__Summary:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* bt-date-field's calendar: under the field's end, in the layer look of Popover (bg-surface, a border hairline,
   radius-350, shadow-soft-lg), the DatePicker's own markup inside. The element draws it in the page, no portal:
   an app page's iframe grows to fit. */
.bt-TextField__Connected > .bt-DateField__Popup {
  position: absolute;
  inset-block-start: calc(100% + var(--bt-space-100));
  inset-inline-end: 0;
  z-index: 20; /* over later fields; no overlay token family */
  padding: var(--bt-space-300);
  background: var(--bt-bg-surface);
  border: var(--bt-border-width-1) solid var(--bt-border-secondary);
  border-radius: var(--bt-radius-350);
  box-shadow: var(--bt-shadow-soft-lg);
}

/* Tabs: a <bt-tab> is the panel's content as the page wrote it (the element draws the tab and the panel around it). */
bt-tab { display: block; }

/* shared/motion.css: the CSS half of the motion helpers (motion/motion.tsx). A changed number flashes the color
   of its direction (or the brand color) and settles back over duration-roll. During themeReveal the page's own
   cross-fade is off, so only the circle shows the new theme; other view transitions keep theirs. */
.bt-motion-tickUp { animation: bt-motion-tickUp var(--bt-duration-roll) var(--bt-ease-standard); }
.bt-motion-tickDown { animation: bt-motion-tickDown var(--bt-duration-roll) var(--bt-ease-standard); }
.bt-motion-flash { animation: bt-motion-flash var(--bt-duration-fill) var(--bt-ease-standard); }
@keyframes bt-motion-tickUp { from { color: var(--bt-text-success); } }
@keyframes bt-motion-tickDown { from { color: var(--bt-text-critical); } }
@keyframes bt-motion-flash { from { color: var(--bt-text-brand); } }

:root[data-bt-theme-reveal]::view-transition-old(root),
:root[data-bt-theme-reveal]::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

@media (prefers-reduced-motion: reduce) {
  .bt-motion-tickUp,
  .bt-motion-tickDown,
  .bt-motion-flash { animation: none; }
}

/* shared/page.css: the opt-in page base. Nothing here applies until a page puts class="bt-base" on <body>
   (or on an app's root): the kit never restyles a host page by itself. It sets the page ground and the
   panel's body text (body-md: Urbanist 14/20) in the theme's colors, with grayscale smoothing on macOS.
   A storefront adds bt-base--large for body-lg (16/24). */
.bt-base {
  margin: 0;
  background: var(--bt-bg);
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.bt-base--large {
  font-size: var(--bt-font-size-400);
  line-height: var(--bt-font-line-height-600);
}

/* shared/plain.css: what a page drawn on the server needs and no component class gives it without React or a script:
   their spacing comes from inline custom properties, or their content from a script. The recipe in the package README
   ("Server-drawn pages, without JavaScript") names each class; scripts/test-package.mjs fails when one is missing. */

/* Spacing between blocks; bt-BlockStack reads its gap from an inline property. */
.bt-PlainStack {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-400);
  min-width: 0;
}
.bt-PlainStack--tight { gap: var(--bt-space-200); }

/* With bt-Card: the padding bt-Card reads from inline properties. */
.bt-PlainCard {
  --bt-Card-padding-xs: var(--bt-space-400);
  --bt-Card-padding-sm: var(--bt-space-400);
  --bt-Card-padding-md: var(--bt-space-400);
  --bt-Card-padding-lg: var(--bt-space-400);
  --bt-Card-padding-xl: var(--bt-space-400);
}

.bt-PlainButtonRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-200);
}

.bt-PlainFieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.bt-PlainFieldset__Legend {
  margin-block-end: var(--bt-space-200);
  padding: 0;
  color: var(--bt-text);
  /* label-md: type sizes are not var() tokens */
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

/* With bt-Select: the box's look around a native select that shows its own choice (no script, no list layer),
   and the arrow is drawn on the wrapper (no image for a strict CSP to block). */
.bt-PlainSelect::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: var(--bt-space-300);
  width: var(--bt-space-200);
  height: var(--bt-space-200);
  margin-block-start: calc(var(--bt-space-150) * -1);
  border-block-end: var(--bt-border-width-2) solid var(--bt-text-secondary);
  border-inline-end: var(--bt-border-width-2) solid var(--bt-text-secondary);
  transform: rotate(45deg);
  pointer-events: none;
}
.bt-PlainSelect__Input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: var(--bt-space-200) var(--bt-space-800) var(--bt-space-200) var(--bt-space-300);
  border: 0;
  outline: none; /* the box shows focus (:focus-within on bt-Select) */
  background: transparent;
  color: inherit;
  font-family: inherit;
  /* body-md: type sizes are not var() tokens */
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  appearance: none;
}
.bt-PlainSelect__Input:disabled { cursor: default; }
.bt-PlainSelect__Input option,
.bt-PlainSelect__Input optgroup { background: var(--bt-bg-surface-raised); color: var(--bt-text); }
.bt-Select--large .bt-PlainSelect__Input { padding-inline-start: var(--bt-space-400); font-size: 16px; line-height: 24px; }
/* Phones: 16px (body-lg) so iOS Safari does not zoom; 768px is breakpoint-md. */
@media (max-width: 767.98px) {
  .bt-PlainSelect__Input { font-size: 16px; line-height: 24px; }
}

/* A read-only field with its copy button; the button wraps under the field when there is no room. */
.bt-PlainCopy {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--bt-space-200);
}
.bt-PlainCopy > .bt-TextField { flex: 1 1 12rem; min-width: 0; }
/* bt-Button's display would otherwise beat the browser's rule for `hidden`. */
.bt-PlainCopy__Button[hidden] { display: none; }

/* A numbered or bulleted list, for an <ol> or <ul> carrying a bt-Text class. */
.bt-PlainList {
  margin: 0;
  padding-inline-start: var(--bt-space-500);
}
.bt-PlainList > li + li { margin-top: var(--bt-space-100); }

/* shared/scroll-fade.css: the hint that a sideways-scrolling row (Tabs, the Filters pills on a phone) holds more
   past an edge. The row is `bt-ScrollFade`; useScrollEdges adds `--start` / `--end` while that end hides content,
   and the content fades out over the last 48px there. A row that fits gets no mask; nothing animates, so reduced
   motion needs no rule. */
.bt-ScrollFade {
  --bt-scroll-fade: var(--bt-space-1200);
  --bt-scroll-fade-start: 0px;
  --bt-scroll-fade-end: 0px;
}
.bt-ScrollFade--start { --bt-scroll-fade-start: var(--bt-scroll-fade); }
.bt-ScrollFade--end { --bt-scroll-fade-end: var(--bt-scroll-fade); }
.bt-ScrollFade--start,
.bt-ScrollFade--end {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--bt-scroll-fade-start), #000 calc(100% - var(--bt-scroll-fade-end)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--bt-scroll-fade-start), #000 calc(100% - var(--bt-scroll-fade-end)), transparent);
}
[dir='rtl'] .bt-ScrollFade--start,
[dir='rtl'] .bt-ScrollFade--end {
  -webkit-mask-image: linear-gradient(to left, transparent, #000 var(--bt-scroll-fade-start), #000 calc(100% - var(--bt-scroll-fade-end)), transparent);
  mask-image: linear-gradient(to left, transparent, #000 var(--bt-scroll-fade-start), #000 calc(100% - var(--bt-scroll-fade-end)), transparent);
}

/* Shared chart parts (shared/chart): the table view (ChartTable) and the readout card (bt-ChartReadout). */
.bt-ChartTable { font-family: var(--bt-font-sans); color: var(--bt-viz-label); }

.bt-ChartTable__toggle {
  display: inline-flex;
  align-items: center;
  min-height: var(--bt-size-touch-min);
  cursor: pointer;
  /* label-sm (13/18, 600): type sizes exist only as text styles, not var() tokens. */
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: var(--bt-viz-label);
  border-radius: var(--bt-radius-100);
}
.bt-ChartTable__toggle:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }

.bt-ChartTable__table {
  margin-top: var(--bt-space-200);
  border-collapse: collapse;
  /* body-sm (13/18). */
  font-size: 13px;
  line-height: 18px;
  color: var(--bt-viz-label);
}
.bt-ChartTable__table caption { text-align: start; font-weight: 600; padding-bottom: var(--bt-space-100); }
.bt-ChartTable__table th,
.bt-ChartTable__table td {
  padding: var(--bt-space-100) var(--bt-space-300);
  border-bottom: 1px solid var(--bt-viz-grid);
  text-align: end;
  white-space: nowrap;
}
.bt-ChartTable__table th[scope="row"],
.bt-ChartTable__table thead th:first-child { text-align: start; font-weight: 400; }
.bt-ChartTable__table thead th { font-weight: 600; color: var(--bt-viz-label-muted); }
.bt-ChartTable__table td { font-variant-numeric: tabular-nums; }

/* The hover / focus readout, the template's chart tip: an inverse card (ink in light, near-white in dark), value
   strong, label small and dimmed. bg-inverse / text-inverse instead of the raised viz-tooltip tokens: the tip is the
   template's one dark-on-light accent in a chart. */
.bt-ChartReadout {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: var(--bt-space-150) var(--bt-space-200);
  background: var(--bt-bg-inverse);
  color: var(--bt-text-inverse);
  border-radius: var(--bt-radius-250);
  box-shadow: var(--bt-shadow-soft);
  font-family: var(--bt-font-sans);
  white-space: nowrap;
}
.bt-ChartReadout__value {
  font-size: var(--bt-font-size-337);
  line-height: 1.3;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bt-ChartReadout__label {
  font-size: var(--bt-font-size-275);
  line-height: 1.4;
  font-weight: 600;
  color: var(--bt-text-inverse-secondary);
}

/* Several series: a row each, key, name and value aligned at the end. */
.bt-ChartReadout--rows { gap: 2px; }
.bt-ChartReadout__row { display: flex; align-items: center; gap: var(--bt-space-150); }
.bt-ChartReadout__row .bt-ChartReadout__value { margin-inline-start: auto; padding-inline-start: var(--bt-space-300); }
.bt-ChartReadout__row--total { border-top: 1px solid color-mix(in oklab, var(--bt-text-inverse) 24%, transparent); padding-top: 2px; margin-top: 2px; }
.bt-ChartReadout__name { font-size: var(--bt-font-size-312); font-weight: 500; }
.bt-ChartReadout__key { flex: none; width: 12px; border-block-start: 2.5px solid currentColor; border-radius: 2px; }
.bt-ChartReadout__key--dashed { border-block-start-style: dashed; }
.bt-ChartReadout__key--swatch { width: 8px; height: 8px; border: 0; border-radius: var(--bt-radius-full); background: currentColor; outline: 1px solid color-mix(in oklab, var(--bt-text-inverse) 35%, transparent); }

@media (forced-colors: active) {
  .bt-ChartReadout { border: 1px solid CanvasText; }
  .bt-ChartReadout__key { color: CanvasText !important; }
}

/* --- Accordion --- */
/* Accordion: a stack of Collapsible.Item tiles (their look and spacing come from Collapsible.css). */
.bt-Accordion { display: flex; flex-direction: column; min-width: 0; }

/* --- ActionList --- */
/* ActionList: a menu, usually inside a Popover (the menu look of the template). Items are size-menu-row (38px) rows
   (radius-250, 13.5px semibold) on the surrounding surface: bg-surface-secondary on hover and keyboard focus,
   bg-surface-active while pressed, bg-surface-selected with text-brand for the active item. Destructive items
   use the critical roles, never the brand garnet. Sections: a hairline (border-secondary) and a small
   uppercase title. */
.bt-ActionList { padding: var(--bt-space-150); color: var(--bt-text); }
.bt-ActionList:focus { outline: none; }

.bt-ActionList__Section + .bt-ActionList__Section {
  margin-top: var(--bt-space-150);
  padding-top: var(--bt-space-150);
  border-top: var(--bt-border-width-1) solid var(--bt-border-secondary);
}
/* The template's 11px uppercase menu label; the bt-text-label-sm class is overridden here. */
.bt-ActionList .bt-ActionList__Title {
  margin: 0;
  padding: var(--bt-space-200) calc(var(--bt-space-200) + var(--bt-space-050)) var(--bt-space-100);
  font: var(--bt-font-weight-bold) var(--bt-font-size-275) / var(--bt-font-line-height-400) var(--bt-font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bt-text-secondary);
}
.bt-ActionList__Title--withMetadata { display: flex; align-items: center; gap: var(--bt-space-200); }
.bt-ActionList__TitleMetadata { display: inline-flex; flex: none; align-items: center; gap: var(--bt-space-100); }
.bt-ActionList__Items { margin: 0; padding: 0; list-style: none; }
.bt-ActionList__ListItem { margin: 0; padding: 0; }

.bt-ActionList__Item {
  display: flex;
  align-items: center;
  gap: calc(var(--bt-space-200) + var(--bt-space-050));
  width: 100%;
  min-height: var(--bt-size-menu-row);
  margin: 0;
  padding: var(--bt-space-150) calc(var(--bt-space-200) + var(--bt-space-050));
  border: 0;
  border-radius: var(--bt-radius-250);
  background: transparent;
  color: var(--bt-text);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-ActionList__Item .bt-ActionList__Content {
  font: var(--bt-font-weight-semibold) var(--bt-font-size-337) / var(--bt-font-line-height-500) var(--bt-font-sans);
}
.bt-ActionList__Item .bt-ActionList__HelpText {
  font: var(--bt-font-weight-medium) var(--bt-font-size-312) / var(--bt-font-line-height-450) var(--bt-font-sans);
}
.bt-ActionList__Item:hover { background: var(--bt-bg-surface-secondary); }
.bt-ActionList__Item:active { background: var(--bt-bg-surface-active); }
.bt-ActionList__Item:focus { outline: none; }
.bt-ActionList__Item:focus-visible { background: var(--bt-bg-surface-secondary); box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-focus); }

.bt-ActionList__Item--active,
.bt-ActionList__Item--active:hover { background: var(--bt-bg-surface-selected); color: var(--bt-text-brand); }
.bt-ActionList__Item--active .bt-ActionList__Prefix { color: var(--bt-text-brand); }

.bt-ActionList__Item--destructive { color: var(--bt-text-critical); }
.bt-ActionList__Item--destructive:hover,
.bt-ActionList__Item--destructive:focus-visible { background: var(--bt-bg-critical-subtle); }
.bt-ActionList__Item--destructive:focus-visible { box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-critical); }
.bt-ActionList__Item--destructive:active { background: var(--bt-bg-critical-subtle); }

.bt-ActionList__Item--disabled,
.bt-ActionList__Item--disabled:hover,
.bt-ActionList__Item--disabled:active { color: var(--bt-text-disabled); background: transparent; cursor: default; }
.bt-ActionList__Item--disabled:focus-visible { background: transparent; }

.bt-ActionList__Prefix {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  color: var(--bt-text-secondary);
}
.bt-ActionList__Item--destructive .bt-ActionList__Prefix,
.bt-ActionList__Item--disabled .bt-ActionList__Prefix { color: inherit; }
.bt-ActionList__Prefix img {
  display: block;
  width: var(--bt-space-500);
  height: var(--bt-space-500);
  border-radius: var(--bt-radius-100);
  object-fit: cover;
}

.bt-ActionList__Text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.bt-ActionList__Label { display: flex; align-items: center; gap: var(--bt-space-200); min-width: 0; }
.bt-ActionList__Content { min-width: 0; overflow-wrap: anywhere; }
.bt-ActionList__Item--truncate .bt-ActionList__Content { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bt-ActionList__Badge { display: inline-flex; flex: none; }
.bt-ActionList__HelpText { color: var(--bt-text-secondary); }
.bt-ActionList__Item--destructive .bt-ActionList__HelpText,
.bt-ActionList__Item--disabled .bt-ActionList__HelpText { color: inherit; }
.bt-ActionList__Suffix { display: inline-flex; flex: none; align-items: center; margin-inline-start: auto; color: var(--bt-text-secondary); }
.bt-ActionList__Item--destructive .bt-ActionList__Suffix,
.bt-ActionList__Item--disabled .bt-ActionList__Suffix { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .bt-ActionList__Item { transition: none; }
}

@media (forced-colors: active) {
  .bt-ActionList__Item:focus-visible { outline: 2px solid Highlight; outline-offset: -2px; }
  .bt-ActionList__Item--active { outline: 1px solid CanvasText; outline-offset: -1px; }
}

/* --- ActionMenu --- */
/* ActionMenu: the Popover and ActionList carry the look; only the optional footer note is styled here. */
.bt-ActionMenu__Footer {
  padding: var(--bt-space-200) var(--bt-space-300) var(--bt-space-300);
  border-top: var(--bt-border-width-1) solid var(--bt-border-secondary);
  color: var(--bt-text-secondary);
}

/* --- AddressBlock --- */
/* A postal address as lines (name, company, street, "postcode district / city", country, phone), with an optional
   heading row (a headingXs title and a plain action) and identity/tax pairs under it. Body text, 4px between lines;
   no surface of its own: put it in a Card or a Card.Tile. */
.bt-AddressBlock {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
  min-width: 0;
}
.bt-AddressBlock__address {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-100);
  margin: 0;
  font-style: normal;
}

/* --- AddressForm --- */
/* AddressForm: the parts stacked space-400 apart; il / ilçe (or region / city) and postcode / phone share a row each,
   two columns from 25rem (400px; a container query can't read a token), one below, so the form folds in a narrow card
   as on a phone. */
.bt-AddressForm { display: flex; flex-direction: column; gap: var(--bt-space-400); container-type: inline-size; min-width: 0; }
.bt-AddressForm__Row { display: grid; grid-template-columns: 1fr; gap: var(--bt-space-400); }
.bt-AddressForm__Row:empty { display: none; }
@container (min-width: 25rem) {
  .bt-AddressForm__Row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-AddressForm__Row > :only-child { grid-column: 1 / -1; }
}

/* --- AuthLayout --- */
/* AuthLayout: the template's sign-in screen. A whole page on bg, the logo over one card centred in the free
   height (bg-surface, radius-650, a border hairline ring and shadow-soft-lg, as a dialog), a help line and the
   footer. It follows the theme of the nearest data-theme, like the rest of the kit. */
.bt-AuthLayout {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--bt-space-600) var(--bt-space-400);
  gap: var(--bt-space-600);
  background: var(--bt-bg);
  color: var(--bt-text);
}
@media (min-width: 768px) {
  /* breakpoint-md (768px): media queries cannot read var(). */
  .bt-AuthLayout { padding: var(--bt-space-1000) var(--bt-space-600) var(--bt-space-600); gap: var(--bt-space-800); }
}

.bt-AuthLayout__header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--bt-space-300);
}

.bt-AuthLayout__logo {
  display: inline-flex;
  color: var(--bt-text);
  text-decoration: none;
  border-radius: var(--bt-radius-200);
}
.bt-AuthLayout__logo--link:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-AuthLayout__logoImage { display: block; height: auto; }

/* The lockup rule (README, Logo): the b's bowl spans the wordmark's x-height, its bottom on the text baseline.
   Everything is in em of the wordmark (22px x 4/3, no type token is that size). Urbanist 700's x-height is 0.5em
   and the bowl is 120/302 of the mark, so the mark is 0.5 x 302/120 = 1.2583em tall; the bag's foot hangs
   44.5/302 of it (0.1854em) below the baseline, set with vertical-align, not by centring; the gap is 0.3 x the
   mark's height (0.3775em). No whitespace between the two, so no space character widens the gap. */
.bt-AuthLayout__lockup {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--bt-font-display);
  font-weight: var(--bt-font-weight-bold);
  font-size: calc(22px * 4 / 3);
  line-height: 1;
}
.bt-AuthLayout__mark {
  display: inline-block;
  block-size: 1.2583em;
  inline-size: auto;
  aspect-ratio: 260 / 302;
  margin-inline-end: 0.3775em;
  vertical-align: -0.1854em;
  color: var(--bt-fill-brand);
  overflow: visible;
}
.bt-AuthLayout__wordmark {
  letter-spacing: -0.035em;
  color: var(--bt-text);
}
.bt-AuthLayout__context { display: inline-flex; }

.bt-AuthLayout__main {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: var(--bt-space-400);
  width: 100%;
  /* size-auth-card (420px): the sign-in card's width. */
  max-width: var(--bt-size-auth-card);
}

.bt-AuthLayout__card {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-500);
  padding: var(--bt-space-600) var(--bt-space-500) var(--bt-space-500);
  background: var(--bt-bg-surface);
  border-radius: var(--bt-radius-650);
  box-shadow: var(--bt-shadow-soft-lg), inset 0 0 0 var(--bt-border-width-1) var(--bt-border);
}
@media (min-width: 768px) {
  .bt-AuthLayout__card { padding: var(--bt-space-800) var(--bt-space-600) var(--bt-space-600); }
}

.bt-AuthLayout__heading {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-100);
}
/* The sign-in title: 30px (font-size-750) semibold. */
.bt-AuthLayout__title {
  margin: 0;
  font-family: var(--bt-font-display);
  font-size: var(--bt-font-size-750);
  line-height: var(--bt-font-line-height-850);
  font-weight: var(--bt-font-weight-semibold);
  letter-spacing: -0.025em;
  color: var(--bt-text);
}
.bt-AuthLayout__subtitle {
  margin: 0;
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  color: var(--bt-text-secondary);
}

.bt-AuthLayout__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bt-space-200);
  width: 100%;
  max-width: var(--bt-size-layout-primary);
}
.bt-AuthLayout__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--bt-space-200) var(--bt-space-500);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--bt-text-secondary);
}

/* --- Avatar --- */
/* Avatar: a circle with an image, bold initials on one of the six pastel tiles, or the user icon. */
.bt-Avatar {
  --bt-avatar-size: var(--bt-size-control-sm);
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: var(--bt-avatar-size);
  height: var(--bt-avatar-size);
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-tile-1);
  color: var(--bt-text-on-tile);
  font-size: var(--bt-font-size-300);
  font-weight: var(--bt-font-weight-bold);
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}

/* Sizes from the size tokens; the initials follow the type scale. xl (72px) has no token: control-lg x 1.5. */
.bt-Avatar--sizeXs { --bt-avatar-size: var(--bt-size-icon-md); font-size: 8px; /* below the type scale: two letters in 20px */ }
.bt-Avatar--sizeSm { --bt-avatar-size: var(--bt-size-icon-lg); font-size: 9.5px; /* below the type scale: two letters in 24px */ }
.bt-Avatar--sizeMd { --bt-avatar-size: var(--bt-size-control-sm); font-size: var(--bt-font-size-300); }
.bt-Avatar--sizeLg { --bt-avatar-size: var(--bt-size-control-lg); font-size: var(--bt-font-size-375); }
.bt-Avatar--sizeXl { --bt-avatar-size: calc(var(--bt-size-control-lg) * 1.5); font-size: var(--bt-font-size-550); }

.bt-Avatar__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bt-Avatar__initials { letter-spacing: 0.02em; }
.bt-Avatar__initials::before { content: attr(data-initials); }
.bt-Avatar__icon { width: 58%; height: 58%; }

/* Tiles: text-on-tile keeps 4.5:1 on each in both themes. */
.bt-Avatar--tile1 { background: var(--bt-bg-tile-1); }
.bt-Avatar--tile2 { background: var(--bt-bg-tile-2); }
.bt-Avatar--tile3 { background: var(--bt-bg-tile-3); }
.bt-Avatar--tile4 { background: var(--bt-bg-tile-4); }
.bt-Avatar--tile5 { background: var(--bt-bg-tile-5); }
.bt-Avatar--tile6 { background: var(--bt-bg-tile-6); }
/* Customer / no-name fallback: the user icon on the neutral tile. */
.bt-Avatar--icon { background: var(--bt-bg-surface-secondary); color: var(--bt-text-secondary); }
/* The "+N" circle of a stack. */
.bt-Avatar--more { background: var(--bt-bg-surface-active); color: var(--bt-text); letter-spacing: 0; }

/* AvatarStack: overlapping circles, each cut from the next by a 2px ring in the surface colour. */
.bt-AvatarStack {
  --bt-avatar-ring: var(--bt-bg-surface);
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.bt-AvatarStack__item { position: relative; display: inline-flex; border-radius: var(--bt-radius-full); box-shadow: 0 0 0 var(--bt-border-width-2) var(--bt-avatar-ring); }
.bt-AvatarStack__item + .bt-AvatarStack__item { margin-inline-start: calc(var(--bt-space-200) * -1); }
.bt-AvatarStack--sizeXs .bt-AvatarStack__item + .bt-AvatarStack__item { margin-inline-start: calc(var(--bt-space-100) * -1); }
.bt-AvatarStack--sizeSm .bt-AvatarStack__item + .bt-AvatarStack__item { margin-inline-start: calc(var(--bt-space-150) * -1); }
.bt-AvatarStack--sizeXs .bt-Avatar { --bt-avatar-size: var(--bt-size-icon-md); font-size: 8px; }
.bt-AvatarStack--sizeSm .bt-Avatar { --bt-avatar-size: var(--bt-size-icon-lg); font-size: 9.5px; }
.bt-AvatarStack--sizeMd .bt-Avatar { --bt-avatar-size: var(--bt-size-control-sm); font-size: var(--bt-font-size-300); }
.bt-AvatarStack--sizeLg .bt-Avatar { --bt-avatar-size: var(--bt-size-control-lg); font-size: var(--bt-font-size-375); }

@media (forced-colors: active) {
  .bt-Avatar { border: 1px solid CanvasText; }
}

/* --- Badge --- */
/* Badge: a status pill on a soft tint. Every tone is a documented text-on-bg pair (4.5:1 in both themes). */
.bt-Badge {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-150);
  max-width: 100%;
  min-height: var(--bt-space-600);
  padding: 0 var(--bt-space-300);
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface-hover);
  color: var(--bt-text);
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-400);
  font-weight: var(--bt-font-weight-semibold);
  white-space: nowrap;
  vertical-align: middle;
}
.bt-Badge--withMark { padding-inline-start: var(--bt-space-150); gap: var(--bt-space-100); }
.bt-Badge--withDot { padding-inline-start: var(--bt-space-200); }

/* small: the bold 11px tag of card headers. 20px high. */
.bt-Badge--sizeSmall {
  min-height: var(--bt-space-500);
  padding: 0 var(--bt-space-200);
  font-size: var(--bt-font-size-275);
  font-weight: var(--bt-font-weight-bold);
  gap: var(--bt-space-100);
}
.bt-Badge--sizeSmall.bt-Badge--withMark { padding-inline-start: var(--bt-space-100); }
/* large: size-chip (28px), 13.5px. */
.bt-Badge--sizeLarge {
  min-height: var(--bt-size-chip);
  padding: 0 var(--bt-space-300);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
}
.bt-Badge--sizeLarge.bt-Badge--withMark { padding-inline-start: var(--bt-space-200); }

.bt-Badge__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A status dot: 6px (space-150), currentColor, so it carries the tone's 3:1. */
.bt-Badge__dot {
  flex: none;
  width: var(--bt-space-150);
  height: var(--bt-space-150);
  border-radius: var(--bt-radius-full);
  background: currentColor;
}
.bt-Badge__mark {
  display: inline-flex;
  flex: none;
  width: var(--bt-size-icon-sm);
  height: var(--bt-size-icon-sm);
}
.bt-Badge__markSvg { display: block; width: 100%; height: 100%; }

/* Tones: soft tints with the status colour as text. Marks, dots and icons use currentColor. */
.bt-Badge--toneInfo { background: var(--bt-bg-info-subtle); color: var(--bt-text-info); }
.bt-Badge--toneSuccess { background: var(--bt-bg-success-subtle); color: var(--bt-text-success); }
.bt-Badge--toneWarning { background: var(--bt-bg-warning-subtle); color: var(--bt-text-warning); }
.bt-Badge--toneCritical { background: var(--bt-bg-critical-subtle); color: var(--bt-text-critical); }
/* attention: the amber warning pair. Never garnet: that is brand, link, focus and selection. The word ("Dikkat")
   tells it from warning. */
.bt-Badge--toneAttention { background: var(--bt-bg-warning-subtle); color: var(--bt-text-warning); }
/* new: the brand tint ("Yeni"), no dot. */
.bt-Badge--toneNew { background: var(--bt-bg-brand-subtle); color: var(--bt-text-brand); }
/* read-only: no fill, a hairline border; secondary text passes on every surface. */
.bt-Badge--toneReadOnly {
  background: transparent;
  color: var(--bt-text-secondary);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border);
}
/* enabled: no fill, success text and dot, a success hairline. */
.bt-Badge--toneEnabled {
  background: transparent;
  color: var(--bt-text-success);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-success);
}

/* CountBadge: a garnet circle (size-count-badge, 18px) with bold 11px figures; it grows into a pill for
   two or three digits. --bt-count-ring cuts it from what is under it (transparent by default). */
.bt-CountBadge {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: var(--bt-size-count-badge);
  height: var(--bt-size-count-badge);
  padding: 0 var(--bt-space-100);
  border-radius: var(--bt-radius-full);
  background: var(--bt-fill-brand);
  color: var(--bt-text-on-brand);
  box-shadow: 0 0 0 var(--bt-border-width-2) var(--bt-count-ring, transparent);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-275);
  line-height: 1;
  font-weight: var(--bt-font-weight-bold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  vertical-align: middle;
}
.bt-CountBadge--neutral { background: var(--bt-bg-surface-active); color: var(--bt-text); }

@media (forced-colors: active) {
  .bt-Badge,
  .bt-CountBadge { border: 1px solid CanvasText; }
}

/* --- Banner --- */
/* Banner: a status notice (the template's notice row). A soft tint (bg-<tone>-subtle), the tone's icon
   (text-<tone>) in a card-coloured chip, a 13.5px semibold title, the body in --text (4.5:1 on every subtle
   bg), actions at the end of the row (they wrap below when the row is narrow). No coloured side stripe. */
.bt-Banner {
  --bt-Banner-fg: var(--bt-text-info);
  --bt-Banner-bg: var(--bt-bg-info-subtle);
  display: flex;
  align-items: flex-start;
  gap: var(--bt-space-300);
  padding: var(--bt-space-300) var(--bt-space-400) var(--bt-space-300) var(--bt-space-300);
  border-radius: var(--bt-radius-500);
  background: var(--bt-Banner-bg);
  color: var(--bt-text);
  /* A soft hairline in the tone, so the subtle bg reads on bg as well as on bg-surface (decorative, the icon carries 3:1). */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bt-Banner-fg) 22%, transparent);
}
.bt-Banner--toneSuccess { --bt-Banner-fg: var(--bt-text-success); --bt-Banner-bg: var(--bt-bg-success-subtle); }
.bt-Banner--toneWarning { --bt-Banner-fg: var(--bt-text-warning); --bt-Banner-bg: var(--bt-bg-warning-subtle); }
.bt-Banner--toneCritical { --bt-Banner-fg: var(--bt-text-critical); --bt-Banner-bg: var(--bt-bg-critical-subtle); }

/* In a Card: an inner tile (radius-350, tighter padding), no hairline. */
.bt-Banner--withinCard {
  border-radius: var(--bt-radius-350);
  padding: var(--bt-space-200) var(--bt-space-300) var(--bt-space-200) var(--bt-space-200);
  box-shadow: none;
}

/* The icon chip: size-icon-chip (34px), radius-250. */
.bt-Banner__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--bt-size-icon-chip);
  height: var(--bt-size-icon-chip);
  border-radius: var(--bt-radius-250);
  background: var(--bt-bg-surface);
  color: var(--bt-Banner-fg);
}
.bt-Banner__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-200) var(--bt-space-300);
  /* centres a one-line notice on the icon chip */
  min-height: calc(var(--bt-space-800) + var(--bt-space-050));
}
.bt-Banner__text {
  flex: 1 1 16rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-050);
}
.bt-Banner .bt-Banner__title {
  margin: 0;
  font: var(--bt-font-weight-semibold) var(--bt-font-size-337) / var(--bt-font-line-height-500) var(--bt-font-sans);
  color: var(--bt-text);
  overflow-wrap: anywhere;
}
.bt-Banner .bt-Banner__content {
  font: var(--bt-font-weight-medium) var(--bt-font-size-312) / var(--bt-font-line-height-450) var(--bt-font-sans);
  color: var(--bt-text);
  overflow-wrap: anywhere;
}
/* Body only, no title: the message is the line, at the title's size. */
.bt-Banner--noTitle .bt-Banner__content { font-size: var(--bt-font-size-337); line-height: var(--bt-font-line-height-500); }
.bt-Banner__content p { margin: 0; }
.bt-Banner__actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-200);
}
.bt-Banner__dismiss {
  flex: none;
  align-self: center;
  margin-inline-end: calc(-1 * var(--bt-space-200));
}
.bt-Banner__dismiss .bt-Button { border-radius: var(--bt-radius-full); }

@media (forced-colors: active) {
  .bt-Banner { border: 1px solid CanvasText; }
}

/* --- BarChart --- */
/* BarChart: the template's capsule bars. A dashed pill track per period, the series as full-round capsules stacked from
   the base (series color set inline), a viz-surface marker at each segment's top, a dashed grid with the zero line
   solid, 11px labels in viz-label-muted. The highlighted bar wears a brand ring and its label an inverse chip; the
   active bar (hover, focus) an ink ring. */
.bt-BarChart {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
  width: 100%;
  min-width: 0;
  font-family: var(--bt-font-sans);
}
.bt-BarChart .bt-Legend { align-self: flex-end; }

.bt-BarChart__plot {
  position: relative;
  width: 100%;
  border-radius: var(--bt-radius-250);
  cursor: pointer;
  touch-action: pan-y;
}
.bt-BarChart__plot:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }

.bt-BarChart__svg { display: block; overflow: visible; }

.bt-BarChart__grid { stroke: var(--bt-viz-grid); stroke-width: 1px; stroke-dasharray: 3 3; shape-rendering: crispEdges; }
.bt-BarChart__grid--zero { stroke: var(--bt-viz-axis); stroke-dasharray: none; }

.bt-BarChart__tick {
  fill: var(--bt-viz-label-muted);
  font-size: var(--bt-font-size-275);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bt-BarChart__track { fill: none; stroke: var(--bt-viz-grid); stroke-width: 1.5px; stroke-dasharray: 3 3; }
.bt-BarChart__ring { fill: none; stroke-width: 3px; }
.bt-BarChart__col--highlight .bt-BarChart__ring { stroke: var(--bt-border-brand); }
.bt-BarChart__col--active .bt-BarChart__ring { stroke: var(--bt-viz-label); }

.bt-BarChart__bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: bt-BarChart-grow var(--bt-duration-fill) var(--bt-ease-in-out) both;
}
/* Frame motion="off": the bars stand at once. */
.bt-BarChart--still .bt-BarChart__bar { animation: none; }
.bt-BarChart__knob { fill: var(--bt-viz-surface); }

@keyframes bt-BarChart-grow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* Period labels under the bars (HTML, so the highlighted one can sit in a chip). */
.bt-BarChart__label {
  position: absolute;
  bottom: 4px;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: var(--bt-radius-full);
  white-space: nowrap;
  font-size: var(--bt-font-size-275);
  line-height: 1.3;
  font-weight: 600;
  color: var(--bt-viz-label-muted);
  pointer-events: none;
}
.bt-BarChart__label--highlight { background: var(--bt-bg-inverse); color: var(--bt-text-inverse); }

/* The plan or limit line and its label pill at the right end, above the line. */
.bt-BarChart__target { stroke: var(--bt-viz-label-muted); stroke-width: 1.5px; stroke-dasharray: 4 4; }
.bt-BarChart__target--critical { stroke: var(--bt-border-critical); }
.bt-BarChart__targetLabel {
  position: absolute;
  right: 0;
  z-index: 2;
  transform: translateY(calc(-100% - 4px));
  padding: 2px 9px;
  border-radius: var(--bt-radius-full);
  background: var(--bt-viz-surface);
  box-shadow: inset 0 0 0 1px var(--bt-viz-grid);
  white-space: nowrap;
  font-size: var(--bt-font-size-275);
  line-height: 1.4;
  font-weight: 700;
  color: var(--bt-viz-label);
  pointer-events: none;
}
.bt-BarChart__targetLabel--critical { color: var(--bt-text-critical); box-shadow: inset 0 0 0 1px var(--bt-bg-critical-subtle); }

.bt-BarChart__readout { left: 0; }

.bt-BarChart__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--bt-space-300);
  box-sizing: border-box;
  text-align: center;
  color: var(--bt-viz-label-muted);
  font-size: var(--bt-font-size-350);
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .bt-BarChart__bar { animation: none; }
}

@media (forced-colors: active) {
  .bt-BarChart__bar { fill: CanvasText !important; }
  .bt-BarChart__knob { fill: Canvas; }
  .bt-BarChart__track, .bt-BarChart__grid, .bt-BarChart__target { stroke: GrayText; }
  .bt-BarChart__ring { stroke: Highlight !important; }
  .bt-BarChart__tick { fill: CanvasText; }
  .bt-BarChart__label { color: CanvasText; }
  .bt-BarChart__label--highlight { background: Highlight; color: HighlightText; }
  .bt-BarChart__targetLabel { color: CanvasText; border: 1px solid CanvasText; }
}

/* --- Barcode --- */
/* Barcode and QRCode: dark modules on a white tile in both themes (text-on-accent and text-on-brand keep their
   values in dark mode), so a code on screen still scans. The download helper reads these computed colours. */
.bt-Barcode { display: inline-flex; flex-direction: column; align-items: flex-start; gap: var(--bt-space-200); max-width: 100%; }
.bt-Barcode__Svg { display: block; max-width: 100%; height: auto; color: var(--bt-text-on-accent); background: var(--bt-text-on-brand); border-radius: var(--bt-radius-100); }
.bt-Barcode__Light { fill: var(--bt-text-on-brand); }
.bt-Barcode__Dark { fill: var(--bt-text-on-accent); }
.bt-Barcode__Text { fill: var(--bt-text-on-accent); font-family: var(--bt-font-mono); }
.bt-Barcode__Downloads { display: inline-flex; flex-wrap: wrap; gap: var(--bt-space-200); }
.bt-Barcode__Error { color: var(--bt-text-critical); font: var(--bt-font-weight-regular) var(--bt-font-size-325) / var(--bt-font-line-height-500) var(--bt-font-sans); }

/* --- BlockStack --- */
.bt-BlockStack {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.bt-BlockStack--list { list-style: none; }
.bt-BlockStack--reverse { flex-direction: column-reverse; }

.bt-BlockStack--alignStart { justify-content: flex-start; }
.bt-BlockStack--alignCenter { justify-content: center; }
.bt-BlockStack--alignEnd { justify-content: flex-end; }
.bt-BlockStack--alignSpaceAround { justify-content: space-around; }
.bt-BlockStack--alignSpaceBetween { justify-content: space-between; }
.bt-BlockStack--alignSpaceEvenly { justify-content: space-evenly; }

.bt-BlockStack--inlineAlignStart { align-items: flex-start; }
.bt-BlockStack--inlineAlignCenter { align-items: center; }
.bt-BlockStack--inlineAlignEnd { align-items: flex-end; }
.bt-BlockStack--inlineAlignBaseline { align-items: baseline; }
.bt-BlockStack--inlineAlignStretch { align-items: stretch; }

/* Gap per breakpoint; the vars are set inline by the component (all five, see shared/responsive.ts).
   Media queries cannot read var(): the widths are the breakpoint tokens (sm 480, md 768, lg 1024, xl 1440). */
.bt-BlockStack--gap { gap: var(--bt-BlockStack-gap-xs); }
@media (min-width: 480px) { .bt-BlockStack--gap { gap: var(--bt-BlockStack-gap-sm); } }
@media (min-width: 768px) { .bt-BlockStack--gap { gap: var(--bt-BlockStack-gap-md); } }
@media (min-width: 1024px) { .bt-BlockStack--gap { gap: var(--bt-BlockStack-gap-lg); } }
@media (min-width: 1440px) { .bt-BlockStack--gap { gap: var(--bt-BlockStack-gap-xl); } }

/* --- Box --- */
/* Box: a styled div; colors, borders, radius, shadow, sizes and inset are inline token vars. */
.bt-Box {
  min-width: 0;
}
.bt-Box--list { list-style: none; margin: 0; padding: 0; }
.bt-Box:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
/* shadow prop: --bt-Box-shadow is set inline; the focus ring stacks on top of it. */
.bt-Box--shadow { box-shadow: var(--bt-Box-shadow); }
.bt-Box--shadow:focus-visible { box-shadow: var(--bt-shadow-focus), var(--bt-Box-shadow); }

/* Padding per side per breakpoint; the vars are set inline (all four sides x five breakpoints, see shared/responsive.ts).
   Media queries cannot read var(): the widths are the breakpoint tokens (sm 480, md 768, lg 1024, xl 1440). */
.bt-Box--padding {
  padding-block-start: var(--bt-Box-pbs-xs);
  padding-block-end: var(--bt-Box-pbe-xs);
  padding-inline-start: var(--bt-Box-pis-xs);
  padding-inline-end: var(--bt-Box-pie-xs);
}
@media (min-width: 480px) {
  .bt-Box--padding {
    padding-block-start: var(--bt-Box-pbs-sm);
    padding-block-end: var(--bt-Box-pbe-sm);
    padding-inline-start: var(--bt-Box-pis-sm);
    padding-inline-end: var(--bt-Box-pie-sm);
  }
}
@media (min-width: 768px) {
  .bt-Box--padding {
    padding-block-start: var(--bt-Box-pbs-md);
    padding-block-end: var(--bt-Box-pbe-md);
    padding-inline-start: var(--bt-Box-pis-md);
    padding-inline-end: var(--bt-Box-pie-md);
  }
}
@media (min-width: 1024px) {
  .bt-Box--padding {
    padding-block-start: var(--bt-Box-pbs-lg);
    padding-block-end: var(--bt-Box-pbe-lg);
    padding-inline-start: var(--bt-Box-pis-lg);
    padding-inline-end: var(--bt-Box-pie-lg);
  }
}
@media (min-width: 1440px) {
  .bt-Box--padding {
    padding-block-start: var(--bt-Box-pbs-xl);
    padding-block-end: var(--bt-Box-pbe-xl);
    padding-inline-start: var(--bt-Box-pis-xl);
    padding-inline-end: var(--bt-Box-pie-xl);
  }
}

@media print {
  .bt-Box--printHidden { display: none !important; }
}

/* --- Breadcrumbs --- */
/* Breadcrumbs: a wrapping row of links with chevrons between. The trail is a size container: under 480px a
   foldable trail (4+ steps, not yet expanded) hides its middle steps and shows the "…" button in their place. */
/* Size containment gives the trail no width of its own: it takes its parent's. */
.bt-Breadcrumbs { container-type: inline-size; inline-size: 100%; min-width: 0; }
.bt-Breadcrumbs__List {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-050) 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font: var(--bt-font-weight-medium) var(--bt-font-size-325) / var(--bt-font-line-height-500) var(--bt-font-sans);
  color: var(--bt-text-secondary);
}
.bt-Breadcrumbs__Item { display: inline-flex; align-items: center; min-width: 0; }
.bt-Breadcrumbs__Separator { display: inline-flex; margin: 0 var(--bt-space-050); color: var(--bt-text-secondary); }
.bt-Breadcrumbs__Link {
  margin: 0;
  padding: var(--bt-space-050) var(--bt-space-100);
  border: 0;
  border-radius: var(--bt-radius-200);
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.bt-Breadcrumbs__Link:hover { color: var(--bt-text); background: var(--bt-bg-surface-hover); }
.bt-Breadcrumbs__Link:focus { outline: none; }
.bt-Breadcrumbs__Link:focus-visible { box-shadow: 0 0 0 var(--bt-border-width-2) var(--bt-border-focus); }
.bt-Breadcrumbs__Current {
  padding: var(--bt-space-050) var(--bt-space-100);
  color: var(--bt-text);
  font-weight: var(--bt-font-weight-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-Breadcrumbs__Fold { display: none; }
@container (max-width: 479px) {
  .bt-Breadcrumbs--foldable .bt-Breadcrumbs__Item--middle { display: none; }
  .bt-Breadcrumbs--foldable .bt-Breadcrumbs__Fold { display: inline-flex; }
}

/* --- Button --- */
/* Button: a pill. Each variant sets local custom properties (--bt-btn-bg, -fg, -border and their states); the root
   paints from them, so a state is one rule per variant x tone. */

.bt-Button {
  --bt-btn-bg: var(--bt-bg-surface);
  --bt-btn-bg-hover: var(--bt-bg-surface-secondary);
  --bt-btn-bg-active: var(--bt-bg-surface-active);
  --bt-btn-fg: var(--bt-text);
  --bt-btn-border: var(--bt-border);
  --bt-btn-border-hover: var(--bt-border-hover);
  --bt-btn-height: var(--bt-size-control-md);
  --bt-btn-pad: var(--bt-space-500);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--bt-btn-height);
  min-width: var(--bt-btn-height);
  margin: 0;
  padding: 0 var(--bt-btn-pad);
  border: var(--bt-border-width-1) solid var(--bt-btn-border);
  border-radius: var(--bt-radius-full);
  background: var(--bt-btn-bg);
  color: var(--bt-btn-fg);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-semibold);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
  transition:
    background-color var(--bt-duration-fast) var(--bt-ease-emphasized),
    border-color var(--bt-duration-fast) var(--bt-ease-emphasized),
    color var(--bt-duration-fast) var(--bt-ease-emphasized),
    box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Button:hover { background: var(--bt-btn-bg-hover); border-color: var(--bt-btn-border-hover); }
.bt-Button:active { background: var(--bt-btn-bg-active); border-color: var(--bt-btn-border-hover); }
.bt-Button:focus { outline: none; }
.bt-Button:focus-visible { box-shadow: var(--bt-shadow-focus); z-index: 1; }

/* Pressed (a toggle that is on): the strong fill, like a selected filter chip. */
.bt-Button--pressed,
.bt-Button--pressed:hover,
.bt-Button--pressed:active {
  background: var(--bt-fill-strong);
  border-color: transparent;
  color: var(--bt-text-on-strong);
}

.bt-Button__content {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-200);
  min-width: 0;
}
.bt-Button__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bt-Button__icon,
.bt-Button__disclosure { display: inline-flex; flex: none; }
/* An icon before the label pulls the start padding in, a chevron after it the end padding. */
.bt-Button__icon { margin-inline-start: calc(var(--bt-space-100) * -1); }
.bt-Button__disclosure { margin-inline-end: calc(var(--bt-space-100) * -1); }

/* A count after the label ("Kişiler 10"); on an icon-only button it sits on the top end edge. */
.bt-Button__count { display: inline-flex; flex: none; }
.bt-Button--iconOnly .bt-Button__count {
  position: absolute;
  inset-block-start: calc(var(--bt-space-050) * -1);
  inset-inline-end: calc(var(--bt-space-050) * -1);
  --bt-count-ring: var(--bt-bg);
}

/* Sizes. micro has no control token: 32px control-sm minus space-200 = 24px. Template pills are 34/44/52; the
   control tokens (32/40/48) are the nearest and keep buttons flush with fields. */
.bt-Button--sizeMicro {
  --bt-btn-height: calc(var(--bt-size-control-sm) - var(--bt-space-200));
  --bt-btn-pad: var(--bt-space-300);
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-400);
}
.bt-Button--sizeMicro .bt-Button__content { gap: var(--bt-space-100); }
.bt-Button--sizeSlim {
  --bt-btn-height: var(--bt-size-control-sm);
  --bt-btn-pad: var(--bt-space-400);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
}
.bt-Button--sizeMedium { --bt-btn-height: var(--bt-size-control-md); --bt-btn-pad: var(--bt-space-500); }
.bt-Button--sizeLarge {
  --bt-btn-height: var(--bt-size-control-lg);
  --bt-btn-pad: var(--bt-space-600);
  font-size: var(--bt-font-size-375);
}

/* Icon-only: a circle. secondary is the card-coloured round button of the top bar (hairline and soft shadow). */
.bt-Button--iconOnly { padding: 0; width: var(--bt-btn-height); }
.bt-Button--iconOnly .bt-Button__icon,
.bt-Button--iconOnly .bt-Button__disclosure { margin: 0; }
.bt-Button--secondary.bt-Button--iconOnly:where(:not(.bt-Button--pressed, .bt-Button--disabled)) {
  --bt-btn-border: var(--bt-border-secondary);
  box-shadow: var(--bt-shadow-soft);
}
.bt-Button--secondary.bt-Button--iconOnly:focus-visible { box-shadow: var(--bt-shadow-focus); }

.bt-Button--fullWidth { display: flex; width: 100%; }
.bt-Button--textAlignLeft,
.bt-Button--textAlignStart { justify-content: flex-start; }
.bt-Button--textAlignRight,
.bt-Button--textAlignEnd { justify-content: flex-end; }
.bt-Button--textAlignCenter { justify-content: center; }
/* With a disclosure in a wide button, the chevron goes to the far end. */
.bt-Button--fullWidth .bt-Button__content { flex: 1 1 auto; }
.bt-Button--fullWidth.bt-Button--textAlignLeft .bt-Button__label,
.bt-Button--fullWidth.bt-Button--textAlignStart .bt-Button__label { flex: 1 1 auto; text-align: start; }
.bt-Button--fullWidth:not(.bt-Button--textAlignLeft):not(.bt-Button--textAlignStart):not(.bt-Button--textAlignRight):not(.bt-Button--textAlignEnd) .bt-Button__content { justify-content: center; }
.bt-Button--fullWidth.bt-Button--textAlignRight .bt-Button__content,
.bt-Button--fullWidth.bt-Button--textAlignEnd .bt-Button__content { justify-content: flex-end; }

/* ---- Variants x tones ---- */

/* primary: the one main action of a view. Ink in light, garnet in dark. */
.bt-Button--primary {
  --bt-btn-bg: var(--bt-fill-strong);
  --bt-btn-bg-hover: var(--bt-fill-strong-hover);
  --bt-btn-bg-active: var(--bt-fill-strong-active);
  --bt-btn-fg: var(--bt-text-on-strong);
  --bt-btn-border: transparent;
  --bt-btn-border-hover: transparent;
}
.bt-Button--primary.bt-Button--toneCritical {
  --bt-btn-bg: var(--bt-fill-critical);
  --bt-btn-bg-hover: var(--bt-fill-critical-hover);
  --bt-btn-bg-active: var(--bt-fill-critical-active);
  --bt-btn-fg: var(--bt-text-on-critical);
}
.bt-Button--primary.bt-Button--toneSuccess {
  --bt-btn-bg: var(--bt-fill-success);
  --bt-btn-bg-hover: var(--bt-fill-success-hover);
  --bt-btn-bg-active: var(--bt-fill-success-active);
  --bt-btn-fg: var(--bt-text-on-success);
}

/* secondary (default): the card colour with a hairline. A tone colours the text and tints the hover. */
.bt-Button--secondary.bt-Button--toneCritical {
  --bt-btn-fg: var(--bt-text-critical);
  --bt-btn-bg-hover: var(--bt-bg-critical-subtle);
  --bt-btn-bg-active: var(--bt-bg-critical-subtle);
  --bt-btn-border-hover: var(--bt-border-critical);
}
.bt-Button--secondary.bt-Button--toneSuccess {
  --bt-btn-fg: var(--bt-text-success);
  --bt-btn-bg-hover: var(--bt-bg-success-subtle);
  --bt-btn-bg-active: var(--bt-bg-success-subtle);
  --bt-btn-border-hover: var(--bt-border-success);
}

/* tertiary: no fill until hover (the template's ghost and flat round buttons). */
.bt-Button--tertiary {
  --bt-btn-bg: transparent;
  --bt-btn-bg-hover: var(--bt-bg-surface-secondary);
  --bt-btn-bg-active: var(--bt-bg-surface-active);
  --bt-btn-border: transparent;
  --bt-btn-border-hover: transparent;
}
.bt-Button--tertiary.bt-Button--toneCritical { --bt-btn-fg: var(--bt-text-critical); --bt-btn-bg-hover: var(--bt-bg-critical-subtle); }
.bt-Button--tertiary.bt-Button--toneSuccess { --bt-btn-fg: var(--bt-text-success); --bt-btn-bg-hover: var(--bt-bg-success-subtle); }

/* plain and monochromePlain: a text action (the template's link button), no box. */
.bt-Button--plain,
.bt-Button--monochromePlain {
  --bt-btn-bg: transparent;
  --bt-btn-bg-hover: transparent;
  --bt-btn-bg-active: transparent;
  --bt-btn-border: transparent;
  --bt-btn-border-hover: transparent;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: var(--bt-radius-100);
}
.bt-Button--plain { --bt-btn-fg: var(--bt-text-brand); }
.bt-Button--plain:hover { color: var(--bt-text-brand-hover); }
.bt-Button--plain.bt-Button--toneCritical { --bt-btn-fg: var(--bt-text-critical); }
.bt-Button--plain.bt-Button--toneSuccess { --bt-btn-fg: var(--bt-text-success); }
.bt-Button--plain.bt-Button--toneCritical:hover,
.bt-Button--plain.bt-Button--toneSuccess:hover { color: var(--bt-btn-fg); }
.bt-Button--monochromePlain { --bt-btn-fg: currentColor; color: inherit; }
.bt-Button--plain:hover .bt-Button__label,
.bt-Button--monochromePlain .bt-Button__label { text-decoration: underline; text-underline-offset: 0.2em; }
.bt-Button--monochromePlain:hover .bt-Button__label { text-decoration-thickness: var(--bt-border-width-2); }
.bt-Button--removeUnderline .bt-Button__label,
.bt-Button--removeUnderline:hover .bt-Button__label { text-decoration: none; }
.bt-Button--plain.bt-Button--iconOnly,
.bt-Button--monochromePlain.bt-Button--iconOnly { min-height: var(--bt-btn-height); min-width: var(--bt-btn-height); }
/* A pressed text action keeps its text form: brand text, no fill. */
.bt-Button--plain.bt-Button--pressed,
.bt-Button--monochromePlain.bt-Button--pressed { background: transparent; color: var(--bt-text-brand); }

/* ---- Disabled (any variant, any tone): the disabled fill and text, no border. ---- */
.bt-Button--disabled,
.bt-Button--disabled:hover,
.bt-Button--disabled:active {
  --bt-btn-bg: var(--bt-fill-disabled);
  --bt-btn-fg: var(--bt-text-disabled);
  background: var(--bt-fill-disabled);
  border-color: transparent;
  color: var(--bt-text-disabled);
  box-shadow: none;
  cursor: default;
}
.bt-Button--tertiary.bt-Button--disabled,
.bt-Button--plain.bt-Button--disabled,
.bt-Button--monochromePlain.bt-Button--disabled { background: transparent; }
.bt-Button--disabled .bt-Button__label { text-decoration: none; }

/* ---- Loading: the content stays (keeps the width and the accessible name) but is invisible. ---- */
.bt-Button--loading { cursor: default; }
.bt-Button--loading,
.bt-Button--loading:hover,
.bt-Button--loading:active { background: var(--bt-btn-bg); border-color: var(--bt-btn-border); }
.bt-Button--loading .bt-Button__content { opacity: 0; }
.bt-Button__spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.bt-Button__spinner .bt-Spinner { color: var(--bt-btn-fg); }
.bt-Button__spinner .bt-Spinner__track { stroke: currentColor; opacity: 0.25; }
.bt-Button--sizeMicro .bt-Button__spinner .bt-Spinner { width: var(--bt-size-icon-sm); height: var(--bt-size-icon-sm); }

@media (prefers-reduced-motion: reduce) {
  .bt-Button { transition: none; }
}

@media (forced-colors: active) {
  .bt-Button { border-color: ButtonText; }
  .bt-Button--plain,
  .bt-Button--monochromePlain { border: 0; color: LinkText; }
  .bt-Button--pressed { border-color: Highlight; border-width: var(--bt-border-width-2); }
  .bt-Button:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
  .bt-Button--disabled { color: GrayText; border-color: GrayText; }
}

/* --- ButtonGroup --- */
.bt-ButtonGroup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-200);
}
.bt-ButtonGroup--gapTight { gap: var(--bt-space-100); }
.bt-ButtonGroup--gapLoose { gap: var(--bt-space-400); }
.bt-ButtonGroup--noWrap { flex-wrap: nowrap; }

.bt-ButtonGroup__item { display: flex; flex: 0 0 auto; min-width: 0; }
.bt-ButtonGroup--fullWidth .bt-ButtonGroup__item { flex: 1 1 auto; }
.bt-ButtonGroup--fullWidth .bt-ButtonGroup__item > .bt-Button { width: 100%; }

/* Segmented: one pill of joined buttons, shared 1px borders, round outer ends only. (A choice between views is a
   SegmentedControl; this joins actions, such as a split button.) */
.bt-ButtonGroup--segmented { gap: 0; flex-wrap: nowrap; }
.bt-ButtonGroup--segmented .bt-ButtonGroup__item + .bt-ButtonGroup__item { margin-inline-start: calc(var(--bt-border-width-1) * -1); }
.bt-ButtonGroup--segmented .bt-ButtonGroup__item > .bt-Button { border-radius: 0; }
.bt-ButtonGroup--segmented .bt-ButtonGroup__item:first-child > .bt-Button {
  border-start-start-radius: var(--bt-radius-full);
  border-end-start-radius: var(--bt-radius-full);
}
.bt-ButtonGroup--segmented .bt-ButtonGroup__item:last-child > .bt-Button {
  border-start-end-radius: var(--bt-radius-full);
  border-end-end-radius: var(--bt-radius-full);
}
.bt-ButtonGroup--segmented.bt-ButtonGroup--connectedTop .bt-ButtonGroup__item > .bt-Button {
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}
/* The hovered, pressed or focused segment draws its whole border over its neighbours. */
.bt-ButtonGroup--segmented .bt-ButtonGroup__item:hover,
.bt-ButtonGroup--segmented .bt-ButtonGroup__item:has(.bt-Button--pressed) { z-index: 1; }
.bt-ButtonGroup--segmented .bt-ButtonGroup__item:focus-within { z-index: 2; }
.bt-ButtonGroup--segmented .bt-ButtonGroup__item { position: relative; }
/* Primary segments have no border: a hairline in the label colour separates them. */
.bt-ButtonGroup--segmented .bt-ButtonGroup__item + .bt-ButtonGroup__item > .bt-Button--primary {
  border-inline-start-color: color-mix(in srgb, var(--bt-btn-fg) 35%, transparent);
}
/* An icon-only segment (the chevron of a split button) is not a circle inside the pill. */
.bt-ButtonGroup--segmented .bt-ButtonGroup__item > .bt-Button--iconOnly { width: auto; padding-inline: var(--bt-space-300); }

/* --- Calendar --- */
/* A month (or week) grid, Monday first. Each day is a cell with its number (a round button, today in a garnet
   ring, the selected day filled) and its events as tone chips; "+N daha" opens the rest in a popover.
   Days outside the month are subdued. The grid is a table with fixed columns so long titles truncate. */
.bt-Calendar { display: flex; flex-direction: column; gap: var(--bt-space-300); min-inline-size: 0; color: var(--bt-text); }
.bt-Calendar__Header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--bt-space-200);
}
.bt-Calendar__Title {
  margin: 0;
  font-size: var(--bt-font-size-425);
  line-height: var(--bt-font-line-height-600);
  font-weight: var(--bt-font-weight-semibold);
}
.bt-Calendar__Nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bt-space-100); }
.bt-Calendar__Grid {
  inline-size: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border: var(--bt-border-width-1) solid var(--bt-border-secondary);
  border-radius: var(--bt-radius-350);
  overflow: hidden;
  background: var(--bt-bg-surface);
}
.bt-Calendar__Grid th {
  padding: var(--bt-space-150) var(--bt-space-200);
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-400);
  font-weight: var(--bt-font-weight-medium);
  color: var(--bt-text-secondary);
  text-align: start;
  border-block-end: var(--bt-border-width-1) solid var(--bt-border-secondary);
}
.bt-Calendar__Cell {
  vertical-align: top;
  block-size: calc(var(--bt-space-1200) * 2);
  padding: var(--bt-space-100);
  border-block-end: var(--bt-border-width-1) solid var(--bt-border-secondary);
  border-inline-start: var(--bt-border-width-1) solid var(--bt-border-secondary);
  background: var(--bt-bg-surface);
}
.bt-Calendar--week .bt-Calendar__Cell { block-size: calc(var(--bt-space-1200) * 5); }
.bt-Calendar__Cell:first-child { border-inline-start: 0; }
.bt-Calendar__Grid tbody tr:last-child .bt-Calendar__Cell { border-block-end: 0; }
.bt-Calendar__Cell--outside { background: var(--bt-bg-surface-secondary); }
.bt-Calendar__Cell--outside .bt-Calendar__Day { color: var(--bt-text-secondary); }
.bt-Calendar__Cell--clickable { cursor: pointer; }
.bt-Calendar__Cell--clickable:hover { background: var(--bt-bg-surface-hover); }
.bt-Calendar__Cell--selected,
.bt-Calendar__Cell--selected:hover { background: var(--bt-bg-surface-selected); }

.bt-Calendar__Day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: var(--bt-size-control-sm);
  block-size: var(--bt-size-control-sm);
  margin: 0 0 var(--bt-space-050);
  padding: 0;
  border: 0;
  border-radius: var(--bt-radius-full);
  background: transparent;
  color: var(--bt-text);
  font: inherit;
  font-size: var(--bt-font-size-312);
  font-weight: var(--bt-font-weight-medium);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.bt-Calendar__Day:hover { background: var(--bt-bg-surface-active); }
.bt-Calendar__Day:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-Calendar__Cell--today .bt-Calendar__Day { box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-brand); color: var(--bt-text-brand); font-weight: var(--bt-font-weight-bold); }
.bt-Calendar__Cell--today .bt-Calendar__Day:focus-visible { box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-brand), var(--bt-shadow-focus); }
.bt-Calendar__Cell--selected .bt-Calendar__Day { background: var(--bt-fill-strong); color: var(--bt-text-on-strong); }

.bt-Calendar__Events { display: flex; flex-direction: column; gap: var(--bt-space-050); margin: 0; padding: 0; list-style: none; min-inline-size: 0; }
.bt-Calendar__Event {
  display: flex;
  align-items: baseline;
  gap: var(--bt-space-100);
  inline-size: 100%;
  min-inline-size: 0;
  padding: var(--bt-space-025) var(--bt-space-150);
  border: 0;
  border-radius: var(--bt-radius-150);
  font: inherit;
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-400);
  font-weight: var(--bt-font-weight-medium);
  text-align: start;
  cursor: pointer;
}
.bt-Calendar__Event:hover { filter: brightness(0.96); }
.bt-Calendar__Event:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-Calendar__Event--neutral { background: var(--bt-bg-surface-secondary); color: var(--bt-text); }
.bt-Calendar__Event--brand { background: var(--bt-bg-brand-subtle); color: var(--bt-text-brand); }
.bt-Calendar__Event--success { background: var(--bt-bg-success-subtle); color: var(--bt-text-success); }
.bt-Calendar__Event--critical { background: var(--bt-bg-critical-subtle); color: var(--bt-text-critical); }
.bt-Calendar__Event--caution { background: var(--bt-bg-caution-subtle); color: var(--bt-text-caution); }
.bt-Calendar__Event--info { background: var(--bt-bg-info-subtle); color: var(--bt-text-info); }
.bt-Calendar__Time { flex: none; font-variant-numeric: tabular-nums; font-weight: var(--bt-font-weight-regular); }
.bt-Calendar__EventTitle { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-Calendar__More {
  margin-block-start: var(--bt-space-050);
  padding: 0 var(--bt-space-150);
  border: 0;
  border-radius: var(--bt-radius-150);
  background: transparent;
  color: var(--bt-text-secondary);
  font: inherit;
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-400);
  font-weight: var(--bt-font-weight-semibold);
  cursor: pointer;
}
.bt-Calendar__More:hover { background: var(--bt-bg-surface-active); color: var(--bt-text); }
.bt-Calendar__More:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-Calendar__MoreList { display: flex; flex-direction: column; gap: var(--bt-space-150); padding: var(--bt-space-300); min-inline-size: calc(var(--bt-space-1200) * 4); }
.bt-Calendar__MoreTitle { font-size: var(--bt-font-size-312); line-height: var(--bt-font-line-height-450); font-weight: var(--bt-font-weight-semibold); }

@media (max-width: 479.98px) {
  .bt-Calendar__Cell { block-size: var(--bt-space-1200); padding: var(--bt-space-050); }
  .bt-Calendar__Grid th { padding-inline: var(--bt-space-050); text-align: center; }
  .bt-Calendar--month .bt-Calendar__Event { font-size: 0; padding: 0; block-size: var(--bt-space-100); }
}
@media (forced-colors: active) {
  .bt-Calendar__Day:focus-visible, .bt-Calendar__Event:focus-visible, .bt-Calendar__More:focus-visible { outline: 2px solid Highlight; outline-offset: 1px; }
  .bt-Calendar__Event { border: 1px solid CanvasText; }
}

/* --- Card --- */
/* Card: bg-surface, radius-600 (radius-500 on phones), a hairline ring and shadow-soft; the well
   (bg-surface-secondary) keeps the ring and drops the shadow. Inner tiles radius-350. */
.bt-Card {
  position: relative;
  min-width: 0;
  background: var(--bt-Card-bg, var(--bt-bg-surface));
  color: var(--bt-text);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary), var(--bt-shadow-soft);
  border-radius: 0;
  overflow: clip;
  padding: var(--bt-Card-padding-xs);
}
.bt-Card--well { box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary); }
/* Media queries cannot read var(): the widths are the breakpoint tokens (sm 480, md 768, lg 1024, xl 1440). */
@media (min-width: 480px) { .bt-Card { padding: var(--bt-Card-padding-sm); } }
@media (min-width: 768px) { .bt-Card { padding: var(--bt-Card-padding-md); } }
@media (min-width: 1024px) { .bt-Card { padding: var(--bt-Card-padding-lg); } }
@media (min-width: 1440px) { .bt-Card { padding: var(--bt-Card-padding-xl); } }

/* Rounded from the breakpoint up: radius-500 on phones, radius-600 from md. */
.bt-Card--roundedAboveXs { border-radius: var(--bt-radius-500); }
@media (min-width: 480px) { .bt-Card--roundedAboveSm { border-radius: var(--bt-radius-500); } }
@media (min-width: 768px) {
  .bt-Card--roundedAboveXs,
  .bt-Card--roundedAboveSm,
  .bt-Card--roundedAboveMd { border-radius: var(--bt-radius-600); }
}
@media (min-width: 1024px) { .bt-Card--roundedAboveLg { border-radius: var(--bt-radius-600); } }
@media (min-width: 1440px) { .bt-Card--roundedAboveXl { border-radius: var(--bt-radius-600); } }

/* Header: icon chip, heading block, actions. The icon and the actions sit on the title's line (top), so a long
   description grows downward; the actions wrap onto their own row, and wrap inside it, on a narrow card. */
.bt-Card__header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--bt-space-300);
  margin-bottom: var(--bt-space-400);
}
.bt-Card__header--small { margin-bottom: var(--bt-space-300); }
/* A flush card (padding '0') still pads its header. */
.bt-Card--flush > .bt-Card__header { padding: var(--bt-space-400) var(--bt-space-500) 0; }
.bt-Card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--bt-size-control-md);
  height: var(--bt-size-control-md);
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface);
  color: var(--bt-text);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border);
}
.bt-Card__heading { flex: 1 1 8rem; min-width: 0; }
/* Beside an icon or actions, a short heading centres on their 40px line. */
.bt-Card__header--aside .bt-Card__heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--bt-size-control-md);
}
.bt-Card__title {
  margin: 0;
  font: var(--bt-font-weight-semibold) var(--bt-font-size-425) / var(--bt-font-line-height-500) var(--bt-font-sans);
  letter-spacing: -0.005em;
  color: var(--bt-text);
  overflow-wrap: anywhere;
}
.bt-Card__header--small .bt-Card__title { font-size: var(--bt-font-size-375); }
.bt-Card__description {
  margin: var(--bt-space-050) 0 0;
  font: var(--bt-font-weight-medium) var(--bt-font-size-312) / var(--bt-font-line-height-450) var(--bt-font-sans);
  color: var(--bt-text-secondary);
  overflow-wrap: anywhere;
}
.bt-Card__actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-200);
  min-height: var(--bt-size-control-md);
  max-width: 100%;
  margin-left: auto;
}

/* A flush card's content (a table) paints over the inset ring: draw the ring again on top. */
.bt-Card--flush::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
  pointer-events: none;
}

/* Clickable: one link or button stretched over the whole card; inner controls stay above it. */
.bt-Card__action {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bt-Card__action:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-Card--clickable :is(a, button, input, select, textarea, [tabindex]):not(.bt-Card__action) { position: relative; z-index: 2; }
.bt-Card--clickable { transition: box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized); }
.bt-Card--clickable:hover { box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border), var(--bt-shadow-soft-lg); }
@media (prefers-reduced-motion: reduce) { .bt-Card--clickable { transition: none; } }

/* Tiles. */
.bt-Card__tile {
  min-width: 0;
  padding: var(--bt-Card-tile-padding, var(--bt-space-300));
  border-radius: var(--bt-radius-350);
  background: var(--bt-bg-surface-secondary);
  color: var(--bt-text);
}
.bt-Card__tile--tile-1 { background: var(--bt-bg-tile-1); }
.bt-Card__tile--tile-2 { background: var(--bt-bg-tile-2); }
.bt-Card__tile--tile-3 { background: var(--bt-bg-tile-3); }
.bt-Card__tile--tile-4 { background: var(--bt-bg-tile-4); }
.bt-Card__tile--tile-5 { background: var(--bt-bg-tile-5); }
.bt-Card__tile--tile-6 { background: var(--bt-bg-tile-6); }
/* A tile re-points text and text-secondary for its subtree, so Text (any tone that reads them) takes its colours. */
.bt-Card__tile[class*='--tile-'] { color: var(--bt-text-on-tile); --bt-text: var(--bt-text-on-tile); --bt-text-secondary: var(--bt-text-on-tile-secondary); }
.bt-Card__tile--inverse { background: var(--bt-bg-inverse); color: var(--bt-text-inverse); --bt-text: var(--bt-text-inverse); --bt-text-secondary: var(--bt-text-inverse); }
.bt-Card__tile--critical { background: var(--bt-bg-critical-subtle); box-shadow: inset 0 0 0 var(--bt-border-width-1) color-mix(in oklab, var(--bt-border-critical) 40%, transparent); }
/* A picker's chosen row: the selected surface and a 2px brand ring. */
.bt-Card__tile--selected { background: var(--bt-bg-surface-selected); box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-brand); }

@media (forced-colors: active) {
  .bt-Card { border: 1px solid CanvasText; }
  .bt-Card__tile { border: 1px solid CanvasText; }
  .bt-Card__tile--selected { border: 2px solid Highlight; }
  .bt-Card__action:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* --- Checkbox --- */
/* A real checkbox, transparent, over a drawn 20px box with soft corners (radius-150). Rest: fill-secondary with a
   border-strong line (3:1 on surfaces, so the empty box stays findable); checked: fill-brand with the mark in
   text-on-brand; keyboard focus: shadow-focus. */
.bt-Checkbox {
  position: relative;
  display: inline-flex;
  width: var(--bt-size-icon-md);
  height: var(--bt-size-icon-md);
}
.bt-Checkbox__Input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.bt-Checkbox__Input:disabled { cursor: default; }
.bt-Checkbox__Box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--bt-fill-secondary);
  border: var(--bt-border-width-1) solid var(--bt-border-strong);
  border-radius: var(--bt-radius-150);
  color: var(--bt-text-on-brand);
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized), border-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Checkbox__Icon { display: none; }
/* Our icons are drawn at 1.75 on 24px; 2.75 gives the mark the template's firm 2px stroke at 16px. */
.bt-Checkbox__Icon .bt-Icon__svg { stroke-width: 2.75; }

.bt-Checkbox__Input:hover + .bt-Checkbox__Box { border-color: var(--bt-border-hover); }
.bt-Checkbox--error .bt-Checkbox__Box { border-color: var(--bt-border-critical); }
.bt-Checkbox__Input:focus-visible + .bt-Checkbox__Box { box-shadow: var(--bt-shadow-focus); }

.bt-Checkbox__Input:checked + .bt-Checkbox__Box,
.bt-Checkbox__Input:indeterminate + .bt-Checkbox__Box {
  background: var(--bt-fill-brand);
  border-color: var(--bt-fill-brand);
}
.bt-Checkbox__Input:checked:hover + .bt-Checkbox__Box,
.bt-Checkbox__Input:indeterminate:hover + .bt-Checkbox__Box { background: var(--bt-fill-brand-hover); border-color: var(--bt-fill-brand-hover); }
.bt-Checkbox__Input:checked:not(:indeterminate) + .bt-Checkbox__Box .bt-Checkbox__Icon--check,
.bt-Checkbox__Input:indeterminate + .bt-Checkbox__Box .bt-Checkbox__Icon--minus { display: inline-flex; }

.bt-Checkbox__Input:disabled + .bt-Checkbox__Box,
.bt-Checkbox__Input:disabled:hover + .bt-Checkbox__Box {
  background: var(--bt-fill-disabled);
  border-color: var(--bt-border);
  color: var(--bt-text-disabled);
}

@media (prefers-reduced-motion: reduce) {
  .bt-Checkbox__Box { transition: none; }
}

@media (forced-colors: active) {
  .bt-Checkbox__Box { border-color: CanvasText; color: CanvasText; }
  .bt-Checkbox__Input:checked + .bt-Checkbox__Box,
  .bt-Checkbox__Input:indeterminate + .bt-Checkbox__Box { background: Highlight; border-color: Highlight; color: HighlightText; }
  .bt-Checkbox__Input:focus-visible + .bt-Checkbox__Box { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* --- ChoiceList --- */
/* ChoiceList: a fieldset of Checkboxes or RadioButtons under a legend, error under the list. */
.bt-ChoiceList {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-100);
  color: var(--bt-text);
}
.bt-ChoiceList__Title {
  padding: 0;
  margin-bottom: var(--bt-space-150);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-semibold);
  color: var(--bt-text);
}
.bt-ChoiceList__Title.bt-visually-hidden { margin: 0; }
.bt-ChoiceList__Choices {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
}
.bt-ChoiceList__Choice { display: flex; flex-direction: column; gap: var(--bt-space-200); min-width: 0; }
/* Children line up with the label text: control width (size-icon-md) plus the row gap, as Choice descriptions. */
.bt-ChoiceList__Children { padding-inline-start: calc(var(--bt-size-icon-md) + var(--bt-space-200)); }
.bt-ChoiceList__Error { margin-top: var(--bt-space-100); }

/* --- CodeBlock --- */
/* CodeBlock: JetBrains Mono (code-md) on bg-code inside border-code; text and text-secondary keep 4.5:1 on
   bg-code in both themes (build.py checks the pairs). */
.bt-CodeBlock {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bt-bg-code);
  border: var(--bt-border-width-1) solid var(--bt-border-code);
  border-radius: var(--bt-radius-250);
  color: var(--bt-text);
  overflow: hidden;
}

.bt-CodeBlock__header {
  display: flex;
  align-items: center;
  gap: var(--bt-space-200);
  min-height: var(--bt-size-control-sm);
  padding: var(--bt-space-100) var(--bt-space-100) var(--bt-space-100) var(--bt-space-300);
  border-bottom: var(--bt-border-width-1) solid var(--bt-border-code);
}
.bt-CodeBlock__language {
  color: var(--bt-text-secondary);
  font-family: var(--bt-font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-CodeBlock__copy { margin-inline-start: auto; }

.bt-CodeBlock__scroll {
  margin: 0;
  padding: var(--bt-space-300) var(--bt-space-400);
  overflow: auto;
  overscroll-behavior: contain;
}
.bt-CodeBlock__scroll:focus-visible {
  /* An inset outline from the focus token: the block clips an outer shadow-focus. */
  outline: var(--bt-border-width-2) solid var(--bt-border-focus);
  outline-offset: calc(-1 * var(--bt-border-width-2));
}

.bt-CodeBlock__pre {
  white-space: pre;
  tab-size: 2;
}
.bt-CodeBlock--wrap .bt-CodeBlock__pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bt-CodeBlock__code {
  font: inherit;
  /* Code shows the characters typed: no ligatures (=>, !=), slashed zero against O. */
  font-variant-ligatures: none;
  font-feature-settings: "zero" 1;
}

/* list: recovery codes as a numbered grid. A column is as wide as the number (3ch), its gap and the longest entry
   (--bt-CodeBlock-chars, set by the component), so an entry stays on one line: two on a phone for 11-character
   recovery codes. Only an entry wider than the whole list wraps. */
.bt-CodeBlock__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, calc((var(--bt-CodeBlock-chars, 11) + 3) * 1ch + var(--bt-space-200))), 1fr));
  gap: var(--bt-space-200) var(--bt-space-400);
  margin: 0;
  padding: 0;
  list-style: none;
}
.bt-CodeBlock__item {
  /* The code-md text style comes from the list; inherit it over base.css's sans on every bt- element. */
  font: inherit;
  display: flex;
  align-items: baseline;
  gap: var(--bt-space-200);
  min-width: 0;
}
.bt-CodeBlock__number {
  font: inherit;
  min-width: 3ch;
  color: var(--bt-text-secondary);
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.bt-CodeBlock__item .bt-CodeBlock__code { overflow-wrap: anywhere; }

/* Diff: one block per line on bg-success-subtle (added) or bg-critical-subtle (removed). text keeps 14:1 or
   more and text-secondary 5:1 on both in both themes; the +/− markers in text-success / text-critical keep
   5,6:1 or more. The lines run the full scroll width, so the pre's inline padding moves onto them. */
.bt-CodeBlock__pre--diff { padding-inline: 0; }
.bt-CodeBlock__diff {
  display: block;
  width: max-content;
  min-width: 100%;
}
.bt-CodeBlock--wrap .bt-CodeBlock__diff { width: auto; }
.bt-CodeBlock__line {
  /* The code-md text style comes from the pre; inherit it over base.css's sans on every bt- element. */
  font: inherit;
  display: flex;
  padding-inline: var(--bt-space-200) var(--bt-space-400);
}
.bt-CodeBlock__line--added { background: var(--bt-bg-success-subtle); }
.bt-CodeBlock__line--removed { background: var(--bt-bg-critical-subtle); }
/* Header and hunk lines (diff --git, @@ … @@): muted, text-secondary keeps 5:1 on bg-code in both themes. */
.bt-CodeBlock__line--meta { color: var(--bt-text-secondary); }
.bt-CodeBlock__marker {
  flex: none;
  /* 2ch: the sign plus a space, in the code face. */
  width: 2ch;
  font: inherit;
  text-align: center;
  /* Pseudo-element content is never copied; user-select keeps a drag from even highlighting the column. */
  user-select: none;
  -webkit-user-select: none;
}
/* The zero-width space gives an empty line its height (pseudo content: never copied, never read). */
.bt-CodeBlock__marker::before { content: attr(data-marker) "\200B"; }
.bt-CodeBlock__line--added .bt-CodeBlock__marker { color: var(--bt-text-success); }
.bt-CodeBlock__line--removed .bt-CodeBlock__marker { color: var(--bt-text-critical); }
.bt-CodeBlock__lineText {
  font: inherit;
  color: inherit;
  min-width: 0;
}
.bt-CodeBlock--wrap .bt-CodeBlock__lineText { overflow-wrap: anywhere; }
/* The hidden "eklendi: " / "silindi: " is for screen readers only; keep it out of a selection's copy. */
.bt-CodeBlock__spoken {
  font: inherit;
  user-select: none;
  -webkit-user-select: none;
}

@media (forced-colors: active) {
  /* The backgrounds drop out; the markers still say which lines changed. */
  .bt-CodeBlock__marker { color: CanvasText; }
}

/* --- CodeInput --- */
/* CodeInput: one box per character, square at the control height (size-control-md, size-control-lg large), drawn
   like TextField (fill-secondary, border-strong line, border-focus line and bg-brand-subtle halo on focus), the
   character centred in tabular digits at heading size, space-200 apart. */
.bt-CodeInput { display: flex; flex-wrap: wrap; gap: var(--bt-space-200); }
.bt-CodeInput__Box {
  box-sizing: border-box;
  width: var(--bt-size-control-md);
  height: var(--bt-size-control-md);
  margin: 0;
  padding: 0;
  background: var(--bt-fill-secondary);
  border: var(--bt-border-width-1) solid var(--bt-border-strong);
  border-radius: var(--bt-radius-350);
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-425);
  font-weight: var(--bt-font-weight-semibold);
  font-variant-numeric: tabular-nums;
  text-align: center;
  caret-color: var(--bt-border-focus);
  transition: border-color var(--bt-duration-fast) var(--bt-ease-emphasized), box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-CodeInput__Box:hover { border-color: var(--bt-border-hover); }
.bt-CodeInput__Box:focus {
  outline: none;
  border-color: var(--bt-border-focus);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-focus), 0 0 0 var(--bt-space-100) var(--bt-bg-brand-subtle);
}
.bt-CodeInput--error .bt-CodeInput__Box,
.bt-CodeInput--error .bt-CodeInput__Box:hover { border-color: var(--bt-border-critical); }
.bt-CodeInput--error .bt-CodeInput__Box:focus {
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-critical), 0 0 0 var(--bt-space-100) var(--bt-bg-critical-subtle);
}
.bt-CodeInput__Box:disabled { background: var(--bt-fill-disabled); border-color: var(--bt-border-secondary); color: var(--bt-text-disabled); -webkit-text-fill-color: var(--bt-text-disabled); }
.bt-CodeInput--large .bt-CodeInput__Box { width: var(--bt-size-control-lg); height: var(--bt-size-control-lg); font-size: var(--bt-font-size-500); }

@media (prefers-reduced-motion: reduce) {
  .bt-CodeInput__Box { transition: none; }
}
@media (forced-colors: active) {
  .bt-CodeInput__Box { border-color: CanvasText; }
  .bt-CodeInput__Box:focus { outline: 2px solid Highlight; outline-offset: 1px; }
}

/* --- Collapsible --- */
/* Collapsible: the grid row grows from 0fr to 1fr, so the height animates to the content's own.
   Closed, the content is inert (Collapsible.tsx) and, once the motion ends, visibility: hidden, which
   also takes it out of the accessibility tree. Duration and easing: tokens, or the transition prop. */
.bt-Collapsible {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition:
    grid-template-rows var(--bt-Collapsible-duration, var(--bt-duration-base)) var(--bt-Collapsible-easing, var(--bt-ease-emphasized)),
    visibility 0s linear var(--bt-Collapsible-duration, var(--bt-duration-base));
}
.bt-Collapsible--open {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows var(--bt-Collapsible-duration, var(--bt-duration-base)) var(--bt-Collapsible-easing, var(--bt-ease-emphasized));
}
.bt-Collapsible__Content {
  min-block-size: 0;
  min-inline-size: 0;
}
/* Clipped only while closed or moving; open, the focus rings of what's inside show in full. */
.bt-Collapsible--clipped > .bt-Collapsible__Content { overflow: hidden; }

.bt-Collapsible--noTransition { transition: none; }

/* Collapsible.Item: a sunken tile (bg-surface-secondary, radius-500); open it turns to the card colour with a
   1.5px text ring (the template's), and its round plus (bg-surface) turns 45 degrees into a close mark on fill-brand. */
.bt-CollapsibleItem {
  border-radius: var(--bt-radius-500);
  background: var(--bt-bg-surface-secondary);
  color: var(--bt-text);
  transition: background-color var(--bt-duration-base) var(--bt-ease-emphasized), box-shadow var(--bt-duration-base) var(--bt-ease-emphasized);
}
.bt-CollapsibleItem + .bt-CollapsibleItem { margin-top: var(--bt-space-200); }
.bt-CollapsibleItem--open {
  background: var(--bt-bg-surface);
  box-shadow: inset 0 0 0 calc(1.5 * var(--bt-border-width-1)) var(--bt-text);
}
.bt-CollapsibleItem__heading { margin: 0; border-radius: var(--bt-radius-500); font: inherit; }
.bt-CollapsibleItem__button {
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  width: 100%;
  margin: 0;
  padding: calc(var(--bt-space-300) + var(--bt-space-050)) var(--bt-space-400);
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.bt-CollapsibleItem__button:focus { outline: none; }
.bt-CollapsibleItem__button:focus-visible { box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-focus); }
.bt-CollapsibleItem__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--bt-space-050); }
.bt-CollapsibleItem__caption {
  font: var(--bt-font-weight-semibold) var(--bt-font-size-300) / var(--bt-font-line-height-400) var(--bt-font-sans);
  color: var(--bt-text-secondary);
}
.bt-CollapsibleItem__title {
  font: var(--bt-font-weight-semibold) var(--bt-font-size-375) / var(--bt-font-line-height-500) var(--bt-font-sans);
  overflow-wrap: anywhere;
}
/* 30px round mark (size-control-sm - space-050). */
.bt-CollapsibleItem__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: calc(var(--bt-size-control-sm) - var(--bt-space-050));
  height: calc(var(--bt-size-control-sm) - var(--bt-space-050));
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface);
  color: var(--bt-text);
  transition: background-color var(--bt-duration-base) var(--bt-ease-emphasized);
}
.bt-CollapsibleItem__icon .bt-Icon { transition: transform var(--bt-duration-base) var(--bt-ease-emphasized); }
.bt-CollapsibleItem__button:hover .bt-CollapsibleItem__icon { background: var(--bt-bg-surface-hover); }
.bt-CollapsibleItem--open .bt-CollapsibleItem__icon,
.bt-CollapsibleItem--open .bt-CollapsibleItem__button:hover .bt-CollapsibleItem__icon { background: var(--bt-fill-brand); color: var(--bt-text-on-brand); }
.bt-CollapsibleItem--open .bt-CollapsibleItem__icon .bt-Icon { transform: rotate(45deg); }
.bt-CollapsibleItem__body {
  max-width: 70ch;
  padding: 0 var(--bt-space-400) var(--bt-space-400);
  font: var(--bt-font-weight-medium) var(--bt-font-size-337) / var(--bt-font-line-height-500) var(--bt-font-sans);
  color: var(--bt-text);
}
.bt-CollapsibleItem__body > :first-child { margin-top: 0; }
.bt-CollapsibleItem__body > :last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .bt-Collapsible,
  .bt-Collapsible--open { transition: none; }
  .bt-CollapsibleItem,
  .bt-CollapsibleItem__icon,
  .bt-CollapsibleItem__icon .bt-Icon { transition: none; }
}
@media (forced-colors: active) {
  .bt-CollapsibleItem { border: 1px solid CanvasText; }
  .bt-CollapsibleItem--open { border-width: 2px; }
}

@media print {
  .bt-Collapsible--expandOnPrint {
    grid-template-rows: 1fr;
    visibility: visible;
  }
  .bt-Collapsible--expandOnPrint > .bt-Collapsible__Content { overflow: visible; }
}

/* --- ColorField --- */
/* ColorField: a swatch square left of TextField's box. The native colour input fills it, invisible, so a press opens the picker. */
.bt-ColorField { min-width: 0; }
.bt-ColorField .bt-TextField__ConnectedItem { align-self: stretch; display: flex; }
.bt-ColorField__Swatch {
  position: relative;
  display: block;
  flex: none;
  box-sizing: border-box;
  width: var(--bt-size-control-md);
  min-height: var(--bt-size-control-sm);
  border: var(--bt-border-width-1) solid var(--bt-border-strong);
  border-radius: var(--bt-radius-350);
  overflow: hidden;
  transition: border-color var(--bt-duration-fast) var(--bt-ease-emphasized), box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-ColorField__Swatch:hover { border-color: var(--bt-border-hover); }
.bt-ColorField__Swatch:focus-within { border-color: var(--bt-border-focus); box-shadow: var(--bt-shadow-focus); }
/* No colour: a diagonal line through the empty square. */
.bt-ColorField__Swatch--empty {
  background: linear-gradient(
    to top right,
    transparent calc(50% - 1px),
    var(--bt-border-strong) calc(50% - 1px),
    var(--bt-border-strong) calc(50% + 1px),
    transparent calc(50% + 1px)
  ), var(--bt-fill-secondary);
}
.bt-ColorField__Swatch--disabled,
.bt-ColorField__Swatch--disabled:hover { border-color: var(--bt-border); opacity: 0.5; }
@media (prefers-reduced-motion: reduce) {
  .bt-ColorField__Swatch { transition: none; }
}
.bt-ColorField__Picker {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0;
}
.bt-ColorField__Picker:disabled { cursor: default; }

@media (forced-colors: active) {
  .bt-ColorField__Swatch { forced-color-adjust: none; border-color: CanvasText; }
  .bt-ColorField__Swatch:focus-within { outline: 2px solid Highlight; outline-offset: 1px; }
}

/* --- Combobox --- */
/* Combobox: a TextField, a Popover list under it (focus stays in the input), chips below. The Popover's box
   (card, radius, shadow) is Popover's; this file styles only the pane, the listbox and its options, after the
   template's menu items: radius-250 rows, 13.5px medium text, a soft tint on hover. */
.bt-Combobox { min-width: 0; }
.bt-Combobox__Pane { padding: var(--bt-space-150); }
.bt-Combobox__Listbox {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-025);
  max-height: 320px;
  scroll-padding-block: var(--bt-space-150);
  overflow-y: auto;
}
.bt-Combobox__Option {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--bt-space-200);
  min-height: var(--bt-size-control-md);
  box-sizing: border-box;
  padding: var(--bt-space-100) var(--bt-space-300);
  border-radius: var(--bt-radius-250);
  color: var(--bt-text);
  cursor: pointer;
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
}
.bt-Combobox__Option:hover { background: var(--bt-bg-surface-secondary); }
/* The keyboard's place in the list. Focus stays in the input, so this is the only sign of it: a ring, as on the field. */
.bt-Combobox__Option--active,
.bt-Combobox__Option--active:hover {
  background: var(--bt-bg-surface-secondary);
  box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-focus);
}
/* Chosen: semibold label and a check in text-brand at the end of the row. */
.bt-Combobox__Option--selected .bt-Combobox__OptionLabel { font-weight: var(--bt-font-weight-semibold); }
.bt-Combobox__Option--selected > .bt-Icon { color: var(--bt-text-brand); }
.bt-Combobox__Option--disabled,
.bt-Combobox__Option--disabled:hover { background: transparent; color: var(--bt-text-disabled); cursor: default; }
.bt-Combobox__OptionText { display: flex; flex-direction: column; min-width: 0; }
.bt-Combobox__OptionLabel,
.bt-Combobox__OptionDescription { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-Combobox__OptionDescription {
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-regular);
}
.bt-Combobox__Option--disabled .bt-Combobox__OptionDescription { color: inherit; }
.bt-Combobox__Message {
  padding: var(--bt-space-200) var(--bt-space-300);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
}
.bt-Combobox__Tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bt-space-100);
  min-width: 0;
  margin: var(--bt-space-200) 0 0;
  padding: 0;
  list-style: none;
}
.bt-Combobox__Tag { display: inline-flex; min-width: 0; max-width: 100%; }

@media (forced-colors: active) {
  .bt-Combobox__Option--active,
  .bt-Combobox__Option--active:hover { outline: 2px solid Highlight; outline-offset: -2px; }
  .bt-Combobox__Option--disabled { color: GrayText; }
}

/* --- CommandFinder --- */
/* CommandFinder: a bg-surface panel 12vh from the top over the bg-overlay backdrop (radius-450, a border-secondary
   ring, shadow-soft-lg), 620px wide at most. A 60px field row (search icon, 20px medium input, an esc key cap
   that closes) over a ruled scrolling list: 11px bold uppercase group headings, size-icon-chip tiles (radius-250 on
   bg-surface-secondary), a semibold title over a secondary meta line, the active row on bg-surface-secondary
   (radius-275). A footer of key hints, hidden on touch and narrow screens. Motion: duration-slow, ease-emphasized in, ease-exit out; reduced motion keeps only the fade. */
.bt-CommandFinder-root {
  position: fixed;
  inset: 0;
  z-index: var(--bt-z-modal);
}
.bt-CommandFinder-root--contained { position: absolute; z-index: var(--bt-z-overlay); }

.bt-CommandFinder__backdrop {
  position: absolute;
  inset: 0;
  background: var(--bt-bg-overlay);
  animation: bt-CommandFinder-fade-in var(--bt-duration-slow) var(--bt-ease-emphasized) both;
}
.bt-CommandFinder-root--closing .bt-CommandFinder__backdrop { animation: bt-CommandFinder-fade-out var(--bt-duration-slow) var(--bt-ease-exit) both; }

.bt-CommandFinder__container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh var(--bt-space-300) var(--bt-space-300);
  overflow: hidden;
}
.bt-CommandFinder-root--contained .bt-CommandFinder__container { padding-top: var(--bt-space-1000); }

.bt-CommandFinder {
  display: flex;
  flex-direction: column;
  /* No width token: the template's 620px. */
  width: 620px;
  max-width: 100%;
  max-height: 100%;
  background: var(--bt-bg-surface);
  color: var(--bt-text);
  border-radius: var(--bt-radius-450);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary), var(--bt-shadow-soft-lg);
  outline: none;
  overflow: hidden;
  font-family: var(--bt-font-sans);
  /* backwards, not both: no transform left once open, so portaled popovers are placed against the viewport. */
  animation: bt-CommandFinder-in var(--bt-duration-slow) var(--bt-ease-emphasized) backwards;
}
.bt-CommandFinder:focus { outline: none; }
.bt-CommandFinder-root--closing .bt-CommandFinder { animation: bt-CommandFinder-out var(--bt-duration-slow) var(--bt-ease-exit) both; }
.bt-CommandFinder-root--instant .bt-CommandFinder,
.bt-CommandFinder-root--instant .bt-CommandFinder__backdrop { animation: none; }

/* Field row */
.bt-CommandFinder__field {
  display: flex;
  align-items: center;
  flex: none;
  gap: calc(var(--bt-space-200) + var(--bt-space-050));
  /* 60px: no size token (size-control-lg + space-300). */
  height: calc(var(--bt-size-control-lg) + var(--bt-space-300));
  padding: 0 var(--bt-space-400);
  border-bottom: var(--bt-border-width-1) solid var(--bt-border-secondary);
}
.bt-CommandFinder__fieldIcon { display: inline-flex; flex: none; color: var(--bt-text-secondary); }
.bt-CommandFinder__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bt-text);
  font: inherit;
  font-size: var(--bt-font-size-500);
  font-weight: var(--bt-font-weight-medium);
  outline: none;
}
.bt-CommandFinder__input::placeholder { color: var(--bt-text-secondary); opacity: 1; }
/* The field row is the focus indicator: the input sits on the panel with no box of its own. */
.bt-CommandFinder__field:has(.bt-CommandFinder__input:focus-visible) { border-bottom-color: var(--bt-border-focus); }
.bt-CommandFinder__input::-webkit-search-cancel-button { display: none; }

.bt-CommandFinder__close {
  display: inline-flex;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  border-radius: var(--bt-radius-200);
  cursor: pointer;
}
.bt-CommandFinder__close:hover .bt-Kbd { color: var(--bt-text); box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-hover); }
.bt-CommandFinder__close:focus-visible { outline: var(--bt-border-width-2) solid var(--bt-border-focus); outline-offset: var(--bt-space-050); }

/* Results */
.bt-CommandFinder__results {
  flex: 1 1 auto;
  min-height: 0;
  /* min(56vh, 460px), as the template. */
  max-height: min(56vh, 460px);
  padding: var(--bt-space-200);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bt-CommandFinder__results:not(:has(.bt-CommandFinder__item, .bt-CommandFinder__loading, .bt-CommandFinder__empty)) { display: none; }

.bt-CommandFinder__groupTitle {
  padding: calc(var(--bt-space-200) + var(--bt-space-050)) calc(var(--bt-space-200) + var(--bt-space-050)) var(--bt-space-100);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-275);
  line-height: var(--bt-font-line-height-400);
  font-weight: var(--bt-font-weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bt-CommandFinder__item {
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  width: 100%;
  padding: var(--bt-space-200) calc(var(--bt-space-200) + var(--bt-space-050));
  border-radius: var(--bt-radius-275);
  color: var(--bt-text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-CommandFinder__item--active { background: var(--bt-bg-surface-secondary); }

.bt-CommandFinder__media {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--bt-size-icon-chip);
  height: var(--bt-size-icon-chip);
  border-radius: var(--bt-radius-250);
  background: var(--bt-bg-surface-secondary);
  color: var(--bt-text);
  overflow: hidden;
}
.bt-CommandFinder__item--active .bt-CommandFinder__media:not(.bt-CommandFinder__media--custom) {
  background: var(--bt-bg-surface);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
}
.bt-CommandFinder__media--custom { background: none; }

.bt-CommandFinder__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bt-CommandFinder__title,
.bt-CommandFinder__meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bt-CommandFinder__title {
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-semibold);
}
.bt-CommandFinder__meta {
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-medium);
}
.bt-CommandFinder__shortcut { display: inline-flex; flex: none; }
.bt-CommandFinder__go { display: inline-flex; flex: none; color: var(--bt-text-secondary); opacity: 0; transition: opacity var(--bt-duration-fast) var(--bt-ease-emphasized); }
.bt-CommandFinder__item--active .bt-CommandFinder__go { opacity: 1; color: var(--bt-text); }

.bt-CommandFinder__loading {
  display: flex;
  align-items: center;
  gap: var(--bt-space-200);
  padding: var(--bt-space-300) calc(var(--bt-space-200) + var(--bt-space-050));
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-337);
  font-weight: var(--bt-font-weight-medium);
}
.bt-CommandFinder__empty { padding: var(--bt-space-200) 0; }

/* Footer */
.bt-CommandFinder__footer {
  display: flex;
  flex: none;
  gap: var(--bt-space-400);
  padding: calc(var(--bt-space-200) + var(--bt-space-050)) var(--bt-space-400);
  border-top: var(--bt-border-width-1) solid var(--bt-border-secondary);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-300);
  font-weight: var(--bt-font-weight-medium);
}
.bt-CommandFinder__footer > span { display: inline-flex; align-items: center; gap: var(--bt-space-150); }

@media (max-width: 767.98px) {
  .bt-CommandFinder__container { padding-top: calc(calc(var(--bt-space-200) + var(--bt-space-050)) + env(safe-area-inset-top)); }
  .bt-CommandFinder__results { max-height: min(64dvh, 520px); }
  .bt-CommandFinder__footer { display: none; }
}
@media (pointer: coarse) {
  .bt-CommandFinder__footer { display: none; }
  .bt-CommandFinder__item { min-height: var(--bt-size-control-lg); }
}

@keyframes bt-CommandFinder-in {
  from { opacity: 0; transform: translateY(calc(-1 * var(--bt-space-400))) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-CommandFinder-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(calc(-1 * var(--bt-space-200))) scale(0.97); }
}
@keyframes bt-CommandFinder-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bt-CommandFinder-fade-out { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .bt-CommandFinder { animation-name: bt-CommandFinder-fade-in; }
  .bt-CommandFinder-root--closing .bt-CommandFinder { animation-name: bt-CommandFinder-fade-out; }
  .bt-CommandFinder__item, .bt-CommandFinder__go { transition: none; }
}

@media (forced-colors: active) {
  .bt-CommandFinder { border: 1px solid CanvasText; }
  .bt-CommandFinder__item--active { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* --- CopyChip --- */
/* CopyChip: a pill. code-sm (12/16) on bg-code with an inset border-code line, 24px high (the micro button's
   height, below a slim control), the round micro icon button at its end; text and text-secondary keep 4.5:1 on bg-code in both themes (build.py checks the pairs).
   An inline grid takes its baseline from the value, so the chip sits on the line of a sentence. The value's track
   is minmax(0, max-content): the chip's min-content is the button alone, so a table column or a narrow box can
   shrink it and the value truncates, while with room it is as wide as the value. --whole (truncate={false}) keeps
   the whole value on one line as its min-content, so a table column never shrinks below it. */
.bt-CopyChip {
  display: inline-grid;
  grid-template-columns: minmax(0, max-content) auto;
  align-items: center;
  max-width: 100%;
  min-height: calc(var(--bt-size-control-sm) - var(--bt-space-200));
  padding-inline-start: var(--bt-space-300);
  padding-inline-end: var(--bt-space-025);
  background: var(--bt-bg-code);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-code);
  border-radius: var(--bt-radius-full);
  color: var(--bt-text);
  vertical-align: baseline;
}
.bt-CopyChip--subdued { color: var(--bt-text-secondary); }
.bt-CopyChip__value {
  /* code-sm, on the value itself: base.css gives every bt- element the sans font. */
  font-family: var(--bt-font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: text;
}
.bt-CopyChip--whole { grid-template-columns: auto auto; }
/* maxWidth: a plain length, never a percentage (in a growing table cell a percentage would not hold). */
.bt-CopyChip--maxWidth { max-width: var(--bt-CopyChip-max); }
.bt-CopyChip--whole .bt-CopyChip__value { overflow: visible; }
.bt-CopyChip__copy { display: inline-flex; align-self: center; margin-inline-start: var(--bt-space-100); }
.bt-CopyChip__copy .bt-Button { color: var(--bt-text-secondary); }
.bt-CopyChip__copy .bt-Button:hover { color: var(--bt-text); }

@media (forced-colors: active) {
  .bt-CopyChip { border: 1px solid CanvasText; }
}

/* --- CountryFlag --- */
/* CountryFlag: a clipped neutral tile (4:3, or a circle) with the ISO code in it and the sprite's flag over the code,
   cropped to fill (--bt-CountryFlag-h is the height). The code shows where the flag is missing or not loaded yet. */
.bt-CountryFlag {
  --bt-CountryFlag-h: var(--bt-space-500);
  position: relative;
  display: inline-block;
  flex: none;
  vertical-align: middle;
  block-size: var(--bt-CountryFlag-h);
  inline-size: calc(var(--bt-CountryFlag-h) * 4 / 3);
  overflow: hidden;
  border-radius: var(--bt-radius-100);
  background: var(--bt-bg-surface-secondary);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
}
.bt-CountryFlag--sizeSmall { --bt-CountryFlag-h: var(--bt-space-400); }
.bt-CountryFlag--sizeLarge { --bt-CountryFlag-h: var(--bt-space-800); }
.bt-CountryFlag--round { inline-size: var(--bt-CountryFlag-h); border-radius: var(--bt-radius-full); }
.bt-CountryFlag__Code {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--bt-font-sans);
  font-size: calc(var(--bt-CountryFlag-h) * 0.5);
  font-weight: 600;
  line-height: 1;
  color: var(--bt-text-secondary);
}
.bt-CountryFlag__Svg { position: absolute; inset: 0; display: block; inline-size: 100%; block-size: 100%; }

/* --- DataTable --- */
/* DataTable: IndexTable's plain read-only sibling. A real <table> on bg-surface; put it in a Card without padding
   (the card's radius-600 corners clip it). Same look as IndexTable:
   header: 12px semibold in text-secondary on the card colour, a border-secondary hairline below; rows: 13.5px medium
   in text, border-secondary dividers, hover bg-surface-hover; totals: bold, border above. Numeric columns end-aligned
   in tabular figures, headings included. Sideways scroll inside a focusable region; the first column can stay put. */
.bt-DataTable {
  --bt-dt-pad-block: var(--bt-space-300);
  --bt-dt-pad-inline: var(--bt-space-400);
  position: relative;
  background: var(--bt-bg-surface);
  color: var(--bt-text);
}
.bt-DataTable--condensed { --bt-dt-pad-block: var(--bt-space-200); }

.bt-DataTable__Scroll { position: relative; overflow-x: auto; }
.bt-DataTable__Scroll:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }

.bt-DataTable__Table {
  inline-size: 100%;
  border-collapse: separate; /* sticky cells keep their borders only with separate borders */
  border-spacing: 0;
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
  font-variant-numeric: tabular-nums lining-nums;
  /* Words stay whole (a name never breaks mid-word on a phone): an inherited overflow-wrap: anywhere (a Modal, a
     Banner) would let auto layout squeeze columns to single letters; the table scrolls sideways instead. */
  overflow-wrap: normal;
  word-break: normal;
}

.bt-DataTable__Caption {
  padding: var(--bt-space-400) var(--bt-dt-pad-inline) var(--bt-space-200);
  color: var(--bt-text);
  font-size: var(--bt-font-size-375);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-semibold);
  text-align: start;
  caption-side: top;
}

/* --- cells (heading, body, totals share padding and alignment) --------------------- */
.bt-DataTable__Cell {
  padding-block: var(--bt-dt-pad-block);
  padding-inline: var(--bt-dt-pad-inline);
  background: var(--bt-bg-surface);
  border-block-end: var(--bt-border-width-1) solid var(--bt-border-secondary);
  font-weight: inherit;
  text-align: start;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-DataTable--valignTop .bt-DataTable__Cell { vertical-align: top; }
.bt-DataTable--valignMiddle .bt-DataTable__Cell { vertical-align: middle; }
.bt-DataTable--valignBottom .bt-DataTable__Cell { vertical-align: bottom; }
.bt-DataTable--valignBaseline .bt-DataTable__Cell { vertical-align: baseline; }

.bt-DataTable__Cell--numeric { text-align: end; white-space: nowrap; }

/* --- header ------------------------------------------------------------------------ */
.bt-DataTable__Heading {
  block-size: var(--bt-size-control-md);
  padding-block: var(--bt-space-100);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-400);
  font-weight: var(--bt-font-weight-semibold);
  vertical-align: middle !important; /* headings stay centred whatever the body's verticalAlign */
  white-space: nowrap;
}
.bt-DataTable--condensed .bt-DataTable__Heading { block-size: var(--bt-size-control-sm); padding-block: var(--bt-space-050); }

.bt-DataTable__SortButton {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-100);
  margin-inline: calc(var(--bt-space-150) * -1);
  padding: var(--bt-space-050) var(--bt-space-150);
  border: 0;
  border-radius: var(--bt-radius-200);
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  cursor: pointer;
  transition: color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-DataTable__Cell--numeric .bt-DataTable__SortButton { flex-direction: row-reverse; }
.bt-DataTable__SortButton:hover,
.bt-DataTable__SortButton--active { color: var(--bt-text); }
.bt-DataTable__SortButton:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-DataTable__SortIcon { display: inline-flex; opacity: 0; transition: opacity var(--bt-duration-fast) var(--bt-ease-emphasized); }
.bt-DataTable__SortButton:hover .bt-DataTable__SortIcon,
.bt-DataTable__SortButton:focus-visible .bt-DataTable__SortIcon,
.bt-DataTable__SortButton--active .bt-DataTable__SortIcon { opacity: 1; }

/* --- body ---------------------------------------------------------------------------- */
tbody > .bt-DataTable__Row:last-child > .bt-DataTable__Cell { border-block-end: 0; }
.bt-DataTable--zebra tbody > .bt-DataTable__Row:nth-child(even) > .bt-DataTable__Cell { background: var(--bt-bg-surface-hover); }
.bt-DataTable--hoverable tbody > .bt-DataTable__Row:hover > .bt-DataTable__Cell { background: var(--bt-bg-surface-hover); }
/* A striped row under the pointer goes one step further, so the hover still shows. */
.bt-DataTable--zebra.bt-DataTable--hoverable tbody > .bt-DataTable__Row:nth-child(even):hover > .bt-DataTable__Cell { background: var(--bt-bg-surface-secondary); }

/* The first column truncates instead of wrapping, at half the text measure (20rem); the limit sits on the inner
   span because table cells ignore max-width. */
.bt-DataTable__Truncate { display: block; max-inline-size: calc(var(--bt-size-text-measure) / 2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- totals: bold on the card, a full border line between them and the rows ----------- */
.bt-DataTable__Total {
  font-weight: var(--bt-font-weight-bold);
  white-space: nowrap;
}
thead .bt-DataTable__Total { border-block-end-color: var(--bt-border); }
tfoot .bt-DataTable__Total { border-block-start: var(--bt-border-width-1) solid var(--bt-border); border-block-end: 0; }

/* --- fixed first column ---------------------------------------------------------------- */
.bt-DataTable--fixedFirstColumn .bt-DataTable__Cell--first { position: sticky; inset-inline-start: 0; z-index: 1; }
.bt-DataTable--fixedFirstColumn.bt-DataTable--scrolledStart .bt-DataTable__Cell--first {
  box-shadow: inset calc(var(--bt-border-width-1) * -1) 0 0 var(--bt-border);
}
/* The line sits on the inline-end edge; box-shadow offsets are physical, so flip it right to left. */
.bt-DataTable--fixedFirstColumn.bt-DataTable--scrolledStart .bt-DataTable__Cell--first:dir(rtl) {
  box-shadow: inset var(--bt-border-width-1) 0 0 var(--bt-border);
}

/* --- footer: a quiet note under the rows ----------------------------------------------- */
.bt-DataTable__Footer {
  padding: var(--bt-space-300) var(--bt-dt-pad-inline);
  border-block-start: var(--bt-border-width-1) solid var(--bt-border-secondary);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-medium);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .bt-DataTable__Cell,
  .bt-DataTable__SortButton,
  .bt-DataTable__SortIcon { transition: none; }
}

@media (forced-colors: active) {
  .bt-DataTable__SortButton:focus-visible,
  .bt-DataTable__Scroll:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* --- DataVizPalette --- */
/* DataVizPalette: swatch rows of one data-viz color group, on viz-surface. Labels wear text tokens, never the swatch color. */
.bt-DataVizPalette {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
  color: var(--bt-viz-label);
  font-family: var(--bt-font-sans);
}

.bt-DataVizPalette__title {
  margin: 0;
  font-size: var(--bt-font-size-350);
  line-height: 1.4;
  font-weight: 600;
}

.bt-DataVizPalette__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bt-space-300);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bt-DataVizPalette__item {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-100);
  min-width: 0;
}

.bt-DataVizPalette__swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--bt-size-control-md);
  height: var(--bt-size-control-md);
  /* Round-cornered tiles like the template's inner tiles (radius-250, 10px). */
  border-radius: var(--bt-radius-250);
  /* viz-ring: the hairline that keeps light steps visible on viz-surface. */
  box-shadow: inset 0 0 0 1px var(--bt-viz-ring);
  font-size: var(--bt-font-size-337);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bt-DataVizPalette__swatch--white { color: var(--bt-viz-on-fill); }
.bt-DataVizPalette__swatch--ink { color: var(--bt-viz-on-fill-alt); }

.bt-DataVizPalette__label {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-100);
  font-size: var(--bt-font-size-312);
  line-height: 1.4;
  font-weight: 600;
  color: var(--bt-viz-label);
  white-space: nowrap;
}

.bt-DataVizPalette__token {
  font-family: var(--bt-font-mono);
  font-size: var(--bt-font-size-275);
  line-height: 1.4;
  color: var(--bt-viz-label-muted);
  white-space: nowrap;
}

/* Ramps (sequential, diverging): one strip with 2px surface gaps, the steps sharing the width. */
.bt-DataVizPalette--ramp .bt-DataVizPalette__list { flex-wrap: nowrap; gap: var(--bt-space-050); }
.bt-DataVizPalette--ramp .bt-DataVizPalette__item { flex: 1 1 0; }
.bt-DataVizPalette--ramp .bt-DataVizPalette__swatch { width: 100%; height: var(--bt-space-800); border-radius: 0; }
.bt-DataVizPalette--ramp .bt-DataVizPalette__item:first-child .bt-DataVizPalette__swatch {
  border-start-start-radius: var(--bt-radius-full);
  border-end-start-radius: var(--bt-radius-full);
}
.bt-DataVizPalette--ramp .bt-DataVizPalette__item:last-child .bt-DataVizPalette__swatch {
  border-start-end-radius: var(--bt-radius-full);
  border-end-end-radius: var(--bt-radius-full);
}
/* Ramps name their tokens once, under the strip (bt-DataVizPalette__caption), so nothing truncates. */
.bt-DataVizPalette__caption { white-space: normal; overflow-wrap: anywhere; }

/* Status: the color is a small mark; the icon and the word carry the meaning. */
.bt-DataVizPalette--status .bt-DataVizPalette__swatch { width: var(--bt-size-control-md); height: var(--bt-space-300); border-radius: var(--bt-radius-full); }

@media (forced-colors: active) {
  .bt-DataVizPalette__swatch { forced-color-adjust: none; outline: 1px solid CanvasText; }
}

/* --- DateField --- */
/* DateField: a TextField whose calendar button (TextField connectedRight, wrapped in its Popover) sits inside the
   field's box at the trailing end, an icon in the box rather than a separate control: a round tertiary Button one
   step smaller than the field (24 / 32 / 40 in a 32 / 40 / 48 field). The field keeps every TextField state (hover,
   focus halo, error, disabled); the input's text stops short of the button. Tab order stays input, then button. */
.bt-DateField { min-width: 0; }

.bt-DateField .bt-TextField__Connected { position: relative; gap: 0; }
.bt-DateField .bt-TextField__ConnectedItem {
  position: absolute;
  inset-block: 0;
  inset-inline-end: var(--bt-space-100);
  z-index: 3; /* over the field, which rises to 1 (error) or 2 (focus) in TextField's connected layout */
  display: flex;
  align-items: center;
}
.bt-DateField .bt-TextField { padding-inline-end: calc(var(--bt-size-control-sm) + var(--bt-space-200)); }
.bt-DateField--slim .bt-TextField { padding-inline-end: calc(var(--bt-size-control-sm) - var(--bt-space-050)); }
.bt-DateField--slim .bt-TextField__ConnectedItem { inset-inline-end: var(--bt-space-050); }
.bt-DateField--large .bt-TextField { padding-inline-end: calc(var(--bt-size-control-md) + var(--bt-space-300)); }
/* The pointer on the button still hovers the box. */
.bt-DateField .bt-TextField__Connected:hover .bt-TextField:not(.bt-TextField--error):not(.bt-TextField--disabled):not(:focus-within) {
  border-color: var(--bt-border-hover);
}
/* The icon in secondary text, as the field's other adornments; full text on hover and while the calendar is open. */
.bt-DateField .bt-TextField__ConnectedItem .bt-Button { --bt-btn-fg: var(--bt-text-secondary); }
.bt-DateField .bt-TextField__ConnectedItem .bt-Button:hover,
.bt-DateField .bt-TextField__ConnectedItem .bt-Button[aria-expanded='true'] { --bt-btn-fg: var(--bt-text); }
.bt-DateField .bt-TextField__ConnectedItem .bt-Button[aria-expanded='true']:not(.bt-Button--disabled) { --bt-btn-bg: var(--bt-bg-surface-active); }

/* The calendar panel: one month is at least seven day cells wide (DatePicker's own minimum); two months
   (multiMonth) take what they need inside the fluid popover. */
.bt-DateField__Panel { min-width: calc(7 * var(--bt-size-control-md)); }
.bt-DateField__Panel:focus { outline: none; }

/* --- DatePicker --- */
/* DatePicker: an inline month grid (or two). Days are round size-date-cell (36px) buttons in 40px cells. A picked day (and a
   range's two ends) is the strong fill (fill-strong + text-on-strong: ink in light, garnet in dark, like a selected
   chip); the days between a range's ends sit on a soft band of bg-surface-selected that runs unbroken along a week
   and rounds off where the range, a row or the month ends. Today wears a garnet ring (border-brand, 3:1 on the
   surface). Disabled days are struck through, so none of the states rely on colour alone (aria-pressed, aria-current
   and aria-disabled carry them for assistive technology). */
.bt-DatePicker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bt-space-800);
  min-width: 0;
}
.bt-DatePicker__month {
  flex: 1 1 0;
  /* 7 day cells of size-control-md: the narrowest a month can be before the two stack. */
  min-width: calc(7 * var(--bt-size-control-md));
  max-width: calc(7 * var(--bt-size-control-md) + var(--bt-space-800));
}

.bt-DatePicker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bt-space-200);
  margin-bottom: var(--bt-space-300);
}
.bt-DatePicker__navSpacer { flex: none; width: var(--bt-size-control-sm); height: var(--bt-size-control-sm); }
.bt-DatePicker__title {
  flex: 1 1 auto;
  text-align: center;
  color: var(--bt-text);
  font-family: var(--bt-font-display);
  font-size: var(--bt-font-size-375);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-semibold);
  letter-spacing: -0.005em;
}

.bt-DatePicker__grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.bt-DatePicker__weekday {
  padding: 0 0 var(--bt-space-200);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-400);
  font-weight: var(--bt-font-weight-semibold);
  text-align: center;
}

.bt-DatePicker__cell {
  position: relative;
  padding: 0;
  text-align: center;
  height: var(--bt-size-control-md);
}
/* The range band, drawn behind the day buttons across whole cells so it runs unbroken along a week; as tall as a day. */
.bt-DatePicker__cell--inRange::before,
.bt-DatePicker__cell--preview::before {
  content: '';
  position: absolute;
  inset: var(--bt-space-050) 0;
  background: var(--bt-bg-surface-selected);
}
/* Pill ends where the band meets a row's edge or the month's first or last day (an empty cell). */
.bt-DatePicker__cell--inRange:first-child::before,
.bt-DatePicker__cell:not(.bt-DatePicker__cell--inRange) + .bt-DatePicker__cell--inRange::before {
  border-start-start-radius: var(--bt-radius-full);
  border-end-start-radius: var(--bt-radius-full);
}
.bt-DatePicker__cell--inRange:last-child::before,
.bt-DatePicker__cell--inRange:has(+ .bt-DatePicker__cell:not(.bt-DatePicker__cell--inRange))::before {
  border-start-end-radius: var(--bt-radius-full);
  border-end-end-radius: var(--bt-radius-full);
}
/* While a range is being picked, the hover / focus preview is the band's outline only, dashed. */
.bt-DatePicker__cell--preview::before {
  background: transparent;
  border-block: var(--bt-border-width-1) dashed var(--bt-border-strong);
}
.bt-DatePicker__cell--rangeStart::before { inset-inline-start: 50%; }
.bt-DatePicker__cell--rangeEnd::before { inset-inline-end: 50%; }

.bt-DatePicker__day {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--bt-size-date-cell);
  max-width: 100%;
  height: var(--bt-size-date-cell);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--bt-radius-full);
  background: transparent;
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized), color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-DatePicker__day:hover { background: var(--bt-bg-surface-secondary); }
.bt-DatePicker__day:active { background: var(--bt-bg-surface-active); }
/* A middle day of a range: a hover that differs from the band. Endpoints and disabled days keep their own rules
   (the :not()s keep this more specific rule off them). */
.bt-DatePicker__cell--inRange .bt-DatePicker__day:not(.bt-DatePicker__day--selected):not(.bt-DatePicker__day--disabled):hover,
.bt-DatePicker__cell--inRange .bt-DatePicker__day:not(.bt-DatePicker__day--selected):not(.bt-DatePicker__day--disabled):active {
  background: var(--bt-bg-surface-active);
}
.bt-DatePicker__day:focus { outline: none; }
.bt-DatePicker__day:focus-visible { box-shadow: var(--bt-shadow-focus); z-index: 1; }

.bt-DatePicker__day--selected,
.bt-DatePicker__day--selected:hover { background: var(--bt-fill-strong); color: var(--bt-text-on-strong); font-weight: var(--bt-font-weight-semibold); }
.bt-DatePicker__day--selected:hover { background: var(--bt-fill-strong-hover); }
.bt-DatePicker__day--selected:active { background: var(--bt-fill-strong-active); }

/* Today: a garnet ring inside the circle; on a picked day the ring turns text-on-strong, set in from the edge. */
.bt-DatePicker__day--today { font-weight: var(--bt-font-weight-semibold); box-shadow: inset 0 0 0 calc(1.5 * var(--bt-border-width-1)) var(--bt-border-brand); }
.bt-DatePicker__day--today:focus-visible { box-shadow: var(--bt-shadow-focus), inset 0 0 0 calc(1.5 * var(--bt-border-width-1)) var(--bt-border-brand); }
.bt-DatePicker__day--selected.bt-DatePicker__day--today { box-shadow: inset 0 0 0 calc(3 * var(--bt-border-width-1)) var(--bt-fill-strong), inset 0 0 0 calc(4.5 * var(--bt-border-width-1)) var(--bt-text-on-strong); }
.bt-DatePicker__day--selected.bt-DatePicker__day--today:focus-visible {
  box-shadow: var(--bt-shadow-focus), inset 0 0 0 calc(3 * var(--bt-border-width-1)) var(--bt-fill-strong), inset 0 0 0 calc(4.5 * var(--bt-border-width-1)) var(--bt-text-on-strong);
}

/* Disabled: still focusable (announced as unavailable), not pickable; struck through so it does not rely on color. */
.bt-DatePicker__day--disabled,
.bt-DatePicker__day--disabled:hover,
.bt-DatePicker__day--disabled:active {
  background: transparent;
  color: var(--bt-text-disabled);
  text-decoration: line-through;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .bt-DatePicker__day { transition: none; }
}
@media (forced-colors: active) {
  .bt-DatePicker__day--selected { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .bt-DatePicker__cell--inRange::before { border-block: 1px solid Highlight; }
  .bt-DatePicker__day--today { box-shadow: none; outline: 1px solid CanvasText; outline-offset: -3px; }
  .bt-DatePicker__day:focus-visible { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* --- DateRangeField --- */
/* DateRangeField: the closed field is Select's box (the same line, focus halo and sizes) with a calendar icon at the
   start; a preset's dates follow its name in text-secondary. The panel (a Popover): the presets as a column of
   pill rows on the left (the chosen one filled: fill-strong + text-on-strong, as a selected chip), the calendar on
   the right with the span written above it and İptal / Uygula under it. Below 768px the presets wrap as chips
   above one month. */
.bt-DateRangeField { min-width: 0; }
.bt-DateRangeField__Icon { display: inline-flex; flex: none; color: var(--bt-text-secondary); }
.bt-Select--disabled .bt-DateRangeField__Icon { color: var(--bt-text-disabled); }
.bt-DateRangeField__Dates { margin-inline-start: var(--bt-space-200); color: var(--bt-text-secondary); font-weight: var(--bt-font-weight-regular); }

.bt-DateRangeField__Panel {
  display: flex;
  gap: var(--bt-space-400);
  padding: var(--bt-space-400);
}
.bt-DateRangeField__Panel:focus { outline: none; }
.bt-DateRangeField__Presets {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: var(--bt-space-050);
  min-width: 9.5rem;
  padding-inline-end: var(--bt-space-400);
  border-inline-end: var(--bt-border-width-1) solid var(--bt-border-secondary);
}
.bt-DateRangeField__Preset {
  display: flex;
  align-items: center;
  min-height: var(--bt-size-control-sm);
  margin: 0;
  padding: var(--bt-space-150) var(--bt-space-300);
  border: 0;
  border-radius: var(--bt-radius-full);
  background: transparent;
  color: var(--bt-text);
  font: inherit;
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
  text-align: start;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-DateRangeField__Preset:hover { background: var(--bt-bg-surface-hover); }
.bt-DateRangeField__Preset:focus-visible { outline: var(--bt-border-width-2) solid var(--bt-border-focus); outline-offset: var(--bt-border-width-1); }
.bt-DateRangeField__Preset--selected,
.bt-DateRangeField__Preset--selected:hover { background: var(--bt-fill-strong); color: var(--bt-text-on-strong); }

.bt-DateRangeField__Calendar { display: flex; flex-direction: column; gap: var(--bt-space-300); min-width: 0; }
.bt-DateRangeField__Summary {
  color: var(--bt-text);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-semibold);
}
.bt-DateRangeField__Footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--bt-space-200);
  padding-top: var(--bt-space-300);
  border-top: var(--bt-border-width-1) solid var(--bt-border-secondary);
}

/* Below breakpoint-md (768px): presets as wrapping chips above one month. */
@media (max-width: 767.98px) {
  .bt-DateRangeField__Panel { flex-direction: column; gap: var(--bt-space-300); padding: var(--bt-space-300); }
  .bt-DateRangeField__Presets {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
    padding: 0 0 var(--bt-space-300);
    border-inline-end: 0;
    border-bottom: var(--bt-border-width-1) solid var(--bt-border-secondary);
  }
  .bt-DateRangeField__Preset { box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border); }
  .bt-DateRangeField__Preset--selected { box-shadow: none; }
  .bt-DateRangeField__Footer > * { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bt-DateRangeField__Preset { transition: none; }
}
@media (forced-colors: active) {
  .bt-DateRangeField__Preset--selected { outline: 2px solid Highlight; }
}

/* --- DateTimeField --- */
/* DateTimeField: a fieldset with the label as its legend (the Labelled label look), a DateField and a TimeField on
   one row (the time part 7.5rem wide, enough for "ss:dd" at every size), help and error under both as in Labelled.
   On phones the two stay on one row; the date part gives way. */
.bt-DateTimeField {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-100);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.bt-DateTimeField__Legend {
  float: left; /* a legend that floats sits inside the flow like a label, without the fieldset's notch */
  width: 100%;
  margin-bottom: var(--bt-space-100);
  padding: 0;
}
.bt-DateTimeField__Legend.bt-visually-hidden { float: none; }
.bt-DateTimeField--disabled .bt-DateTimeField__Legend { color: var(--bt-text-secondary); }
.bt-DateTimeField__Parts {
  clear: both;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem;
  gap: var(--bt-space-200);
}
.bt-DateTimeField__Date,
.bt-DateTimeField__Time { min-width: 0; }

/* --- DescriptionList --- */
/* DescriptionList: a real dl in a wrapper that is its size container. Terms label-sm (12px semibold) in
   text-secondary, descriptions body-md at medium weight in text (the template's muted key over a firm value).
   Narrow lists: each term above its description. When the list itself is at
   least 480px wide (a container query, so a oneThird column stays stacked on a wide screen): terms in a third,
   descriptions in the rest, a border-secondary hairline between the pairs. `gap` sets the space around each
   pair. alignEnd: values flush with the end edge (the template's summary list); the term column then takes only
   what it needs. */
.bt-DescriptionList {
  --bt-dl-gap: var(--bt-space-400);
  /* inline-size containment: the wrapper's width never comes from its content, so it takes the full width
     of its box (width: 100% keeps it from shrinking to nothing in a shrink-to-fit parent). */
  container-type: inline-size;
  width: 100%;
}
.bt-DescriptionList--tight { --bt-dl-gap: var(--bt-space-200); }

.bt-DescriptionList__List {
  margin: 0;
  color: var(--bt-text);
}

.bt-DescriptionList__Term {
  margin: 0;
  padding-block-start: var(--bt-dl-gap);
  padding-block-end: var(--bt-space-100);
  color: var(--bt-text-secondary);
}
.bt-DescriptionList__Description {
  margin: 0;
  padding-block-end: var(--bt-dl-gap);
  color: var(--bt-text);
  font-weight: var(--bt-font-weight-medium);
  overflow-wrap: anywhere;
}
.bt-DescriptionList__Term:first-child { padding-block-start: 0; }
.bt-DescriptionList__Description:last-child { padding-block-end: 0; }

/* 480px: the list's own width (no token: container queries can't read custom properties). Below it a third
   for the terms would be under 160px, too narrow for "Oluşturulma tarihi". */
@container (min-width: 480px) {
  .bt-DescriptionList__List {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: 0; /* the hairline runs unbroken under both columns */
  }
  .bt-DescriptionList__Term,
  .bt-DescriptionList__Description { padding-block: var(--bt-dl-gap); }
  .bt-DescriptionList__Term { grid-column: 1; padding-inline-end: var(--bt-space-400); }
  .bt-DescriptionList__Description { grid-column: 2; }
  .bt-DescriptionList__Term:not(:first-child),
  .bt-DescriptionList__Term:not(:first-child) + .bt-DescriptionList__Description {
    border-block-start: var(--bt-border-width-1) solid var(--bt-border-secondary);
  }
  .bt-DescriptionList__Term:first-child,
  .bt-DescriptionList__Term:first-child + .bt-DescriptionList__Description { padding-block-start: 0; }
  .bt-DescriptionList__Description:last-child,
  .bt-DescriptionList__Term:nth-last-child(2) { padding-block-end: 0; }
  /* The term sits on the value's first line: 12px over a 20px line, nudged to share its baseline. */
  .bt-DescriptionList__Term { padding-block-start: calc(var(--bt-dl-gap) + var(--bt-space-050)); }
  .bt-DescriptionList__Term:first-child { padding-block-start: var(--bt-space-050); }

  .bt-DescriptionList--alignEnd .bt-DescriptionList__List { grid-template-columns: auto minmax(0, 1fr); }
  .bt-DescriptionList--alignEnd .bt-DescriptionList__Term { padding-inline-end: var(--bt-space-500); }
  .bt-DescriptionList--alignEnd .bt-DescriptionList__Description { text-align: end; }
}

/* alignEnd under 480px: still side by side, the term column at most half the list (a long term wraps there),
   the value flush with the end edge; no hairlines, `gap` between the pairs. */
@container (max-width: 479.98px) {
  .bt-DescriptionList--alignEnd .bt-DescriptionList__List {
    display: grid;
    grid-template-columns: fit-content(50%) minmax(0, 1fr);
  }
  .bt-DescriptionList--alignEnd .bt-DescriptionList__Term {
    grid-column: 1;
    padding-block: calc(var(--bt-dl-gap) + var(--bt-space-050)) 0;
    padding-inline-end: var(--bt-space-400);
  }
  .bt-DescriptionList--alignEnd .bt-DescriptionList__Description {
    grid-column: 2;
    padding-block: var(--bt-dl-gap) 0;
    text-align: end;
  }
  .bt-DescriptionList--alignEnd .bt-DescriptionList__Term:first-child { padding-block-start: var(--bt-space-050); }
  .bt-DescriptionList--alignEnd .bt-DescriptionList__Term:first-child + .bt-DescriptionList__Description { padding-block-start: 0; }
}

/* --- DiffView --- */
/* DiffView: a monospace table on the code surface. Added lines and words on success tints, removed on critical
   ones; the changed words a stronger tint of the same. Folded stretches are a full-width button row. */
.bt-DiffView {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
  width: 100%;
  min-width: 0;
  color: var(--bt-text);
}
.bt-DiffView__Summary { display: flex; gap: var(--bt-space-200); }
.bt-DiffView__Count { font-family: var(--bt-font-mono); }
.bt-DiffView__Count--add { color: var(--bt-text-success); }
.bt-DiffView__Count--del { color: var(--bt-text-critical); }
.bt-DiffView__Scroll {
  overflow-x: auto;
  border: var(--bt-border-width-1) solid var(--bt-border-secondary);
  border-radius: var(--bt-radius-275);
  background: var(--bt-bg-surface);
}
.bt-DiffView__Table {
  width: 100%;
  border-collapse: collapse;
  font: var(--bt-font-weight-regular) var(--bt-font-size-312) / var(--bt-font-line-height-500) var(--bt-font-mono);
  tab-size: 4;
}
.bt-DiffView--split .bt-DiffView__Table { table-layout: fixed; }
.bt-DiffView__NoCol { width: calc(var(--bt-space-1000) + var(--bt-space-100)); }
.bt-DiffView__SignCol { width: var(--bt-space-500); }
.bt-DiffView__Table th {
  padding: var(--bt-space-150) var(--bt-space-300);
  border-bottom: var(--bt-border-width-1) solid var(--bt-border-secondary);
  background: var(--bt-bg-surface-secondary);
  font: var(--bt-font-weight-semibold) var(--bt-font-size-312) / var(--bt-font-line-height-500) var(--bt-font-sans);
  text-align: start;
}
/* Each cell carries a bt- class, so base.css gives it the sans face: name the mono one on the cells. */
.bt-DiffView__Table td { padding: 0 var(--bt-space-200); vertical-align: top; font-family: var(--bt-font-mono); }
.bt-DiffView__Table td.bt-DiffView__Empty, .bt-DiffView__Fold { font-family: var(--bt-font-sans); }
.bt-DiffView__No {
  color: var(--bt-text-secondary);
  text-align: end;
  user-select: none;
  white-space: nowrap;
}
.bt-DiffView__Sign { color: var(--bt-text-secondary); user-select: none; text-align: center; padding: 0; }
.bt-DiffView__Code { white-space: pre; }
.bt-DiffView--split .bt-DiffView__Code { overflow: hidden; text-overflow: clip; }
.bt-DiffView--wrap .bt-DiffView__Code { white-space: pre-wrap; overflow-wrap: anywhere; }
.bt-DiffView__Row--add, .bt-DiffView__Cell--add { background: var(--bt-bg-success-subtle); }
.bt-DiffView__Row--del, .bt-DiffView__Cell--del { background: var(--bt-bg-critical-subtle); }
.bt-DiffView__Row--add .bt-DiffView__Sign { color: var(--bt-text-success); }
.bt-DiffView__Row--del .bt-DiffView__Sign { color: var(--bt-text-critical); }
.bt-DiffView__Cell--empty { background: var(--bt-bg-surface-secondary); }
.bt-DiffView--split .bt-DiffView__Row > td:nth-child(3) { border-inline-start: var(--bt-border-width-1) solid var(--bt-border-secondary); }
.bt-DiffView__Token { text-decoration: none; border-radius: var(--bt-radius-100); }
ins.bt-DiffView__Token { background: var(--bt-bg-accent-subtle); box-shadow: inset 0 calc(-1 * var(--bt-border-width-2)) 0 var(--bt-border-success); }
del.bt-DiffView__Token { background: var(--bt-bg-caution-subtle); box-shadow: inset 0 calc(-1 * var(--bt-border-width-2)) 0 var(--bt-border-critical); }
.bt-DiffView__FoldRow td { padding: 0; background: var(--bt-bg-surface-secondary); }
.bt-DiffView__Fold {
  display: block;
  width: 100%;
  margin: 0;
  padding: var(--bt-space-100) var(--bt-space-300);
  border: 0;
  background: none;
  color: var(--bt-text-secondary);
  font: var(--bt-font-weight-medium) var(--bt-font-size-312) / var(--bt-font-line-height-500) var(--bt-font-sans);
  text-align: start;
  cursor: pointer;
}
.bt-DiffView__Fold:hover { color: var(--bt-text); background: var(--bt-bg-surface-hover); }
.bt-DiffView__Fold:focus { outline: none; }
.bt-DiffView__Fold:focus-visible { box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-focus); }
.bt-DiffView__Empty { padding: var(--bt-space-300); color: var(--bt-text-secondary); font-family: var(--bt-font-sans); }
.bt-DiffView__Token { font-family: inherit; }

/* --- Divider --- */
/* Divider: an <hr> drawn by its block-start border; color and width are inline token vars. */
.bt-Divider {
  display: block;
  margin: 0;
  border: 0;
  border-block-start-style: solid;
  border-block-start-color: var(--bt-border-secondary);
  border-block-start-width: var(--bt-border-width-1);
  width: 100%;
  height: 0;
}
@media (forced-colors: active) {
  .bt-Divider { border-block-start-color: CanvasText !important; }
}

/* --- Drawer --- */
/* Drawer: a side sheet floating space-300 in from the right edge (bg-surface, radius-650, a hairline ring,
   shadow-soft-lg) over the bg-overlay backdrop; a fixed header (26px bold heading, description, round close)
   and footer (actions at the end), each set off by a border-secondary rule, with the body scrolling between.
   Below 768px it is a bottom sheet (radius-600 top corners, 92% of the screen at most, a grip, full-width
   footer buttons). Motion: slides in with duration-slow and ease-emphasized, out with ease-exit; reduced
   motion keeps only the fade. Modal's focus contract (Modal/useDialog.ts). */
.bt-Drawer-root {
  position: fixed;
  inset: 0;
  z-index: var(--bt-z-modal);
}
.bt-Drawer-root--contained { position: absolute; z-index: var(--bt-z-overlay); }

.bt-Drawer__backdrop {
  position: absolute;
  inset: 0;
  background: var(--bt-bg-overlay);
  animation: bt-Drawer-fade-in var(--bt-duration-slow) var(--bt-ease-emphasized) both;
}
.bt-Drawer-root--closing .bt-Drawer__backdrop { animation: bt-Drawer-fade-out var(--bt-duration-slow) var(--bt-ease-exit) both; }

.bt-Drawer__container {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  padding: var(--bt-space-300);
  overflow: hidden;
}

.bt-Drawer {
  position: relative;
  display: flex;
  flex-direction: column;
  /* Drawer widths have no token family: 480px medium, 640px large. */
  width: 480px;
  max-width: 100%;
  height: 100%;
  background: var(--bt-bg-surface);
  color: var(--bt-text);
  border-radius: var(--bt-radius-650);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary), var(--bt-shadow-soft-lg);
  outline: none;
  overflow: hidden;
  /* backwards, not both: no transform once entered, so popovers portaled in are placed against the viewport. */
  animation: bt-Drawer-in var(--bt-duration-slow) var(--bt-ease-emphasized) backwards;
}
.bt-Drawer:focus { outline: none; }
.bt-Drawer--sizeLarge { width: 640px; }
.bt-Drawer-root--closing .bt-Drawer { animation: bt-Drawer-out var(--bt-duration-slow) var(--bt-ease-exit) both; }
.bt-Drawer-root--instant .bt-Drawer,
.bt-Drawer-root--instant .bt-Drawer__backdrop { animation: none; }

.bt-Drawer__grip { display: none; }

.bt-Drawer__header {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: var(--bt-space-300);
  padding: var(--bt-space-500) var(--bt-space-500) var(--bt-space-400) var(--bt-space-600);
  border-bottom: var(--bt-border-width-1) solid var(--bt-border-secondary);
}
.bt-Drawer__heading { flex: 1 1 auto; min-width: 0; }
.bt-Drawer__title {
  margin: 0;
  font: var(--bt-font-weight-bold) var(--bt-font-size-650) / var(--bt-font-line-height-800) var(--bt-font-sans);
  letter-spacing: -0.02em;
  color: var(--bt-text);
  overflow-wrap: anywhere;
}
.bt-Drawer__description {
  margin: var(--bt-space-100) 0 0;
  font: var(--bt-font-weight-medium) var(--bt-font-size-312) / var(--bt-font-line-height-450) var(--bt-font-sans);
  color: var(--bt-text-secondary);
}
.bt-Drawer__close { flex: none; display: inline-flex; }
.bt-Drawer__close .bt-Button { border-radius: var(--bt-radius-full); }

.bt-Drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--bt-space-500) var(--bt-space-600) var(--bt-space-800);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bt-Drawer__body--flush { padding: 0; }

.bt-Drawer__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--bt-space-2400);
}

.bt-Drawer__footer {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--bt-space-300);
  padding: var(--bt-space-300) var(--bt-space-500);
  border-top: var(--bt-border-width-1) solid var(--bt-border-secondary);
  background: var(--bt-bg-surface);
}
.bt-Drawer__footerContent { flex: 1 1 auto; min-width: 0; }
.bt-Drawer__footer > .bt-ButtonGroup { margin-left: auto; }

/* Below breakpoint-md (768px; media queries can't read tokens): a bottom sheet. */
@media (max-width: 767.98px) {
  .bt-Drawer__container { align-items: flex-end; padding: 0; }
  .bt-Drawer,
  .bt-Drawer--sizeLarge {
    width: 100%;
    height: auto;
    max-height: 92dvh;
    border-radius: var(--bt-radius-600) var(--bt-radius-600) 0 0;
    animation-name: bt-Drawer-sheet-in;
  }
  .bt-Drawer-root--closing .bt-Drawer { animation-name: bt-Drawer-sheet-out; }
  .bt-Drawer__grip {
    display: block;
    flex: none;
    width: var(--bt-space-1000);
    height: var(--bt-space-100);
    margin: var(--bt-space-200) auto 0;
    border-radius: var(--bt-radius-full);
    background: var(--bt-border);
  }
  .bt-Drawer__header { padding-top: var(--bt-space-200); }
  .bt-Drawer__title { font-size: var(--bt-font-size-550); line-height: var(--bt-font-line-height-700); }
  .bt-Drawer__body { padding-bottom: max(var(--bt-space-600), env(safe-area-inset-bottom)); }
  .bt-Drawer__footer { padding-bottom: max(var(--bt-space-300), env(safe-area-inset-bottom)); }
  .bt-Drawer__footer > .bt-ButtonGroup { flex: 1 1 100%; margin-left: 0; }
  .bt-Drawer__footer > .bt-ButtonGroup > * { flex: 1 1 0; }
  .bt-Drawer__footer .bt-Button { width: 100%; min-height: var(--bt-size-control-lg); }
}

@keyframes bt-Drawer-in {
  from { opacity: 0; transform: translateX(var(--bt-space-800)); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-Drawer-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateX(var(--bt-space-800)); }
}
@keyframes bt-Drawer-sheet-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}
@keyframes bt-Drawer-sheet-out {
  from { transform: none; }
  to { transform: translateY(100%); }
}
@keyframes bt-Drawer-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bt-Drawer-fade-out { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .bt-Drawer,
  .bt-Drawer--sizeLarge { animation-name: bt-Drawer-fade-in; }
  .bt-Drawer-root--closing .bt-Drawer { animation-name: bt-Drawer-fade-out; }
}

@media (forced-colors: active) {
  .bt-Drawer { border: 1px solid CanvasText; }
}

/* --- DropZone --- */
/* DropZone: a real file input, transparent, over a dashed box with the drawn button and a hint. The box is an inner
   tile (radius-400, fill-secondary) with a dashed border-strong edge (3:1); dragging tints it bg-brand-subtle with a
   solid border-focus edge. Chosen files sit under it as small tiles (bg-surface-secondary, radius-350). */
.bt-DropZone {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--bt-space-200) var(--bt-space-300);
  min-width: 0;
  padding: var(--bt-space-600) var(--bt-space-400);
  background: var(--bt-fill-secondary);
  border: var(--bt-border-width-1) dashed var(--bt-border-strong);
  border-radius: var(--bt-radius-400);
  transition: border-color var(--bt-duration-fast) var(--bt-ease-emphasized), background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-DropZone:hover { background: var(--bt-bg-surface-hover); border-color: var(--bt-border-hover); }
.bt-DropZone--dragging,
.bt-DropZone--dragging:hover {
  background: var(--bt-bg-brand-subtle);
  border-color: var(--bt-border-focus);
  border-style: solid;
}
.bt-DropZone--error,
.bt-DropZone--error:hover { border-color: var(--bt-border-critical); }
.bt-DropZone--disabled,
.bt-DropZone--disabled:hover { background: var(--bt-fill-disabled); border-color: var(--bt-border); }

.bt-DropZone__Input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.bt-DropZone__Input:disabled { cursor: default; }
.bt-DropZone__Button { flex: none; }
.bt-DropZone__Hint {
  min-width: 0;
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
}
.bt-DropZone__Input:hover ~ .bt-DropZone__Button { background: var(--bt-btn-bg-hover); border-color: var(--bt-btn-border-hover); }
.bt-DropZone__Input:focus-visible ~ .bt-DropZone__Button { box-shadow: var(--bt-shadow-focus); }
.bt-DropZone--error .bt-DropZone__Button { --bt-btn-border: var(--bt-border-critical); --bt-btn-border-hover: var(--bt-border-critical); }
/* By the input's state, so a <fieldset disabled> around the zone counts too. */
.bt-DropZone__Input:disabled ~ .bt-DropZone__Button,
.bt-DropZone__Input:disabled:hover ~ .bt-DropZone__Button {
  background: var(--bt-fill-disabled);
  border-color: transparent;
  color: var(--bt-text-disabled);
}
.bt-DropZone__Input:disabled ~ .bt-DropZone__Hint { color: var(--bt-text-disabled); }

.bt-DropZone__Files {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-150);
  margin: var(--bt-space-200) 0 0;
  padding: 0;
  list-style: none;
}
.bt-DropZone__File {
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  min-width: 0;
  padding: var(--bt-space-200) var(--bt-space-200) var(--bt-space-200) var(--bt-space-300);
  background: var(--bt-bg-surface-secondary);
  border-radius: var(--bt-radius-350);
  color: var(--bt-text);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
}
.bt-DropZone__FileName {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-DropZone__FileSize {
  flex: none;
  color: var(--bt-text-secondary);
  font-variant-numeric: tabular-nums;
}
.bt-DropZone__Remove {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--bt-space-600);
  height: var(--bt-space-600);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--bt-radius-full);
  color: var(--bt-text-secondary);
  cursor: pointer;
}
.bt-DropZone__Remove:hover { background: var(--bt-bg-surface-active); color: var(--bt-text); }
.bt-DropZone__Remove:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-DropZone__Remove:disabled { background: transparent; color: var(--bt-text-disabled); cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .bt-DropZone { transition: none; }
}

@media (forced-colors: active) {
  .bt-DropZone { border-color: CanvasText; }
  .bt-DropZone__Input:focus-visible ~ .bt-DropZone__Button,
  .bt-DropZone__Remove:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* --- EditorFrame --- */
/* EditorFrame: an editor's full window on the canvas (bg), in place of the admin Frame. It is exactly the
   viewport high (size-viewport-height, 100dvh; contained: its positioned parent) and never scrolls: the bar
   (transparent, like TopBar: a round back button, the name, the controls centred, the actions at the end), then
   the panes. Side panes are flush Cards (bg-surface, radius 24, shadow-soft) whose body scrolls under a fixed
   head; the centre stacks the notices (they scroll past size-layout-primary) over the stage (bg-surface-secondary
   with a hairline, radius 24, clipped) that fills the rest. The frame is a size container: below 60rem with two
   panes (48rem with one) a SegmentedControl under the bar shows one part at a time; the others are display:none
   but stay mounted. Below 46rem the controls wrap to their own row; below 30rem (a phone) the name has the first row to itself and
   the gutter narrows to space-200. */
.bt-EditorFrame {
  --bt-editor-start: calc(var(--bt-size-layout-third) + var(--bt-space-1000));
  --bt-editor-end: var(--bt-size-layout-half);
  container: bt-editor / inline-size;
  position: relative;
  block-size: var(--bt-size-viewport-height);
  overflow: hidden;
  background: var(--bt-bg);
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
}
.bt-EditorFrame--contained {
  position: absolute;
  inset: 0;
  block-size: auto;
}

/* The column inside the container, since a container can't query its own size. */
.bt-EditorFrame__layout {
  display: flex;
  flex-direction: column;
  --bt-editor-gutter: var(--bt-space-300);
  gap: var(--bt-editor-gutter);
  box-sizing: border-box;
  block-size: 100%;
  padding: var(--bt-editor-gutter);
}

/* ---- the bar: the middle is centred when there is room ---- */
.bt-EditorFrame__bar {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  gap: var(--bt-space-200) var(--bt-space-300);
  min-block-size: var(--bt-size-control-md);
}
.bt-EditorFrame__lead {
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  min-inline-size: 0;
  grid-column: 1;
}
.bt-EditorFrame__name { min-inline-size: 0; }
.bt-EditorFrame__name .bt-SkeletonDisplayText { inline-size: var(--bt-size-layout-third); max-inline-size: 100%; }
.bt-EditorFrame__metadata { display: flex; align-items: center; gap: var(--bt-space-150); flex: none; }
.bt-EditorFrame__controls {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bt-space-200);
  min-inline-size: 0;
}
/* While loading: a line as wide as a template picker. */
.bt-EditorFrame__controls--loading { inline-size: var(--bt-size-layout-third); }
.bt-EditorFrame__controls--loading > * { flex: auto; }
.bt-EditorFrame__actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--bt-space-200);
}
/* The primary action's placeholder: a pill at the button's size. */
.bt-EditorFrame__actionSkeleton {
  display: block;
  inline-size: 88px;
  block-size: var(--bt-size-control-md);
  border-radius: var(--bt-radius-full);
}

/* The placeholders sit on the canvas: the card colour, a border hairline and the sweep of SkeletonPage's
   shapes (background-attachment: fixed keeps them in step; 1.6s is a loop the duration tokens do not cover). */
.bt-EditorFrame__actionSkeleton {
  background-color: var(--bt-bg-surface);
  background-image: linear-gradient(90deg, transparent 40%, var(--bt-bg-surface-hover) 50%, transparent 60%);
  background-size: 300% 100%;
  background-attachment: fixed;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border);
  animation: bt-EditorFrame-shimmer 1.6s var(--bt-ease-standard) infinite;
}
@keyframes bt-EditorFrame-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-EditorFrame__actionSkeleton { animation: none; background-image: none; }
}

/* ---- the view switch (narrow frames only) ---- */
.bt-EditorFrame__switch { display: none; flex: none; }

/* ---- the panes ---- */
.bt-EditorFrame__panes {
  flex: auto;
  min-block-size: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--bt-editor-gutter);
}
.bt-EditorFrame--start .bt-EditorFrame__panes { grid-template-columns: var(--bt-editor-start) minmax(0, 1fr); }
.bt-EditorFrame--end .bt-EditorFrame__panes { grid-template-columns: minmax(0, 1fr) var(--bt-editor-end); }
.bt-EditorFrame--start.bt-EditorFrame--end .bt-EditorFrame__panes { grid-template-columns: var(--bt-editor-start) minmax(0, 1fr) var(--bt-editor-end); }

.bt-EditorFrame__side { display: grid; grid-template-rows: minmax(0, 1fr); min-inline-size: 0; min-block-size: 0; }
.bt-EditorFrame__side > .bt-Card { block-size: 100%; }
.bt-EditorFrame__pane { display: flex; flex-direction: column; block-size: 100%; }
.bt-EditorFrame__paneHead { flex: none; padding: var(--bt-space-400) var(--bt-space-400) var(--bt-space-200); }
.bt-EditorFrame__paneHead > .bt-Card__header { margin-bottom: 0; }
.bt-EditorFrame__scroll {
  flex: auto;
  min-block-size: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: var(--bt-space-200) var(--bt-space-400) var(--bt-space-400);
}
.bt-EditorFrame__paneHead + .bt-EditorFrame__scroll { padding-block-start: var(--bt-space-200); }
.bt-EditorFrame__paneSkeleton { display: flex; flex-direction: column; gap: var(--bt-space-400); }

.bt-EditorFrame__center {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
  min-inline-size: 0;
  min-block-size: 0;
}
.bt-EditorFrame__notices {
  flex: none;
  max-block-size: var(--bt-size-layout-primary);
  overflow: auto;
  overscroll-behavior: contain;
}
/* What the notices leave. Bare, one child fills it (a Card); as a stage, it clips what is drawn in it. */
.bt-EditorFrame__content {
  flex: auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-inline-size: 0;
  min-block-size: 0;
  overflow: auto;
}
.bt-EditorFrame__content > .bt-Card { block-size: 100%; }
.bt-EditorFrame__content--stage {
  overflow: hidden;
  border-radius: var(--bt-radius-600);
  background: var(--bt-bg-surface-secondary);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary), var(--bt-shadow-soft);
}
.bt-EditorFrame__content--waiting { background: var(--bt-bg-surface); }
/* An iframe in the stage fills it unless the editor sizes it (a phone-wide frame, a scaled desktop). */
.bt-EditorFrame__content--stage > iframe {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  margin-inline: auto;
  border: 0;
  background: var(--bt-bg-surface);
}

/* ---- narrow frames: one part at a time ---- */
@container bt-editor (max-width: 59.99rem) {
  .bt-EditorFrame--start.bt-EditorFrame--end .bt-EditorFrame__switch { display: block; }
  .bt-EditorFrame--start.bt-EditorFrame--end .bt-EditorFrame__panes { grid-template-columns: minmax(0, 1fr); }
  .bt-EditorFrame--start.bt-EditorFrame--end[data-view='start'] .bt-EditorFrame__center,
  .bt-EditorFrame--start.bt-EditorFrame--end[data-view='start'] .bt-EditorFrame__side--end,
  .bt-EditorFrame--start.bt-EditorFrame--end[data-view='center'] .bt-EditorFrame__side,
  .bt-EditorFrame--start.bt-EditorFrame--end[data-view='end'] .bt-EditorFrame__center,
  .bt-EditorFrame--start.bt-EditorFrame--end[data-view='end'] .bt-EditorFrame__side--start { display: none; }
}
@container bt-editor (max-width: 47.99rem) {
  .bt-EditorFrame--panes .bt-EditorFrame__switch { display: block; }
  .bt-EditorFrame--panes .bt-EditorFrame__panes { grid-template-columns: minmax(0, 1fr); }
  .bt-EditorFrame--panes[data-view='start'] .bt-EditorFrame__center,
  .bt-EditorFrame--panes[data-view='start'] .bt-EditorFrame__side--end,
  .bt-EditorFrame--panes[data-view='center'] .bt-EditorFrame__side,
  .bt-EditorFrame--panes[data-view='end'] .bt-EditorFrame__center,
  .bt-EditorFrame--panes[data-view='end'] .bt-EditorFrame__side--start { display: none; }
}
/* The controls take a row of their own under the name and the actions. */
@container bt-editor (max-width: 45.99rem) {
  .bt-EditorFrame__bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .bt-EditorFrame__actions { grid-column: 2; grid-row: 1; }
  .bt-EditorFrame__controls { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; flex-wrap: wrap; }
  .bt-EditorFrame__controls--loading { inline-size: 100%; }
}
/* A phone: the name has the first row; the controls, then the actions at the end, wrap below it. */
@container bt-editor (max-width: 29.99rem) {
  .bt-EditorFrame__layout { --bt-editor-gutter: var(--bt-space-200); }
  .bt-EditorFrame__bar { display: flex; flex-wrap: wrap; }
  .bt-EditorFrame__lead { flex: 1 1 100%; }
  .bt-EditorFrame__controls { flex: 0 1 auto; }
  .bt-EditorFrame__actions { flex: none; margin-inline-start: auto; }
}

/* --- EmptyState --- */
/* EmptyState: a centred illustration or icon tile, a 17px semibold heading, copy in text-secondary, actions. */
.bt-EmptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bt-space-300);
  padding: var(--bt-space-1000) var(--bt-space-500);
  text-align: center;
  color: var(--bt-text);
}
.bt-EmptyState__visual { display: flex; justify-content: center; max-width: 100%; }
.bt-EmptyState__image {
  display: block;
  /* The illustration width; no size token covers images. */
  width: 226px;
  max-width: none;
  height: auto;
}
.bt-EmptyState__image--contained { width: 100%; max-width: 226px; }

/* The icon tile: size-empty-tile (52px), radius-350, the sunken surface with a hairline, icon in
   text. Small: 40px, radius-250. */
.bt-EmptyState__disc {
  display: inline-grid;
  place-items: center;
  width: var(--bt-size-empty-tile);
  height: var(--bt-size-empty-tile);
  border-radius: var(--bt-radius-350);
  background: var(--bt-bg-surface-secondary);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
  color: var(--bt-text);
}
.bt-EmptyState__disc .bt-Icon { width: var(--bt-space-600); height: var(--bt-space-600); }

.bt-EmptyState--small { gap: var(--bt-space-300); padding: var(--bt-space-600) var(--bt-space-400); }
.bt-EmptyState--small .bt-EmptyState__disc {
  width: var(--bt-size-control-md);
  height: var(--bt-size-control-md);
  border-radius: var(--bt-radius-250);
  color: var(--bt-text-secondary);
}
.bt-EmptyState--small .bt-EmptyState__disc .bt-Icon { width: var(--bt-space-500); height: var(--bt-space-500); }

.bt-EmptyState__details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bt-space-150);
  width: 100%;
  /* The text column; no size token covers widths. */
  max-width: 400px;
}
.bt-EmptyState--fullWidth .bt-EmptyState__details { max-width: none; }
.bt-EmptyState .bt-EmptyState__heading {
  margin: 0;
  font: var(--bt-font-weight-semibold) var(--bt-font-size-425) / var(--bt-font-line-height-600) var(--bt-font-sans);
  letter-spacing: -0.005em;
  color: var(--bt-text);
  text-wrap: balance;
}
.bt-EmptyState--small .bt-EmptyState__heading { font-size: var(--bt-font-size-375); line-height: var(--bt-font-line-height-500); }
.bt-EmptyState .bt-EmptyState__content {
  /* about 44 characters a line */
  max-width: 44ch;
  font: var(--bt-font-weight-medium) var(--bt-font-size-337) / var(--bt-font-line-height-500) var(--bt-font-sans);
  color: var(--bt-text-secondary);
  text-wrap: pretty;
}
.bt-EmptyState--small .bt-EmptyState__content { font-size: var(--bt-font-size-312); line-height: var(--bt-font-line-height-450); }
.bt-EmptyState--fullWidth .bt-EmptyState__content { max-width: none; }
.bt-EmptyState__content p { margin: 0; }
.bt-EmptyState__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--bt-space-200);
  margin-top: var(--bt-space-200);
}
.bt-EmptyState__footer { color: var(--bt-text-secondary); margin-top: var(--bt-space-100); }

/* --- Filters --- */
/* Filters: the template's list toolbar in one wrapping row: the search field (240-340px), the filter pills and
   "Filtre ekle", "Tümünü temizle" at the end of the pills, then the children (a sort button, a saved view) at the
   far end. Narrower than breakpoint-sm (480px of its own width) the field takes its own line and the pills scroll
   sideways in one row. */
.bt-Filters {
  display: flex;
  flex: 1 1 auto; /* A size container has no content width: in a flex row (InlineStack) it takes the free space, not 0px. */
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-200) var(--bt-space-300);
  min-width: 0;
  /* The layout reacts to the width Filters gets (a narrow Card too), not only to the viewport. */
  container-type: inline-size;
  /* Its own padding (space-400 inline, the table's cell inset): it sits flush at the top of a `Card padding="0"`
     above an IndexTable, or above a list, with no Box around it. */
  padding: var(--bt-space-400) var(--bt-space-400) var(--bt-space-300);
}

/* The search field is a TextField (search icon prefix, spinner, "Aramayı temizle"); this wrapper only sizes it.
   Beside the pills it keeps the template's 240-340px; alone it takes the row. */
.bt-Filters__Search { flex: 1 1 auto; min-width: 0; }
.bt-Filters--withBar .bt-Filters__Search { flex: 1 1 calc(var(--bt-space-1200) * 5); max-width: calc(var(--bt-space-1000) * 8.5); }
.bt-Filters__Children { display: flex; flex: none; align-items: center; gap: var(--bt-space-200); margin-inline-start: auto; }

/* The bar: pills (+ "Filtre ekle"), then "Tümünü temizle" at its end. */
.bt-Filters__Bar {
  display: flex;
  flex: 1 1 calc(var(--bt-space-1000) * 8);
  align-items: center;
  gap: var(--bt-space-200);
  min-width: 0;
}
.bt-Filters__Pills {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-150);
  min-width: 0;
  /* Room for the focus ring, which an overflow box would clip on narrow screens. */
  padding: var(--bt-space-050);
  margin: calc(-1 * var(--bt-space-050));
}
/* Pills keep their width: the Popover activator wrappers are the flex items here. */
.bt-Filters__Pills > * { flex: none; max-width: 100%; }
.bt-Filters__ClearAll { display: flex; flex: none; align-items: center; }
.bt-Filters__Add { display: inline-flex; flex: none; }
.bt-Filters__Add [aria-expanded="true"] { background: var(--bt-bg-surface-active); }

/* A pill: the template chip (Tag's look): size-chip-lg (32px), on the card colour with a hairline, 12.5px semibold in
   text-secondary with a chevron while unused; applied, it takes fill-strong (ink in light, garnet in dark) with the
   value and a remove button. */
.bt-Filters__Pill {
  display: inline-flex;
  flex: none;
  align-items: stretch;
  max-width: 100%;
  min-height: var(--bt-size-chip-lg);
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-semibold);
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized), color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Filters__Pill:hover:not(.bt-Filters__Pill--disabled):not(.bt-Filters__Pill--applied) { color: var(--bt-text); background: var(--bt-bg-surface-secondary); }
.bt-Filters__Pill--applied { background: var(--bt-fill-strong); box-shadow: none; color: var(--bt-text-on-strong); }
.bt-Filters__Pill--disabled { background: var(--bt-fill-disabled); box-shadow: none; color: var(--bt-text-disabled); }

.bt-Filters__PillButton,
.bt-Filters__PillRemove {
  display: inline-flex;
  align-items: center;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Filters__PillButton {
  gap: var(--bt-space-100);
  min-width: 0;
  padding: 0 var(--bt-space-200) 0 var(--bt-space-300);
  border-radius: var(--bt-radius-full);
}
.bt-Filters__Pill--applied .bt-Filters__PillButton {
  padding-inline-end: var(--bt-space-050);
  border-radius: var(--bt-radius-full) 0 0 var(--bt-radius-full);
}
.bt-Filters__PillLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-Filters__PillChevron { display: inline-flex; flex: none; }
.bt-Filters__PillRemove {
  flex: none;
  justify-content: center;
  padding: 0 var(--bt-space-200) 0 var(--bt-space-100);
  border-radius: 0 var(--bt-radius-full) var(--bt-radius-full) 0;
}
.bt-Filters__PillButton:focus-visible,
.bt-Filters__PillRemove:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-Filters__PillButton[aria-expanded="true"] { color: var(--bt-text); }
.bt-Filters__Pill:not(.bt-Filters__Pill--applied):has(.bt-Filters__PillButton[aria-expanded="true"]) { background: var(--bt-bg-surface-active); color: var(--bt-text); }
.bt-Filters__Pill--applied .bt-Filters__PillButton:hover,
.bt-Filters__Pill--applied .bt-Filters__PillRemove:hover,
.bt-Filters__Pill--applied .bt-Filters__PillButton[aria-expanded="true"] { background: var(--bt-fill-strong-hover); color: inherit; }
.bt-Filters__Pill--applied .bt-Filters__PillButton:active,
.bt-Filters__Pill--applied .bt-Filters__PillRemove:active { background: var(--bt-fill-strong-active); }
.bt-Filters__PillButton:disabled,
.bt-Filters__PillRemove:disabled { background: transparent; color: var(--bt-text-disabled); cursor: default; }

/* The popover of a pill: the filter UI, then "Temizle". */
.bt-Filters__PopoverBody { padding: var(--bt-space-300) var(--bt-space-400); min-width: 200px; /* a usable width for checkbox lists; no size token covers it */ }
.bt-Filters__PopoverFooter {
  display: flex;
  justify-content: flex-start;
  padding: var(--bt-space-200) var(--bt-space-400);
  border-top: var(--bt-border-width-1) solid var(--bt-border-secondary);
}

/* Narrower than breakpoint-sm (480px; no var() in container queries): one row of pills that scrolls sideways. */
@container (max-width: 479.98px) {
  .bt-Filters--withBar .bt-Filters__Search { flex: 1 1 100%; max-width: none; }
  /* The row gets the full width; "Tümünü temizle" moves to its own line below, at the end. */
  .bt-Filters__Bar { flex: 1 1 100%; flex-wrap: wrap; row-gap: var(--bt-space-100); }
  .bt-Filters__Pills {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .bt-Filters__ClearAll { flex: 1 1 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .bt-Filters__Pill,
  .bt-Filters__PillButton,
  .bt-Filters__PillRemove { transition: none; }
}

@media (forced-colors: active) {
  .bt-Filters__Pill { border: 1px solid ButtonText; }
  .bt-Filters__Pill--applied { border: 2px solid Highlight; }
  .bt-Filters__PillButton:focus-visible,
  .bt-Filters__PillRemove:focus-visible { outline: 2px solid Highlight; }
}

/* --- Frame --- */
/* Frame: the admin shell on the canvas (bg). On the left a floating dark rail (bg-rail, radius-650, size-rail-inset
   from the edges): the brand tile, the Navigation, then the wide toggle and the account menu at the bottom. size-rail
   with icons only; wide (size-nav, labels) when the frame is 1280px or more and wide mode is on. On the right the column: the
   TopBar (transparent, it scrolls with the page) over <main>. <main> has NO padding: Page owns it and reads the
   shell gutter from --bt-page-gutter. Below md (measured on the frame itself, see Frame.tsx) the rail is a drawer,
   always wide, sliding in with duration-slow / ease-emphasized; reduced motion only fades the backdrop.
   contained: everything inside the positioned parent box. */
.bt-Frame {
  --bt-frame-gutter: clamp(var(--bt-space-400), 1.8vw, var(--bt-space-800));
  --bt-frame-rail-inset: var(--bt-size-rail-inset);
  --bt-frame-rail: var(--bt-size-rail);
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bt-bg);
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
}
.bt-Frame--navigationExpanded { --bt-frame-rail: var(--bt-size-nav); }

/* Skip link: off screen until focused, then over everything. */
.bt-Frame__skip {
  position: absolute;
  inset-block-start: var(--bt-space-200);
  inset-inline-start: var(--bt-space-200);
  z-index: var(--bt-z-modal);
  padding: var(--bt-space-200) var(--bt-space-400);
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface);
  color: var(--bt-text-brand);
  font-size: var(--bt-font-size-337);
  font-weight: var(--bt-font-weight-semibold);
  box-shadow: var(--bt-shadow-soft-lg);
  text-decoration: underline;
  transform: translateY(-200%);
  opacity: 0;
  pointer-events: none;
}
.bt-Frame__skip:focus {
  transform: none;
  opacity: 1;
  pointer-events: auto;
  outline: none;
  box-shadow: var(--bt-shadow-focus), var(--bt-shadow-soft-lg);
}

/* ---- the rail ---- */
.bt-Frame__navigation {
  flex: none;
  display: flex;
  flex-direction: column;
  inline-size: var(--bt-frame-rail);
  margin-block: var(--bt-frame-rail-inset);
  margin-inline: var(--bt-frame-rail-inset) 0;
  padding: var(--bt-space-300) 10px;
  position: sticky;
  inset-block-start: var(--bt-frame-rail-inset);
  /* Above the content, so the item flyouts are too. */
  z-index: var(--bt-z-sticky);
  block-size: calc(100vh - 2 * var(--bt-frame-rail-inset));
  block-size: calc(100dvh - 2 * var(--bt-frame-rail-inset));
  border-radius: var(--bt-radius-650);
  background: var(--bt-bg-rail);
  color: var(--bt-text-on-rail);
  /* A hairline keeps the dark rail apart from the dark canvas. */
  box-shadow: inset 0 0 0 1px var(--bt-bg-rail-hover), var(--bt-shadow-soft-lg);
  color-scheme: dark;
}
/* The width never transitions in CSS: from 1280px (bt-Frame--roomy) the persisted wide toggle animates the rail
   in Frame.tsx (the classes flip at once; the column slides from where it was, and opening also unclips the rail
   from its old width with the labels fading in;
   duration-slower, ease-in-out), and clears its styles after. Below that the rail in the flow is always the icon
   rail, and leaving the overlay or crossing 1280px changes the width at once. */
.bt-Frame--navigationExpanded .bt-Frame__navigation { padding-inline: var(--bt-space-300); }
.bt-Frame__navigation:focus { outline: none; }

.bt-Frame__brandRow {
  flex: none;
  display: flex;
  justify-content: center;
  margin-block-end: var(--bt-space-300);
}
.bt-Frame--navigationExpanded .bt-Frame__brandRow { justify-content: flex-start; padding-inline-start: 0; }
.bt-Frame__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-300);
  min-inline-size: 0;
  border-radius: var(--bt-radius-350);
  color: inherit;
  text-decoration: none;
}
.bt-Frame__brand--link:focus-visible {
  outline: 2px solid var(--bt-text-on-rail);
  outline-offset: 2px;
}
.bt-Frame__brandMark {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: var(--bt-size-rail-brand);
  block-size: var(--bt-size-rail-brand);
  border-radius: var(--bt-radius-375);
  background: var(--bt-fill-brand);
  color: var(--bt-text-on-brand);
  /* The tile: a text-on-brand bag with a garnet-950 handle in both themes. */
  --bt-fill-mark-handle: var(--bt-garnet-950);
  overflow: hidden;
}
/* The mark about 26px tall in the 44px tile (about 60%, owner 2026-11-16), centred exactly. */
.bt-Frame__brandSvg { block-size: calc(var(--bt-size-rail-brand) * 26 / 44); inline-size: auto; aspect-ratio: 260 / 302; }
.bt-Frame__brandImage { inline-size: 100%; block-size: 100%; object-fit: cover; }
/* 20px beside the 44px tile, one line (an app's long name ends in an ellipsis), centred on the tile. */
.bt-Frame__brandName {
  display: none;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--bt-font-size-500);
  font-weight: var(--bt-font-weight-bold);
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.bt-Frame--navigationExpanded .bt-Frame__brandName { display: block; }

/* The Navigation scrolls here when the rail is shorter than its items. An end that hides items fades out (the hint
   of shared/scroll-fade.css, from the same useScrollEdges): a bg-rail gradient over that end rather than a mask,
   since a mask would also clip the items' fixed flyouts. Nothing animates, so reduced motion needs no rule. */
.bt-Frame__navigationScroll {
  position: relative;
  flex: 1 1 auto;
  min-block-size: 0;
  display: flex;
  flex-direction: column;
}
.bt-Frame__navigationScroll::before,
.bt-Frame__navigationScroll::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  z-index: 1;
  block-size: var(--bt-space-800);
  pointer-events: none;
  visibility: hidden;
}
.bt-Frame__navigationScroll::before { inset-block-start: 0; background: linear-gradient(to bottom, var(--bt-bg-rail), transparent); }
.bt-Frame__navigationScroll::after { inset-block-end: 0; background: linear-gradient(to top, var(--bt-bg-rail), transparent); }
.bt-Frame__navigationScroll--start::before,
.bt-Frame__navigationScroll--end::after { visibility: visible; }
.bt-Frame__navigationBody {
  flex: 1 1 auto;
  min-block-size: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  /* Room for the items' focus outline. */
  margin-inline: -4px;
  padding: 4px;
}
.bt-Frame__navigationBody::-webkit-scrollbar { display: none; }

.bt-Frame__railFooter {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bt-space-300);
  padding-block-start: var(--bt-space-300);
}
.bt-Frame--navigationExpanded .bt-Frame__railFooter { align-items: stretch; }

/* Round buttons on the rail: the wide toggle, the drawer's close button. */
.bt-Frame__railButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--bt-space-300);
  inline-size: var(--bt-size-rail-button);
  block-size: var(--bt-size-rail-button);
  padding: 0;
  border: 0;
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-rail-button);
  box-shadow: inset 0 0 0 1px var(--bt-bg-rail-active);
  color: var(--bt-text-on-rail);
  font: inherit;
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-standard);
}
.bt-Frame__railButton:hover { background: var(--bt-bg-rail-hover); }
.bt-Frame__railButton:active { background: var(--bt-bg-rail-active); }
.bt-Frame__railButton:focus-visible { outline: 2px solid var(--bt-text-on-rail); outline-offset: 2px; }
.bt-Frame--navigationExpanded .bt-Frame__wideToggle {
  inline-size: auto;
  block-size: 40px;
  justify-content: flex-start;
  padding-inline: var(--bt-space-400);
  border-radius: var(--bt-radius-350);
  font-size: var(--bt-font-size-325);
  font-weight: var(--bt-font-weight-semibold);
}
.bt-Frame__railButtonLabel { white-space: nowrap; }

/* The account button: the avatar with a ring; wide, the name and detail beside it. */
.bt-Frame__userMenu { display: flex; justify-content: center; min-inline-size: 0; }
.bt-Frame__userMenu > * { min-inline-size: 0; }
.bt-Frame--navigationExpanded .bt-Frame__userMenu > * { flex: 1 1 auto; }
.bt-Frame__userButton {
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  min-inline-size: 0;
  padding: 3px;
  border: 0;
  border-radius: var(--bt-radius-full);
  background: transparent;
  color: var(--bt-text-on-rail);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.bt-Frame--navigationExpanded .bt-Frame__userButton {
  inline-size: 100%;
  padding: 6px;
  border-radius: var(--bt-radius-400);
}
.bt-Frame--navigationExpanded .bt-Frame__userButton:hover { background: var(--bt-bg-rail-hover); }
.bt-Frame__userButton:focus-visible { outline: 2px solid var(--bt-text-on-rail); outline-offset: 2px; }
.bt-Frame__userAvatar {
  display: inline-flex;
  flex: none;
  border-radius: var(--bt-radius-full);
  box-shadow: 0 0 0 2px var(--bt-bg-rail-active);
}
.bt-Frame__userButton:hover .bt-Frame__userAvatar { box-shadow: 0 0 0 2px var(--bt-text-on-rail-secondary); }
.bt-Frame__userButton .bt-MenuButton__name { color: var(--bt-text-on-rail); }
.bt-Frame__userButton .bt-MenuButton__detail { color: var(--bt-text-on-rail-secondary); }

/* ---- the column: top bar and content ---- */
.bt-Frame__column {
  flex: 1 1 auto;
  align-self: stretch;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
}
.bt-Frame__topBar {
  flex: none;
  padding: var(--bt-space-400) var(--bt-frame-gutter) 0;
}
/* The bar's row lines up with the page column: a default-width Page's content is at most size-page, centred in
   the same gutter (Page.css), so the bar gets the same cap and centring. Narrow and full-width pages keep it. */
.bt-Frame__topBar > * { max-inline-size: var(--bt-size-page); margin-inline: auto; }
.bt-Frame__main {
  flex: 1 1 auto;
  min-inline-size: 0;
  /* A column, so a SaveBar (sticky, a direct child after the page) sits at the bottom of the viewport on a
     short page: its auto top margin takes the free space. On a long page it stays sticky as before. */
  display: flex;
  flex-direction: column;
  /* Page reads these: the shell's gutter, and less room on top under a top bar. */
  --bt-page-gutter: var(--bt-frame-gutter);
}
/* In a column a child may not shrink below its content: let it, as it did in a block. */
.bt-Frame__main > * { min-inline-size: 0; }
.bt-Frame__main > .bt-SaveBar { margin-block-start: auto; }
.bt-Frame--hasTopBar .bt-Frame__main { --bt-page-padding-top: var(--bt-space-500); }
/* A programmatic focus target (the skip link), not a control. */
.bt-Frame__main:focus { outline: none; }

.bt-Frame__backdrop { display: none; }
.bt-Frame__navigationClose { display: none; }

/* ---- contained: fill the positioned parent, the column scrolls inside ---- */
.bt-Frame--contained {
  position: absolute;
  inset: 0;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}
.bt-Frame--contained .bt-Frame__navigation {
  position: relative;
  inset-block-start: 0;
  block-size: auto;
}
.bt-Frame--contained .bt-Frame__column {
  min-block-size: 0;
  overflow-y: auto;
}

/* ---- overlay: between the drawer and the wide rail (768 to 1280px) the toggle opens the full menu over the content ----
   The icon rail keeps its place (the spacer holds its box); the wide rail sits fixed on top of it, same inset and
   look, so the brand row lines up. A light scrim lies under it. Not the persisted wide choice. */
.bt-Frame--navigationOverlay { --bt-frame-rail: var(--bt-size-rail); }
.bt-Frame__railSpacer {
  flex: none;
  inline-size: var(--bt-frame-rail);
  margin-inline: var(--bt-frame-rail-inset) 0;
}
.bt-Frame--navigationOverlay .bt-Frame__navigation {
  position: fixed;
  inset-block-start: var(--bt-frame-rail-inset);
  inset-inline-start: var(--bt-frame-rail-inset);
  margin: 0;
  inline-size: var(--bt-size-nav);
  z-index: var(--bt-z-modal);
  transition: none;
}
.bt-Frame--navigationOverlay .bt-Frame__backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: var(--bt-z-overlay);
  background: color-mix(in srgb, var(--bt-bg-overlay) 45%, transparent);
}
.bt-Frame--contained.bt-Frame--navigationOverlay .bt-Frame__navigation,
.bt-Frame--contained.bt-Frame--navigationOverlay .bt-Frame__backdrop { position: absolute; }
.bt-Frame--contained.bt-Frame--navigationOverlay .bt-Frame__navigation { block-size: auto; inset-block-end: var(--bt-frame-rail-inset); }

/* ---- narrow: the rail is a drawer, always wide ---- */
.bt-Frame--narrow .bt-Frame__navigation {
  position: fixed;
  inset-block: var(--bt-space-200);
  inset-inline-start: var(--bt-space-200);
  z-index: var(--bt-z-modal);
  margin: 0;
  block-size: auto;
  inline-size: min(18rem, calc(100% - var(--bt-space-1600)));
  padding-inline: var(--bt-space-300);
  transform: translateX(calc(-100% - var(--bt-space-400)));
  visibility: hidden;
  transition: none;
}
/* translateX is physical: right to left, the drawer hides past the right edge. */
.bt-Frame--narrow .bt-Frame__navigation:dir(rtl) { transform: translateX(calc(100% + var(--bt-space-400))); }
.bt-Frame--narrow.bt-Frame--navigationOpen .bt-Frame__navigation,
.bt-Frame--narrow.bt-Frame--navigationOpen .bt-Frame__navigation:dir(rtl) {
  transform: none;
  visibility: visible;
}
.bt-Frame--narrow .bt-Frame__navigationClose {
  display: block;
  position: absolute;
  inset-block-start: calc(var(--bt-space-300) + 7px);
  inset-inline-end: var(--bt-space-300);
  z-index: 1;
}
.bt-Frame--narrow .bt-Frame__brandRow { padding-inline-end: 44px; }
.bt-Frame--narrow .bt-Frame__backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: var(--bt-z-overlay);
  background: var(--bt-bg-overlay);
  opacity: 0;
  visibility: hidden;
}
.bt-Frame--narrow.bt-Frame--navigationOpen .bt-Frame__backdrop {
  opacity: 1;
  visibility: visible;
}

/* Motion, once the narrow layout has settled (bt-Frame--animated): slide in with ease-emphasized, out with
   ease-exit; visibility flips at the start of opening and the end of closing. */
.bt-Frame--animated .bt-Frame__navigation {
  transition:
    transform var(--bt-duration-slow) var(--bt-ease-exit),
    visibility 0s linear var(--bt-duration-slow);
}
.bt-Frame--animated.bt-Frame--navigationOpen .bt-Frame__navigation {
  transition:
    transform var(--bt-duration-slow) var(--bt-ease-emphasized),
    visibility 0s;
}
.bt-Frame--animated .bt-Frame__backdrop {
  transition:
    opacity var(--bt-duration-slow) var(--bt-ease-exit),
    visibility 0s linear var(--bt-duration-slow);
}
.bt-Frame--animated.bt-Frame--navigationOpen .bt-Frame__backdrop {
  transition:
    opacity var(--bt-duration-slow) var(--bt-ease-enter),
    visibility 0s;
}
.bt-Frame--contained.bt-Frame--narrow .bt-Frame__navigation,
.bt-Frame--contained.bt-Frame--narrow .bt-Frame__backdrop { position: absolute; }

/* ---- unmeasured: the server HTML and the hydrating render, before Frame measures itself ----
   On a phone-wide viewport the rail stays out of the flow (the drawer is closed anyway), so the first paint
   doesn't show a rail beside a sliver of content. Not for contained frames: their box, not the viewport,
   decides. TopBar renders its menu button while unmeasured and hides it here from md up. */
@media (max-width: 767.98px) {
  .bt-Frame--unmeasured:not(.bt-Frame--contained) .bt-Frame__navigation { display: none; }
}
@media (min-width: 768px) {
  .bt-Frame--unmeasured .bt-TopBar__navigationToggle { display: none; }
}
.bt-Frame--unmeasured.bt-Frame--contained .bt-TopBar__navigationToggle { display: none; }

/* Reduced motion: no slide or width change; the drawer appears and goes at once, the backdrop still fades. */
@media (prefers-reduced-motion: reduce) {
  .bt-Frame__navigation,
  .bt-Frame--animated .bt-Frame__navigation,
  .bt-Frame--animated.bt-Frame--navigationOpen .bt-Frame__navigation {
    transition: none;
  }
}

/* --- Icon --- */
.bt-Icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: var(--bt-size-icon-md);
  height: var(--bt-size-icon-md);
  color: inherit;
}
.bt-Icon--sizeSmall { width: var(--bt-size-icon-sm); height: var(--bt-size-icon-sm); }
.bt-Icon--sizeLarge { width: var(--bt-size-icon-lg); height: var(--bt-size-icon-lg); }

.bt-Icon__svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Tones: the text tokens, which keep 4.5:1 (icons need 3:1) on every bg and surface in both themes. */
.bt-Icon--toneBase { color: var(--bt-text); }
.bt-Icon--toneSubdued { color: var(--bt-text-secondary); }
.bt-Icon--toneCaution,
.bt-Icon--toneWarning,
.bt-Icon--toneTextCaution,
.bt-Icon--toneTextWarning { color: var(--bt-text-warning); }
.bt-Icon--toneCritical,
.bt-Icon--toneTextCritical { color: var(--bt-text-critical); }
.bt-Icon--toneInfo,
.bt-Icon--toneTextInfo { color: var(--bt-text-info); }
.bt-Icon--toneSuccess,
.bt-Icon--toneTextSuccess { color: var(--bt-text-success); }
.bt-Icon--toneInteractive,
.bt-Icon--tonePrimary,
.bt-Icon--toneEmphasis,
.bt-Icon--toneTextPrimary { color: var(--bt-text-brand); }

@media (forced-colors: active) {
  .bt-Icon { color: CanvasText; }
}

/* --- IndexTable --- */
/* IndexTable: a real <table> on bg-surface; put it in a Card without padding (the card's radius-600 clips it).
   Header: 12px semibold in text-secondary on the card colour, a border-secondary hairline below. Rows: 13.5px
   medium text, border-secondary dividers, hover bg-surface-hover, selected bg-surface-selected (the garnet tint,
   beside the garnet Checkbox), tones on the bg-*-subtle grounds.
   The selection column and the first column stay put on horizontal scroll; the bulk bar covers the header. */
.bt-IndexTable {
  /* The selection column: a 20px checkbox, space-400 before it (the table's edge inset) and space-100 after it,
     so the first column's own space-400 keeps the text close to its checkbox. */
  --bt-it-check: calc(var(--bt-size-icon-md) + var(--bt-space-400) + var(--bt-space-100));
  --bt-it-first-left: 0px;
  position: relative;
  background: var(--bt-bg-surface);
  color: var(--bt-text);
}
.bt-IndexTable--selectable { --bt-it-first-left: var(--bt-it-check); }

.bt-IndexTable__Scroll { position: relative; overflow-x: auto; }
.bt-IndexTable__Table {
  width: 100%;
  border-collapse: separate; /* sticky cells keep their borders only with separate borders */
  border-spacing: 0;
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
  font-variant-numeric: tabular-nums lining-nums;
}

/* --- header ------------------------------------------------------------------ */
.bt-IndexTable__Heading {
  height: var(--bt-size-control-md);
  padding-block: var(--bt-space-100);
  padding-inline: var(--bt-space-400);
  background: var(--bt-bg-surface);
  border-bottom: var(--bt-border-width-1) solid var(--bt-border-secondary);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-400);
  font-weight: var(--bt-font-weight-semibold);
  text-align: start;
  vertical-align: middle;
  white-space: nowrap;
}
.bt-IndexTable__Heading .bt-Badge { margin-inline-start: var(--bt-space-150); vertical-align: middle; }
/* A heading with a tooltip: a dotted underline on the title; the Tooltip wrapper keeps the cell's alignment. */
.bt-IndexTable__HeadingTitle--tooltip {
  text-decoration: underline dotted var(--bt-border-strong);
  text-decoration-thickness: var(--bt-border-width-2);
  text-underline-offset: 0.25em;
}
.bt-IndexTable__Heading:not(.bt-IndexTable__Heading--sortable) .bt-IndexTable__HeadingTitle--tooltip { cursor: help; }
.bt-IndexTable__Heading .bt-Tooltip__activator { vertical-align: middle; }
.bt-IndexTable__Heading--alignCenter { text-align: center; }
.bt-IndexTable__Heading--alignEnd { text-align: end; }
.bt-IndexTable__Heading--flush { padding-inline: 0; }

.bt-IndexTable__SortButton {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-100);
  margin-inline: calc(var(--bt-space-150) * -1);
  padding: var(--bt-space-050) var(--bt-space-150);
  border: 0;
  border-radius: var(--bt-radius-200);
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-IndexTable__SortLabel { display: inline-flex; align-items: center; gap: var(--bt-space-100); }
.bt-IndexTable__Heading--alignEnd .bt-IndexTable__SortLabel { flex-direction: row-reverse; }
.bt-IndexTable__SortButton:hover,
.bt-IndexTable__SortButton--active { color: var(--bt-text); }
.bt-IndexTable__SortButton:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-IndexTable__SortIcon { display: inline-flex; opacity: 0; transition: opacity var(--bt-duration-fast) var(--bt-ease-emphasized); }
.bt-IndexTable__SortButton:hover .bt-IndexTable__SortIcon,
.bt-IndexTable__SortButton:focus-visible .bt-IndexTable__SortIcon,
.bt-IndexTable__SortButton--active .bt-IndexTable__SortIcon { opacity: 1; }

/* --- cells ------------------------------------------------------------------- */
.bt-IndexTable__Cell {
  padding-block: var(--bt-space-300);
  padding-inline: var(--bt-space-400);
  background: var(--bt-bg-surface);
  border-bottom: var(--bt-border-width-1) solid var(--bt-border-secondary);
  font-weight: inherit;
  text-align: start;
  vertical-align: middle;
  white-space: nowrap;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-IndexTable__Cell--flush { padding-inline: 0; }
.bt-IndexTable__Cell--alignCenter { text-align: center; }
.bt-IndexTable__Cell--alignEnd { text-align: end; }
tbody > .bt-IndexTable__Row:last-child > .bt-IndexTable__Cell { border-bottom: 0; }

.bt-IndexTable__CheckboxCell {
  width: var(--bt-it-check);
  min-width: var(--bt-it-check);
  padding-inline: var(--bt-space-400) var(--bt-space-100);
  padding-block: 0;
  line-height: 0;
}
.bt-IndexTable__CheckboxCell .bt-Choice { vertical-align: middle; }

/* --- sticky columns ------------------------------------------------------------- */
.bt-IndexTable__CheckboxCell { position: sticky; left: 0; z-index: 2; }
.bt-IndexTable__Heading.bt-IndexTable__CheckboxCell { z-index: 4; }
.bt-IndexTable__Heading--first,
.bt-IndexTable__Row > .bt-IndexTable__CheckboxCell + .bt-IndexTable__Cell,
.bt-IndexTable:not(.bt-IndexTable--selectable) .bt-IndexTable__Row > .bt-IndexTable__Cell:first-child {
  position: sticky;
  left: var(--bt-it-first-left);
  z-index: 2;
}
.bt-IndexTable__Heading--first { z-index: 3; }
.bt-IndexTable--scrolledStart .bt-IndexTable__Heading--first,
.bt-IndexTable--scrolledStart .bt-IndexTable__Row > .bt-IndexTable__CheckboxCell + .bt-IndexTable__Cell,
.bt-IndexTable--scrolledStart:not(.bt-IndexTable--selectable) .bt-IndexTable__Row > .bt-IndexTable__Cell:first-child {
  box-shadow: inset calc(var(--bt-border-width-1) * -1) 0 0 var(--bt-border);
}
.bt-IndexTable--lastColumnSticky .bt-IndexTable__HeadingRow > .bt-IndexTable__Heading:last-child,
.bt-IndexTable--lastColumnSticky .bt-IndexTable__Row > .bt-IndexTable__Cell:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
}
.bt-IndexTable--lastColumnSticky.bt-IndexTable--scrolledEnd .bt-IndexTable__HeadingRow > .bt-IndexTable__Heading:last-child,
.bt-IndexTable--lastColumnSticky.bt-IndexTable--scrolledEnd .bt-IndexTable__Row > .bt-IndexTable__Cell:last-child {
  box-shadow: inset var(--bt-border-width-1) 0 0 var(--bt-border);
}

/* --- row states (painted on the cells, so the sticky cells match) -------------------- */
.bt-IndexTable__Row--clickable { cursor: pointer; }
.bt-IndexTable__Row--toneSubdued > .bt-IndexTable__Cell { color: var(--bt-text-secondary); }
.bt-IndexTable__Row--toneSuccess > .bt-IndexTable__Cell { background: var(--bt-bg-success-subtle); }
.bt-IndexTable__Row--toneWarning > .bt-IndexTable__Cell { background: var(--bt-bg-warning-subtle); }
.bt-IndexTable__Row--toneCritical > .bt-IndexTable__Cell { background: var(--bt-bg-critical-subtle); }
.bt-IndexTable__Row--subheader > .bt-IndexTable__Cell { background: var(--bt-bg-surface-secondary); }
.bt-IndexTable__Row:not(.bt-IndexTable__Row--disabled):not(.bt-IndexTable__Row--skeleton):hover > .bt-IndexTable__Cell { background: var(--bt-bg-surface-hover); }
.bt-IndexTable__Row--selected > .bt-IndexTable__Cell,
.bt-IndexTable__Row--selected:not(.bt-IndexTable__Row--disabled):hover > .bt-IndexTable__Cell { background: var(--bt-bg-surface-selected); }
.bt-IndexTable__Row--disabled { cursor: default; }

/* --- bulk bar ---------------------------------------------------------------------- */
.bt-IndexTable__BulkBar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: max-content; /* replaced inline by the visible width minus the selection column */
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  padding-inline: var(--bt-space-300) var(--bt-space-400);
  background: var(--bt-bg-surface);
  border-bottom: var(--bt-border-width-1) solid var(--bt-border-secondary);
  color: var(--bt-text);
  line-height: normal;
  white-space: nowrap;
  text-align: start;
}
.bt-IndexTable__BulkCount {
  color: var(--bt-text);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-semibold);
}
.bt-IndexTable__BulkActions { display: inline-flex; align-items: center; gap: var(--bt-space-200); }

/* --- sticky header ------------------------------------------------------------------
   A zero-height sticky layer in front of the scroll box; while the real header row is out of view it holds
   a copy of the row (same cells, widths measured from the real ones, scrollLeft synced in JS), so the sticky
   columns and the bulk bar work in it too. No motion: it appears in place of the real row. */
.bt-IndexTable__StickyLayer {
  position: sticky;
  top: var(--bt-index-table-sticky-top, 0px); /* set it on the page for its own sticky bar */
  z-index: var(--bt-z-raised);
  height: 0;
}
.bt-IndexTable__StickyHeader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden; /* scrolled sideways by script, in step with the rows */
  background: var(--bt-bg-surface);
  box-shadow: var(--bt-shadow-100);
}
.bt-IndexTable__StickyTable { table-layout: fixed; }
.bt-IndexTable__StickyTable .bt-IndexTable__Heading { border-bottom: var(--bt-border-width-1) solid var(--bt-border-secondary); }

/* --- condensed: stacked cells, a select-all bar in place of the header ---------------- */
.bt-IndexTable__CondensedBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-200) var(--bt-space-300);
  min-height: var(--bt-size-control-md);
  padding: var(--bt-space-100) var(--bt-it-edge, var(--bt-space-400));
  background: var(--bt-bg-surface);
  border-bottom: var(--bt-border-width-1) solid var(--bt-border-secondary);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-300);
  font-weight: var(--bt-font-weight-semibold);
}
.bt-IndexTable--condensed thead { display: none; }
.bt-IndexTable--condensed .bt-IndexTable__Table,
.bt-IndexTable--condensed tbody { display: block; }
.bt-IndexTable--condensed .bt-IndexTable__Row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  border-bottom: var(--bt-border-width-1) solid var(--bt-border-secondary);
}
.bt-IndexTable--condensed tbody > .bt-IndexTable__Row:last-child { border-bottom: 0; }
.bt-IndexTable--condensed .bt-IndexTable__Cell {
  display: block;
  position: static;
  grid-column: 2;
  padding-block: var(--bt-space-050);
  border-bottom: 0;
  box-shadow: none;
  white-space: normal;
}
.bt-IndexTable--condensed .bt-IndexTable__Row > .bt-IndexTable__Cell:not(.bt-IndexTable__CheckboxCell) { padding-inline-start: 0; }
.bt-IndexTable--condensed .bt-IndexTable__Row > .bt-IndexTable__Cell:not(.bt-IndexTable__Cell--flush) { padding-inline-end: var(--bt-it-edge, var(--bt-space-400)); }
.bt-IndexTable--condensed:not(.bt-IndexTable--selectable) .bt-IndexTable__Row > .bt-IndexTable__Cell { padding-inline-start: var(--bt-it-edge, var(--bt-space-400)); }
.bt-IndexTable--condensed .bt-IndexTable__CheckboxCell {
  grid-column: 1;
  grid-row: 1 / span 24;
  padding-block: var(--bt-space-300);
  padding-inline: var(--bt-it-edge, var(--bt-space-400)) var(--bt-space-300);
  line-height: 0;
}
/* The first stacked cell opens the row: after the checkbox cell, or the first child without selection. */
.bt-IndexTable--condensed .bt-IndexTable__Row > .bt-IndexTable__CheckboxCell + .bt-IndexTable__Cell,
.bt-IndexTable--condensed .bt-IndexTable__Row > .bt-IndexTable__Cell:not(.bt-IndexTable__CheckboxCell):first-child { padding-top: var(--bt-space-300); }
.bt-IndexTable--condensed .bt-IndexTable__Row > .bt-IndexTable__Cell:last-child { padding-bottom: var(--bt-space-300); }
/* Under a flush Card's header the condensed rows line up with it: the header's space-500 edge inset (the cells'
   space-400 elsewhere), and space-100 under the header, since the first row's own space-300 (or the select-all
   bar's height) already makes the gap. */
.bt-Card--flush > .bt-Card__header:has(+ .bt-IndexTable--condensed) { margin-bottom: var(--bt-space-100); }
.bt-Card--flush > .bt-Card__header + .bt-IndexTable--condensed { --bt-it-edge: var(--bt-space-500); }

/* --- loading, skeleton, empty ------------------------------------------------------- */
.bt-IndexTable__LoadingOverlay {
  position: absolute;
  inset: var(--bt-size-control-md) 0 0 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: var(--bt-space-800);
  background: color-mix(in srgb, var(--bt-bg-surface) 70%, transparent);
}
.bt-IndexTable--condensed .bt-IndexTable__LoadingOverlay { inset: 0; }
.bt-IndexTable__Skeleton {
  display: block;
  width: 70%;
  min-width: var(--bt-space-1200);
  height: var(--bt-space-300);
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface-active);
  animation: bt-IndexTable-pulse calc(var(--bt-duration-slower) * 3) var(--bt-ease-emphasized) infinite alternate;
}
.bt-IndexTable__Skeleton--box { width: var(--bt-size-icon-md); min-width: 0; height: var(--bt-size-icon-md); border-radius: var(--bt-radius-200); }
.bt-IndexTable__Row--skeleton > .bt-IndexTable__Cell { height: var(--bt-size-control-lg); }
@keyframes bt-IndexTable-pulse { from { opacity: 1; } to { opacity: 0.45; } }

.bt-IndexTable__EmptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bt-space-200);
  padding: var(--bt-space-1000) var(--bt-space-500);
  color: var(--bt-text-secondary);
  text-align: center;
}
/* The template's empty tile: a size-empty-tile rounded square on the secondary card colour with a hairline. */
.bt-IndexTable__EmptyIcon {
  display: grid;
  place-items: center;
  width: var(--bt-size-empty-tile);
  height: var(--bt-size-empty-tile);
  margin-bottom: var(--bt-space-100);
  border-radius: var(--bt-radius-350);
  background: var(--bt-bg-surface-secondary);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
  color: var(--bt-text);
}
.bt-IndexTable__EmptyTitle { color: var(--bt-text); font-size: var(--bt-font-size-375); line-height: var(--bt-font-line-height-500); font-weight: var(--bt-font-weight-semibold); }
.bt-IndexTable__EmptyText { max-width: 36ch; font-size: var(--bt-font-size-312); line-height: var(--bt-font-line-height-450); font-weight: var(--bt-font-weight-medium); }

@media (prefers-reduced-motion: reduce) {
  .bt-IndexTable__Cell,
  .bt-IndexTable__SortButton,
  .bt-IndexTable__SortIcon { transition: none; }
  .bt-IndexTable__Skeleton { animation: none; }
}

@media print {
  .bt-IndexTable__StickyLayer { display: none; }
}

@media (forced-colors: active) {
  .bt-IndexTable__Row--selected > .bt-IndexTable__Cell { background: Highlight; color: HighlightText; }
  .bt-IndexTable__SortButton:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* --- InlineEdit --- */
/* A value shown as text that turns into a field. The display is a borderless button the field's height, so
   the row does not jump when it opens; a pencil shows on hover and focus. In a table cell (slim) it fits the row. */
.bt-InlineEdit { display: flex; align-items: flex-start; gap: var(--bt-space-100); min-inline-size: 0; }
.bt-InlineEdit--alignEnd { justify-content: flex-end; }
.bt-InlineEdit__Display {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-150);
  max-inline-size: 100%;
  min-block-size: var(--bt-size-control-md);
  margin: 0;
  margin-inline: calc(-1 * var(--bt-space-200));
  padding: 0 var(--bt-space-200);
  border: 0;
  border-radius: var(--bt-radius-200);
  background: transparent;
  color: var(--bt-text);
  font: inherit;
  text-align: start;
  cursor: text;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-InlineEdit--slim .bt-InlineEdit__Display { min-block-size: var(--bt-size-control-sm); }
.bt-InlineEdit__Display:hover:not(:disabled) { background: var(--bt-bg-surface-hover); }
.bt-InlineEdit__Display:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-InlineEdit__Display:disabled { cursor: default; color: var(--bt-text-secondary); }
.bt-InlineEdit__Display--empty .bt-InlineEdit__Value { color: var(--bt-text-secondary); }
.bt-InlineEdit__Value { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-InlineEdit__Pencil {
  display: inline-flex;
  flex: none;
  color: var(--bt-text-secondary);
  opacity: 0;
  transition: opacity var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-InlineEdit__Display:hover .bt-InlineEdit__Pencil,
.bt-InlineEdit__Display:focus-visible .bt-InlineEdit__Pencil { opacity: 1; }
@media (hover: none) { .bt-InlineEdit__Pencil { opacity: 1; } }
.bt-InlineEdit__Field { flex: 1; min-inline-size: 0; }
.bt-InlineEdit__Actions { display: flex; flex: none; gap: var(--bt-space-100); padding-block-start: var(--bt-space-050); }
.bt-InlineEdit--slim .bt-InlineEdit__Actions { padding-block-start: 0; }
@media (forced-colors: active) {
  .bt-InlineEdit__Display:focus-visible { outline: 2px solid Highlight; outline-offset: 1px; }
}

/* --- InlineError --- */
/* Error text: text-critical keeps 4.5:1 on bg and surfaces in both themes. */
.bt-InlineError {
  display: flex;
  align-items: flex-start;
  gap: var(--bt-space-150);
  color: var(--bt-text-critical);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-medium);
}
.bt-InlineError__Icon {
  display: inline-flex;
  flex: none;
  /* centres the 16px icon on the 18px line */
  margin-top: var(--bt-space-025);
}
.bt-InlineError__Text { min-width: 0; overflow-wrap: anywhere; }

@media (forced-colors: active) {
  .bt-InlineError { color: CanvasText; }
}

/* --- InlineGrid --- */
/* InlineGrid: a CSS grid of columns. Columns and gap per breakpoint come in as custom properties
   (InlineGrid.tsx writes all five); widths are the breakpoint tokens (media queries cannot read var()). */
.bt-InlineGrid {
  display: grid;
  min-width: 0;
}
.bt-InlineGrid > * { min-width: 0; }

.bt-InlineGrid--alignItemsStart { align-items: start; }
.bt-InlineGrid--alignItemsCenter { align-items: center; }
.bt-InlineGrid--alignItemsEnd { align-items: end; }

.bt-InlineGrid--columns { grid-template-columns: var(--bt-InlineGrid-columns-xs); }
.bt-InlineGrid--gap { gap: var(--bt-InlineGrid-gap-xs); }
@media (min-width: 480px) {
  .bt-InlineGrid--columns { grid-template-columns: var(--bt-InlineGrid-columns-sm); }
  .bt-InlineGrid--gap { gap: var(--bt-InlineGrid-gap-sm); }
}
@media (min-width: 768px) {
  .bt-InlineGrid--columns { grid-template-columns: var(--bt-InlineGrid-columns-md); }
  .bt-InlineGrid--gap { gap: var(--bt-InlineGrid-gap-md); }
}
@media (min-width: 1024px) {
  .bt-InlineGrid--columns { grid-template-columns: var(--bt-InlineGrid-columns-lg); }
  .bt-InlineGrid--gap { gap: var(--bt-InlineGrid-gap-lg); }
}
@media (min-width: 1440px) {
  .bt-InlineGrid--columns { grid-template-columns: var(--bt-InlineGrid-columns-xl); }
  .bt-InlineGrid--gap { gap: var(--bt-InlineGrid-gap-xl); }
}

/* --- InlineStack --- */
.bt-InlineStack {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.bt-InlineStack--list { list-style: none; }
.bt-InlineStack--noWrap { flex-wrap: nowrap; }
.bt-InlineStack--reverse { flex-direction: row-reverse; }

.bt-InlineStack--alignStart { justify-content: flex-start; }
.bt-InlineStack--alignCenter { justify-content: center; }
.bt-InlineStack--alignEnd { justify-content: flex-end; }
.bt-InlineStack--alignSpaceAround { justify-content: space-around; }
.bt-InlineStack--alignSpaceBetween { justify-content: space-between; }
.bt-InlineStack--alignSpaceEvenly { justify-content: space-evenly; }

.bt-InlineStack--blockAlignStart { align-items: flex-start; }
.bt-InlineStack--blockAlignCenter { align-items: center; }
.bt-InlineStack--blockAlignEnd { align-items: flex-end; }
.bt-InlineStack--blockAlignBaseline { align-items: baseline; }
.bt-InlineStack--blockAlignStretch { align-items: stretch; }

/* Gap per breakpoint; widths are the breakpoint tokens (media queries cannot read var()). */
.bt-InlineStack--gap { gap: var(--bt-InlineStack-gap-xs); }
@media (min-width: 480px) { .bt-InlineStack--gap { gap: var(--bt-InlineStack-gap-sm); } }
@media (min-width: 768px) { .bt-InlineStack--gap { gap: var(--bt-InlineStack-gap-md); } }
@media (min-width: 1024px) { .bt-InlineStack--gap { gap: var(--bt-InlineStack-gap-lg); } }
@media (min-width: 1440px) { .bt-InlineStack--gap { gap: var(--bt-InlineStack-gap-xl); } }

/* --- Kbd --- */
/* Kbd: a key cap on the card colour with an inset hairline; bold 11px secondary text. size-kbd (24px) high, at
   least size-kbd-min (26px) wide, corners radius-175 (7px). */
.bt-Kbd {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: var(--bt-size-kbd-min);
  height: var(--bt-size-kbd);
  padding: 0 var(--bt-space-150);
  border-radius: var(--bt-radius-175);
  background: var(--bt-bg-surface);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border);
  color: var(--bt-text-secondary);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-275);
  line-height: 1;
  font-weight: var(--bt-font-weight-bold);
  white-space: nowrap;
  vertical-align: middle;
}

@media (forced-colors: active) {
  .bt-Kbd { border: 1px solid CanvasText; }
}

/* --- KeyValueEditor --- */
/* Rows of key / value fields (and an optional type Select), a remove button each, an add button under them.
   One grid template for the head and every row so the columns line up; under 480px wide a row stacks. */
.bt-KeyValueEditor {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
  min-inline-size: 0;
  --bt-kv-cols: minmax(0, 2fr) minmax(0, 3fr) var(--bt-size-control-md);
}
.bt-KeyValueEditor--typed { --bt-kv-cols: minmax(0, 2fr) minmax(0, 3fr) minmax(0, 1.4fr) var(--bt-size-control-md); }
.bt-KeyValueEditor__Label {
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-semibold);
  color: var(--bt-text);
}
.bt-KeyValueEditor__Head,
.bt-KeyValueEditor__Row {
  display: grid;
  grid-template-columns: var(--bt-kv-cols);
  gap: var(--bt-space-200);
  align-items: start;
}
.bt-KeyValueEditor__Head {
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-400);
  font-weight: var(--bt-font-weight-medium);
  color: var(--bt-text-secondary);
}
.bt-KeyValueEditor__Rows {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
  margin: 0;
  padding: 0;
  list-style: none;
}
.bt-KeyValueEditor__Cell { min-inline-size: 0; }
.bt-KeyValueEditor__Remove { display: flex; justify-content: center; }
.bt-KeyValueEditor__Add { display: flex; }
.bt-KeyValueEditor__Help {
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  color: var(--bt-text-secondary);
}
@media (max-width: 479.98px) {
  .bt-KeyValueEditor__Head { display: none; }
  .bt-KeyValueEditor__Row { grid-template-columns: minmax(0, 1fr) var(--bt-size-control-md); }
  .bt-KeyValueEditor__Row > .bt-KeyValueEditor__Cell { grid-column: 1; }
  .bt-KeyValueEditor__Remove { grid-column: 2; grid-row: 1; }
}

/* --- Labelled --- */
/* Labelled: label above, field, then error and help text. */
.bt-Labelled {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-150);
  min-width: 0;
  color: var(--bt-text);
}
.bt-Labelled__LabelWrapper { display: flex; align-items: baseline; gap: var(--bt-space-200); }
.bt-Labelled__Action { margin-inline-start: auto; flex: none; }
.bt-Labelled__Label {
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-semibold);
  color: var(--bt-text);
}
.bt-Labelled__Required {
  margin-inline-start: var(--bt-space-050);
  color: var(--bt-text-critical);
}
/* A disabled field's label stays readable: text-secondary (5.1:1 on bg, 5.4:1 on bg-surface, 4.8:1 on
   bg-surface-secondary light; 6.3:1+ dark), set apart from an enabled label's `text`. The disabled input's own
   text keeps text-disabled (inactive UI, WCAG 1.4.3 exempt). */
.bt-Labelled--disabled .bt-Labelled__Label { color: var(--bt-text-secondary); }
.bt-Labelled__HelpText,
.bt-Choice__HelpText {
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  color: var(--bt-text-secondary);
}

/* Choice: the shared layout of Checkbox, RadioButton and Switch. */
.bt-Choice { display: inline-flex; flex-direction: column; gap: var(--bt-space-050); color: var(--bt-text); }
.bt-Choice--fill { display: flex; width: 100%; }
.bt-Choice__Row {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--bt-space-200);
  cursor: pointer;
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
}
.bt-Choice--fill .bt-Choice__Row { display: flex; }
.bt-Choice__Control { position: relative; display: inline-flex; flex: none; }
.bt-Choice__Label { min-width: 0; overflow-wrap: anywhere; }
.bt-Choice--disabled .bt-Choice__Row { cursor: default; }
.bt-Choice--disabled .bt-Choice__Label { color: var(--bt-text-secondary); }
/* Help and error line up with the label text: control width (size-icon-md) plus the row gap. */
.bt-Choice__Descriptions {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-050);
  padding-inline-start: calc(var(--bt-size-icon-md) + var(--bt-space-200));
}
/* The switch track is 42 wide (size-control-md plus a 2px hairline allowance, see Switch.css). */
.bt-SwitchChoice .bt-Choice__Descriptions { padding-inline-start: calc(var(--bt-size-control-md) + var(--bt-space-050) + var(--bt-space-300)); }
.bt-SwitchChoice .bt-Choice__Row { gap: var(--bt-space-300); }
/* The 20px label line sits centred on the 24px track. */
.bt-SwitchChoice:not(.bt-Choice--reversed) .bt-Choice__Label { padding-top: var(--bt-space-050); }
.bt-Choice--labelHidden .bt-Choice__Descriptions { padding-inline-start: 0; }

/* Reversed (Switch labelPosition="start"): a settings row, label and help on the left, the control at the far end,
   centred over both lines. The label element keeps its click target through `display: contents`. */
.bt-Choice--reversed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--bt-space-400);
  row-gap: var(--bt-space-050);
  align-items: center;
}
.bt-Choice--reversed .bt-Choice__Row { display: contents; }
.bt-Choice--reversed .bt-Choice__Label { grid-column: 1; grid-row: 1; cursor: pointer; }
.bt-Choice--reversed .bt-Choice__Control { grid-column: 2; grid-row: 1 / span 2; }
.bt-Choice--reversed .bt-Choice__Descriptions,
.bt-SwitchChoice.bt-Choice--reversed .bt-Choice__Descriptions { grid-column: 1; grid-row: 2; padding-inline-start: 0; }
.bt-Choice--reversed.bt-Choice--disabled .bt-Choice__Label { cursor: default; }

/* --- Layout --- */
/* Layout: sections wrap onto rows by their own width (flex-wrap), so a Layout stacks in a narrow container
   as well as on a narrow screen. Flex bases: size-layout-primary, -half and -third; below about 46rem of
   container width every pair stacks. Gaps follow the template's rhythm: 12px on phones, 16px from md up. */
.bt-Layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--bt-space-300);
  min-width: 0;
}
@media (min-width: 768px) { .bt-Layout { gap: var(--bt-space-400); } }

.bt-Layout__Section {
  flex: 2 2 var(--bt-size-layout-primary);
  min-width: 51%;
}
.bt-Layout__Section--oneHalf { flex: 1 1 var(--bt-size-layout-half); min-width: 0; }
.bt-Layout__Section--oneThird { flex: 1 1 var(--bt-size-layout-third); min-width: 0; }
.bt-Layout__Section--fullWidth { flex: 1 1 100%; min-width: 0; }

.bt-Layout__AnnotatedSection {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--bt-space-300);
  min-width: 0;
}
@media (min-width: 768px) { .bt-Layout__AnnotatedSection { gap: var(--bt-space-400); } }

.bt-Layout__Annotation {
  flex: 1 1 var(--bt-size-layout-third);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
  padding-block-start: var(--bt-space-200);
  color: var(--bt-text);
}
.bt-Layout__Description { color: var(--bt-text-secondary); }
.bt-Layout__AnnotationContent {
  flex: 2 2 var(--bt-size-layout-primary);
  min-width: 51%;
}

/* --- Legend --- */
/* Legend: series keys beside their names, the template's legend (12.5px, 600, rounded keys, pill toggles). The key
   carries the color; text wears viz-label, never the series color. */
.bt-Legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-100) var(--bt-space-300);
  color: var(--bt-viz-label);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-312);
  line-height: 1.4;
  font-weight: 600;
}

.bt-Legend__list {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bt-Legend__list--horizontal { flex-wrap: wrap; gap: var(--bt-space-150) 14px; }
/* Vertical: the items stretch to the widest one, so the values line up at the end. */
.bt-Legend--vertical { flex-direction: column; align-items: flex-start; }
.bt-Legend__list--vertical { display: inline-flex; flex-direction: column; gap: var(--bt-space-050); min-width: 0; }
.bt-Legend__list > li { display: flex; min-width: 0; }

.bt-Legend__item {
  display: flex;
  align-items: center;
  gap: var(--bt-space-150);
  /* 24px: the WCAG 2.5.8 minimum target (space-600). */
  min-height: var(--bt-space-600);
  min-width: 0;
  flex: 1 1 auto;
}

.bt-Legend__label { color: var(--bt-viz-label-muted); overflow-wrap: anywhere; }
.bt-Legend--interactive .bt-Legend__label { color: var(--bt-viz-label); }
.bt-Legend__value {
  margin-inline-start: auto;
  padding-inline-start: var(--bt-space-300);
  color: var(--bt-viz-label);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bt-Legend__list--horizontal .bt-Legend__value { padding-inline-start: var(--bt-space-100); }

/* Keys mirror the mark. viz-ring keeps light fills visible on viz-surface. */
.bt-Legend__key {
  flex: none;
  display: inline-block;
  background: var(--bt-legend-color);
  box-shadow: inset 0 0 0 1px var(--bt-viz-ring);
}
.bt-Legend__key--swatch { width: 10px; height: 10px; border-radius: 3px; }
.bt-Legend__key--dot { width: var(--bt-space-200); height: var(--bt-space-200); margin-inline: 1px; border-radius: var(--bt-radius-full); }
/* A 2px line, round-capped like the chart's line marks (2px: the line mark width, no token). */
.bt-Legend__key--line { width: var(--bt-space-400); height: 2px; border-radius: var(--bt-radius-full); box-shadow: none; }
/* The opt-in texture channel: a 45° hatch of the series color on the surface (2px lines, 2px gaps). */
.bt-Legend__key--texture {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, var(--bt-legend-color) 0 2px, var(--bt-viz-surface) 2px 4px);
}

/* Interactive: every item is a toggle button. */
.bt-Legend__toggle,
.bt-Legend__reset {
  margin: 0;
  padding: var(--bt-space-050) 10px;
  border: 0;
  border-radius: var(--bt-radius-full);
  background: transparent;
  color: var(--bt-viz-label);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Legend--interactive .bt-Legend__list--horizontal { gap: var(--bt-space-050) var(--bt-space-100); }
.bt-Legend__toggle:hover,
.bt-Legend__reset:hover { background: var(--bt-bg-surface-hover); }
.bt-Legend__toggle:active,
.bt-Legend__reset:active { background: var(--bt-bg-surface-active); }
.bt-Legend__toggle:focus-visible,
.bt-Legend__reset:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }

/* A hidden series: the key empties to its outline (a shape change, not only a fade) and the text turns muted (still 4.5:1). */
.bt-Legend__toggle--hidden .bt-Legend__key {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--bt-legend-color);
}
.bt-Legend__toggle--hidden .bt-Legend__key--line { box-shadow: none; background: transparent; border-top: 2px dotted var(--bt-legend-color); height: 0; border-radius: 0; }
.bt-Legend__toggle--hidden .bt-Legend__label,
.bt-Legend__toggle--hidden .bt-Legend__value { color: var(--bt-viz-label-muted); }

.bt-Legend__reset {
  display: inline-flex;
  align-items: center;
  min-height: var(--bt-space-600);
  font-weight: 600;
  color: var(--bt-text-brand);
}

/* ScaleLegend: seven stepped swatches parted by 2px viz-surface gaps, labels under the ends and the middle. */
.bt-ScaleLegend {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-100);
  min-width: 0;
  color: var(--bt-viz-label);
  font-family: var(--bt-font-sans);
}
.bt-ScaleLegend__title {
  margin: 0;
  font-size: var(--bt-font-size-312);
  line-height: 1.4;
  font-weight: 600;
  color: var(--bt-viz-label);
}
.bt-ScaleLegend__scale { display: flex; flex-direction: column; gap: var(--bt-space-100); }
.bt-ScaleLegend__steps { display: flex; gap: 3px; }
.bt-ScaleLegend__step {
  flex: 1 1 0;
  height: var(--bt-space-300);
  box-shadow: inset 0 0 0 1px var(--bt-viz-ring);
}
.bt-ScaleLegend__step:first-child { border-start-start-radius: var(--bt-radius-full); border-end-start-radius: var(--bt-radius-full); }
.bt-ScaleLegend__step:last-child { border-start-end-radius: var(--bt-radius-full); border-end-end-radius: var(--bt-radius-full); }
.bt-ScaleLegend__labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--bt-space-200);
  color: var(--bt-viz-label-muted);
  /* The axis-tick size. */
  font-size: var(--bt-font-size-275);
  line-height: 1.4;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.bt-ScaleLegend__mid { text-align: center; }
.bt-ScaleLegend__max { text-align: end; }

@media (prefers-reduced-motion: reduce) {
  .bt-Legend__toggle,
  .bt-Legend__reset { transition: none; }
}

@media (forced-colors: active) {
  .bt-Legend__key,
  .bt-ScaleLegend__step { forced-color-adjust: none; outline: 1px solid CanvasText; }
  .bt-Legend__toggle[aria-pressed="true"] { outline: 1px solid ButtonText; }
  .bt-Legend__toggle:focus-visible,
  .bt-Legend__reset:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* --- LineChart --- */
/* LineChart (and AreaChart): labelled axes, 2.2px lines in the series color (set inline), the earlier period dashed
   and thinner; a dashed viz-grid, the zero line and the crosshair viz-axis, 11px labels in viz-label-muted. */
.bt-LineChart {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
  width: 100%;
  min-width: 0;
  font-family: var(--bt-font-sans);
}

.bt-LineChart__plot {
  position: relative;
  width: 100%;
  border-radius: var(--bt-radius-250);
  cursor: crosshair;
  touch-action: pan-y;
}
.bt-LineChart__plot:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }

.bt-LineChart__svg { display: block; overflow: visible; }

/* The template's grid: dashed hairlines, the zero line solid. */
.bt-LineChart__grid { stroke: var(--bt-viz-grid); stroke-width: 1px; stroke-dasharray: 3 3; shape-rendering: crispEdges; }
.bt-LineChart__grid--zero { stroke: var(--bt-viz-axis); stroke-dasharray: none; }
.bt-LineChart__crosshair { stroke: var(--bt-viz-axis); stroke-width: 1px; shape-rendering: crispEdges; }

.bt-LineChart__tick {
  fill: var(--bt-viz-label-muted);
  font-size: var(--bt-font-size-275);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bt-LineChart__line {
  fill: none;
  stroke-width: 2.2px;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.bt-LineChart__line--previous { stroke-width: 1.6px; stroke-dasharray: 4 5; }
.bt-LineChart__area { stroke: none; }

/* The active point: a surface dot ringed in the series color. */
.bt-LineChart__dot { fill: var(--bt-viz-surface); stroke-width: 2.5px; }

/* A series' name at its last value, in label ink after a dot in the series color: the secondary encoding the weak
   color pairs need (slots 4/5 for deuteranopes); series colors are for marks, not text. */
.bt-LineChart__directText {
  fill: var(--bt-viz-label);
  font-size: var(--bt-font-size-300);
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--bt-viz-surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.bt-LineChart__readout { top: 0; left: 0; }

/* The legend's key for the earlier period is dashed like its line, so it does not rest on the color alone. */
.bt-LineChart [data-id="__previous"] .bt-Legend__key--line {
  background: repeating-linear-gradient(90deg, var(--bt-legend-color) 0 5px, transparent 5px 10px);
}

.bt-LineChart__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--bt-space-300);
  box-sizing: border-box;
  text-align: center;
  color: var(--bt-viz-label-muted);
  font-size: var(--bt-font-size-350);
  font-weight: 500;
}

@media (forced-colors: active) {
  .bt-LineChart__line { stroke: CanvasText !important; }
  .bt-LineChart__dot { fill: Canvas; stroke: CanvasText !important; }
  .bt-LineChart__area { fill: none; }
  .bt-LineChart__directText { fill: CanvasText; stroke: Canvas; }
  .bt-LineChart__directKey { fill: CanvasText !important; }
  .bt-LineChart__lone { fill: CanvasText !important; }
  .bt-LineChart__grid, .bt-LineChart__crosshair { stroke: GrayText; }
  .bt-LineChart__tick { fill: CanvasText; }
}

/* --- LineItem --- */
/* An order or product line: a small thumbnail, the title (a link when given), variant and muted meta lines, badges;
   at the end the controls (a narrow quantity field), "unit price × quantity" with an optional note, the semibold
   line total and plain actions. As a tile it is the card's inner tile (radius 14, bg-surface-secondary). Under
   480px of its own width the end drops below the details and spreads across the row. */
.bt-LineItem {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-300);
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--bt-text);
  list-style: none;
}
.bt-LineItem--tile {
  padding: var(--bt-LineItem-padding, var(--bt-space-300));
  border-radius: var(--bt-radius-350);
  background: var(--bt-bg-surface-secondary);
}
/* Added: the success tint with a soft success hairline, as the critical tile draws its edge. */
.bt-LineItem--tile.bt-LineItem--added {
  background: var(--bt-bg-success-subtle);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) color-mix(in oklab, var(--bt-border-success) 40%, transparent);
}
/* Removed: title and total struck through and muted (in the TSX), the picture in grey. */
.bt-LineItem--removed .bt-LineItem__media { filter: grayscale(1); }

.bt-LineItem__row {
  display: flex;
  align-items: flex-start;
  gap: var(--bt-space-300);
  min-width: 0;
}
.bt-LineItem__media { flex: none; display: inline-flex; }
.bt-LineItem__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--bt-space-300) var(--bt-space-400);
}
.bt-LineItem__details {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-100);
}
.bt-LineItem__badges { display: flex; flex-wrap: wrap; gap: var(--bt-space-100); padding-block-start: var(--bt-space-050); }
.bt-LineItem__end {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: var(--bt-space-400);
}
.bt-LineItem__controls,
.bt-LineItem__actions {
  display: flex;
  align-items: center;
  gap: var(--bt-space-200);
}
/* A control and a figure share one line: the figures sit on the field's middle line. */
.bt-LineItem__controls { min-height: var(--bt-size-control-md); }
.bt-LineItem__end:has(> .bt-LineItem__controls) > :not(.bt-LineItem__controls) { padding-block-start: calc((var(--bt-size-control-md) - 1lh) / 2); }
.bt-LineItem__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--bt-space-100);
  text-align: end;
}
.bt-LineItem__extra { min-width: 0; }
/* With a thumbnail, the extra content lines up with the details (the small thumbnail is size-control-md wide). */
.bt-LineItem:has(> .bt-LineItem__row > .bt-LineItem__media) > .bt-LineItem__extra { padding-inline-start: calc(var(--bt-size-control-md) + var(--bt-space-300)); }

@container (max-width: 479.98px) {
  .bt-LineItem__body { flex-wrap: wrap; }
  .bt-LineItem__details { flex-basis: 100%; }
  .bt-LineItem__end { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; }
  .bt-LineItem__end > .bt-LineItem__controls { margin-inline-end: auto; }
}

@media (forced-colors: active) {
  .bt-LineItem--tile { border: 1px solid CanvasText; }
}

/* --- Link --- */
/* Link: text-brand, underlined (running text needs more than colour), the line a little below the text. Inherits
   the surrounding type; removeUnderline (outside running text) underlines on hover only. */
.bt-Link {
  color: var(--bt-text-brand);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: var(--bt-border-width-1);
  text-underline-offset: 0.22em; /* em: scales with the surrounding text, no token family */
  border-radius: var(--bt-radius-100);
  cursor: pointer;
  transition:
    color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
/* A 24px target (WCAG 2.2 AA): vertical padding on an inline box grows what can
   be clicked without moving the text around it. */
.bt-Link { padding-block: var(--bt-space-100); }
/* A row's link can be one short name, too narrow to tap; the negative margin
   keeps the row from growing. */
.bt-Link[data-primary-link] {
  display: inline-block;
  min-width: 1.5rem; /* the 24px target; rem as the text it holds, no token family */
  margin-block: calc(-1 * var(--bt-space-100));
}
.bt-Link:hover { color: var(--bt-text-brand-hover); text-decoration-thickness: var(--bt-border-width-2); }
.bt-Link:focus { outline: none; }
.bt-Link:focus-visible { box-shadow: var(--bt-shadow-focus); }

.bt-Link--monochrome,
.bt-Link--monochrome:hover { color: inherit; }
.bt-Link--removeUnderline { text-decoration: none; }
.bt-Link--removeUnderline:hover { text-decoration: underline; }

/* A link without url is a <button>: strip the button box. */
.bt-Link--button {
  display: inline;
  margin: 0;
  padding: var(--bt-space-100) 0;
  border: 0;
  background: none;
  text-align: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .bt-Link { transition: none; }
}
@media (forced-colors: active) {
  .bt-Link { color: LinkText; }
  .bt-Link:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* --- MediaGallery --- */
/* A grid of square tiles; the first (primary) spans two columns and two rows. A tile shows its picture
   (cover-fit), a badge (primary, video), a select box top-left and round actions top-right (alt text, grip);
   these show on hover and focus, and stay while any tile is chosen. While dragging, the dragged tile follows the
   pointer as a lifted card and the slot under it wears a garnet ring. The add tile is a DropZone. */
.bt-MediaGallery { display: flex; flex-direction: column; gap: var(--bt-space-300); min-inline-size: 0; }
.bt-MediaGallery__Bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--bt-space-200);
  min-block-size: var(--bt-size-control-md);
}
.bt-MediaGallery__Grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--bt-space-1200) * 2 + var(--bt-space-400)), 1fr));
  grid-auto-flow: dense;
  gap: var(--bt-space-300);
  margin: 0;
  padding: 0;
  list-style: none;
}
.bt-MediaGallery__Tile,
.bt-MediaGallery__AddTile {
  position: relative;
  aspect-ratio: 1;
  min-inline-size: 0;
  border-radius: var(--bt-radius-350);
}
.bt-MediaGallery__Tile {
  overflow: hidden;
  background: var(--bt-bg-surface-secondary);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.bt-MediaGallery__Tile--primary { grid-column: span 2; grid-row: span 2; }
.bt-MediaGallery__Img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  pointer-events: none;
}
/* The ring sits over the picture. */
.bt-MediaGallery__Tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
  pointer-events: none;
}
.bt-MediaGallery__Tile--selected::after { box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-focus); }
.bt-MediaGallery__Tile--over::after { box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-brand); background: var(--bt-bg-overlay); opacity: 0.35; }
.bt-MediaGallery__Tile--dragging {
  z-index: 2;
  cursor: grabbing;
  box-shadow: var(--bt-shadow-soft-lg);
}
.bt-MediaGallery--dragging .bt-MediaGallery__Tile:not(.bt-MediaGallery__Tile--dragging) { transition: box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized); }
.bt-MediaGallery--dragging { cursor: grabbing; }

.bt-MediaGallery__Badge {
  position: absolute;
  inset-block-end: var(--bt-space-200);
  inset-inline-start: var(--bt-space-200);
  padding: 0 var(--bt-space-150);
  border-radius: var(--bt-radius-full);
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-semibold);
  pointer-events: none;
}
.bt-MediaGallery__Badge--primary { background: var(--bt-bg-surface); color: var(--bt-text); box-shadow: var(--bt-shadow-100); }
.bt-MediaGallery__Badge--video { inset-block-end: auto; inset-block-start: var(--bt-space-200); inset-inline-start: auto; inset-inline-end: var(--bt-space-200); background: var(--bt-bg-inverse); color: var(--bt-text-inverse); }
.bt-MediaGallery__Tile--primary .bt-MediaGallery__Badge--video { inset-block-start: auto; inset-block-end: var(--bt-space-200); }

.bt-MediaGallery__Select,
.bt-MediaGallery__Actions {
  position: absolute;
  inset-block-start: var(--bt-space-150);
  display: flex;
  gap: var(--bt-space-100);
  opacity: 0;
  transition: opacity var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-MediaGallery__Select {
  inset-inline-start: var(--bt-space-150);
  padding: var(--bt-space-050);
  border-radius: var(--bt-radius-200);
  background: var(--bt-bg-surface);
  box-shadow: var(--bt-shadow-100);
}
.bt-MediaGallery__Actions { inset-inline-end: var(--bt-space-150); }
.bt-MediaGallery__Tile:hover .bt-MediaGallery__Select,
.bt-MediaGallery__Tile:hover .bt-MediaGallery__Actions,
.bt-MediaGallery__Tile:focus-within .bt-MediaGallery__Select,
.bt-MediaGallery__Tile:focus-within .bt-MediaGallery__Actions,
.bt-MediaGallery__Tile--selecting .bt-MediaGallery__Select { opacity: 1; }
@media (hover: none) {
  .bt-MediaGallery__Select, .bt-MediaGallery__Actions { opacity: 1; }
}
.bt-MediaGallery__Tile--dragging .bt-MediaGallery__Select { opacity: 0; }
.bt-MediaGallery__Action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: var(--bt-size-control-sm);
  block-size: var(--bt-size-control-sm);
  padding: 0 var(--bt-space-100);
  border: 0;
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface);
  color: var(--bt-text);
  box-shadow: var(--bt-shadow-100);
  font: inherit;
  font-size: var(--bt-font-size-275);
  font-weight: var(--bt-font-weight-bold);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.bt-MediaGallery__Action:hover { background: var(--bt-bg-surface-hover); }
.bt-MediaGallery__Action:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-MediaGallery__Grip { cursor: grab; touch-action: none; }
.bt-MediaGallery__AddTile { display: flex; flex-direction: column; }
.bt-MediaGallery__AddTile > *,
.bt-MediaGallery__AddTile .bt-Labelled { display: flex; flex-direction: column; flex: 1; min-block-size: 0; }
.bt-MediaGallery__AddTile .bt-DropZone {
  flex: 1;
  flex-direction: column;
  box-sizing: border-box;
  padding: var(--bt-space-200);
  border-radius: var(--bt-radius-350);
}
.bt-MediaGallery__AddTile .bt-DropZone__Hint:empty { display: none; }
.bt-MediaGallery__AltForm { display: flex; gap: var(--bt-space-400); align-items: flex-start; }
.bt-MediaGallery__AltForm > :last-child { flex: 1; min-inline-size: 0; }
.bt-MediaGallery__AltPreview {
  flex: none;
  inline-size: calc(var(--bt-space-1200) * 2);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--bt-radius-200);
  background: var(--bt-bg-surface-secondary);
}
@media (max-width: 479.98px) {
  .bt-MediaGallery__AltForm { flex-direction: column; }
}
@media (forced-colors: active) {
  .bt-MediaGallery__Action:focus-visible { outline: 2px solid Highlight; outline-offset: 1px; }
  .bt-MediaGallery__Tile--over::after, .bt-MediaGallery__Tile--selected::after { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* --- Meter --- */
/* Meter: a value against its limit. Label row (label, amount, percent pill), then the template's 8px pill track in
   bg-surface-hover with the fill grown from the start, or a row of pill cells (full, part-filled from the bottom,
   empty as a faint ring). The tone sets --bt-meter-color: fill-brand, fill-success, border-caution (3:1 amber),
   fill-critical. */
.bt-Meter {
  --bt-meter-color: var(--bt-fill-brand);
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-150);
  min-width: 0;
  font-family: var(--bt-font-sans);
  color: inherit;
}
.bt-Meter--success { --bt-meter-color: var(--bt-fill-success); }
.bt-Meter--warning { --bt-meter-color: var(--bt-border-caution); }
.bt-Meter--critical { --bt-meter-color: var(--bt-fill-critical); }

.bt-Meter__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--bt-space-200); min-width: 0; }
.bt-Meter__label {
  font-size: var(--bt-font-size-337);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-Meter__detail {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-150);
  flex: none;
  font-size: var(--bt-font-size-312);
  font-weight: 600;
  color: var(--bt-text-secondary);
  font-variant-numeric: tabular-nums;
}
.bt-Meter__percent {
  padding: 1px 7px;
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface-secondary);
  color: var(--bt-text);
  font-size: var(--bt-font-size-275);
  font-weight: 700;
}

.bt-Meter__track { position: relative; display: block; }
.bt-Meter--bar .bt-Meter__track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface-hover);
}
.bt-Meter--bar.bt-Meter--small .bt-Meter__track { height: 6px; }
.bt-Meter__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--bt-meter-color);
  transform-origin: 0 50%;
  transform: scaleX(var(--bt-meter-fill));
  transition: transform var(--bt-duration-slow) var(--bt-ease-emphasized);
  /* Grows in from empty on mount; later changes use the transition. */
  animation: bt-Meter-grow var(--bt-duration-fill) var(--bt-ease-in-out) backwards;
}
.bt-Meter__fill:dir(rtl) { transform-origin: 100% 50%; }

.bt-Meter--segments .bt-Meter__track { display: flex; gap: 4px; height: 44px; }
.bt-Meter--segments.bt-Meter--small .bt-Meter__track { height: 28px; gap: 3px; }
.bt-Meter--segments.bt-Meter--small .bt-Meter__cell { flex-basis: 12px; }
.bt-Meter__cell {
  /* Tall narrow pills like the template's plan tile, however wide the meter is. */
  flex: 0 1 18px;
  min-width: 6px;
  border-radius: var(--bt-radius-full);
  /* The empty cell: a faint ring in the meter color (the template's 26% outline). */
  box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--bt-meter-color) 30%, transparent);
}
.bt-Meter__cell--full { background: var(--bt-meter-color); box-shadow: none; }
/* Filled cells pop in one after another on mount (--bt-meter-i, set per cell). */
.bt-Meter__cell--full,
.bt-Meter__cell--part {
  transform-origin: 50% 100%;
  animation: bt-Meter-cell var(--bt-duration-slow) var(--bt-ease-emphasized) backwards;
  animation-delay: calc(var(--bt-meter-i, 0) * 40ms);
}
.bt-Meter--still .bt-Meter__fill,
.bt-Meter--still .bt-Meter__cell { animation: none; }
@keyframes bt-Meter-grow { from { transform: scaleX(0); } }
@keyframes bt-Meter-cell { from { transform: scaleY(0); opacity: 0; } }
.bt-Meter__cell--part {
  background: linear-gradient(to top, var(--bt-meter-color) var(--bt-meter-part), transparent var(--bt-meter-part));
}

.bt-Meter__status {
  margin: 0;
  font-size: var(--bt-font-size-300);
  font-weight: 600;
  color: var(--bt-text-warning);
}
.bt-Meter--critical .bt-Meter__status { color: var(--bt-text-critical); }

@media (prefers-reduced-motion: reduce) {
  .bt-Meter__fill { transition: none; animation: none; }
  .bt-Meter__cell { animation: none; }
}

@media (forced-colors: active) {
  .bt-Meter--bar .bt-Meter__track { border: 1px solid CanvasText; }
  .bt-Meter__fill, .bt-Meter__cell--full { background: CanvasText; forced-color-adjust: none; }
  .bt-Meter__cell { box-shadow: inset 0 0 0 1px CanvasText; }
  .bt-Meter__cell--part { background: linear-gradient(to top, CanvasText var(--bt-meter-part), transparent var(--bt-meter-part)); forced-color-adjust: none; }
}

/* --- Modal --- */
/* Modal: bg-overlay backdrop, a bg-surface dialog with radius-650, a hairline ring and shadow-soft-lg. The
   header and footer have no rules: a 22px bold heading with an optional description, a round close button,
   actions at the end of the footer. Below 768px it is a bottom sheet (radius-600 top corners, 92% of the
   screen at most, a grip, full-width footer buttons). Motion: the dialog drops in from 18px above at 97%
   (duration-reveal, ease-out-expo) over a backdrop fading in (duration-slow), and leaves 10px up at 97%
   (duration-base, ease-exit); the sheet slides. Reduced motion and Frame motion="off" (bt-Modal-root--instant):
   none, it appears and goes at once. */
.bt-Modal-root {
  position: fixed;
  inset: 0;
  z-index: var(--bt-z-modal);
}
/* container prop: over one element instead of the page. */
.bt-Modal-root--contained { position: absolute; z-index: var(--bt-z-overlay); }

.bt-Modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--bt-bg-overlay);
  animation: bt-Modal-fade-in var(--bt-duration-slow) var(--bt-ease-standard) both;
}
.bt-Modal-root--closing .bt-Modal__backdrop { animation: bt-Modal-fade-out var(--bt-duration-base) var(--bt-ease-exit) both; }

.bt-Modal__container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--bt-space-500);
  overflow: hidden;
}

.bt-Modal {
  position: relative;
  display: flex;
  flex-direction: column;
  /* Dialog widths have no token family: 560px default, 380px small, 860px large. */
  width: 560px;
  max-width: 100%;
  max-height: 100%;
  background: var(--bt-bg-surface);
  color: var(--bt-text);
  border-radius: var(--bt-radius-650);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary), var(--bt-shadow-soft-lg);
  outline: none;
  overflow: hidden;
  /* backwards, not both: once the enter animation ends the dialog has no transform left, so it is not the
     containing block of the fixed-position popovers portaled into it (.bt-Modal__portals); they are placed
     against the viewport and not clipped by this overflow. */
  animation: bt-Modal-in var(--bt-duration-reveal) var(--bt-ease-out-expo) backwards;
}
/* The dialog itself is a programmatic focus target (tabindex -1, never a Tab stop), not a control:
   no ring on it; every control inside keeps its own focus ring. */
.bt-Modal:focus { outline: none; }
.bt-Modal-root--closing .bt-Modal { animation: bt-Modal-out var(--bt-duration-base) var(--bt-ease-exit) both; }
.bt-Modal-root--instant .bt-Modal,
.bt-Modal-root--instant .bt-Modal__backdrop { animation: none; }

.bt-Modal--sizeSmall { width: 380px; }
.bt-Modal--sizeLarge { width: 860px; }
.bt-Modal--sizeFullScreen { width: 980px; height: 100%; }
/* limitHeight: 600px cap (no token covers dialog heights). */
.bt-Modal--limitHeight { max-height: min(100%, 600px); }

.bt-Modal__grip { display: none; }

.bt-Modal__header {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: var(--bt-space-300);
  padding: var(--bt-space-500) var(--bt-space-500) var(--bt-space-150) var(--bt-space-600);
}
.bt-Modal__heading { flex: 1 1 auto; min-width: 0; padding-top: var(--bt-space-100); }
.bt-Modal__title {
  margin: 0;
  font: var(--bt-font-weight-bold) var(--bt-font-size-550) / var(--bt-font-line-height-700) var(--bt-font-sans);
  letter-spacing: -0.015em;
  color: var(--bt-text);
  overflow-wrap: anywhere;
}
.bt-Modal__description {
  margin: var(--bt-space-100) 0 0;
  font: var(--bt-font-weight-medium) var(--bt-font-size-312) / var(--bt-font-line-height-450) var(--bt-font-sans);
  color: var(--bt-text-secondary);
}
.bt-Modal__close { flex: none; margin-left: auto; display: inline-flex; }
.bt-Modal__close .bt-Button { border-radius: var(--bt-radius-full); }

/* titleHidden (without a description): no header row, the close button floats over the content. */
.bt-Modal--titleHidden .bt-Modal__header {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  padding: var(--bt-space-300);
}

.bt-Modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bt-Modal__body--noScroll { overflow: visible; }

.bt-Modal__section { padding: var(--bt-space-300) var(--bt-space-600) var(--bt-space-500); }
.bt-Modal__section + .bt-Modal__section { padding-top: var(--bt-space-500); border-top: var(--bt-border-width-1) solid var(--bt-border-secondary); }
.bt-Modal__section--flush { padding: 0; }
.bt-Modal__section--subdued { background: var(--bt-bg-surface-secondary); }
.bt-Modal__section--titleHidden { padding-top: var(--bt-space-600); padding-right: calc(var(--bt-size-control-md) + var(--bt-space-600)); }

.bt-Modal__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--bt-space-2400);
  padding: var(--bt-space-800);
}

.bt-Modal__footer {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--bt-space-300);
  padding: var(--bt-space-300) var(--bt-space-500) var(--bt-space-500) var(--bt-space-600);
}
.bt-Modal__footerContent { flex: 1 1 auto; min-width: 0; color: var(--bt-text); }
.bt-Modal__footer > .bt-ButtonGroup { margin-left: auto; }

/* Below breakpoint-md (768px; media queries can't read tokens): a bottom sheet; fullScreen fills the screen. */
@media (max-width: 767.98px) {
  .bt-Modal__container { align-items: flex-end; padding: 0; }
  .bt-Modal {
    width: 100%;
    max-height: 92dvh;
    border-radius: var(--bt-radius-600) var(--bt-radius-600) 0 0;
    animation-name: bt-Modal-sheet-in;
  }
  .bt-Modal-root--closing .bt-Modal { animation-name: bt-Modal-sheet-out; }
  .bt-Modal--limitHeight { max-height: 92dvh; }
  .bt-Modal__grip {
    display: block;
    flex: none;
    width: var(--bt-space-1000);
    height: var(--bt-space-100);
    margin: var(--bt-space-200) auto calc(-1 * var(--bt-space-200));
    border-radius: var(--bt-radius-full);
    background: var(--bt-border);
  }
  .bt-Modal__header { padding-top: var(--bt-space-300); }
  .bt-Modal__body { padding-bottom: env(safe-area-inset-bottom); }
  .bt-Modal__footer { padding-bottom: max(var(--bt-space-500), env(safe-area-inset-bottom)); }
  .bt-Modal__footer > .bt-ButtonGroup { flex: 1 1 100%; margin-left: 0; }
  .bt-Modal__footer > .bt-ButtonGroup > * { flex: 1 1 0; }
  .bt-Modal__footer .bt-Button { width: 100%; min-height: var(--bt-size-control-lg); }

  .bt-Modal--sizeFullScreen { height: 100%; max-height: none; border-radius: 0; animation-name: bt-Modal-in; }
  .bt-Modal--sizeFullScreen .bt-Modal__grip { display: none; }
  .bt-Modal-root:has(.bt-Modal--sizeFullScreen) .bt-Modal__container { align-items: stretch; }
  .bt-Modal-root--closing .bt-Modal--sizeFullScreen { animation-name: bt-Modal-out; }
}

@keyframes bt-Modal-in {
  from { opacity: 0; transform: translateY(-18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-Modal-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-10px) scale(0.97); }
}
@keyframes bt-Modal-sheet-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}
@keyframes bt-Modal-sheet-out {
  from { transform: none; }
  to { transform: translateY(100%); }
}
@keyframes bt-Modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bt-Modal-fade-out { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .bt-Modal,
  .bt-Modal__backdrop { animation: none; }
}

@media (forced-colors: active) {
  .bt-Modal { border: 1px solid CanvasText; }
}

/* --- MoneyField --- */
/* MoneyField: TextField's box (bt-TextField classes) with the currency symbol as its prefix, tabular digits. With
   `currencies`, a Select joins the field's end at its own width (TextField's connected item, space-200 apart). */
.bt-MoneyField__Currency { min-inline-size: var(--bt-space-2400); }

/* --- Navigation --- */
/* Navigation: the items on Frame's dark rail (bg-rail, text-on-rail). Two layouts, from Frame:
   - collapsed (bt-Navigation--collapsed, the size-rail icon rail): icon-only items, the label visually hidden (it stays
     the link's name), a count on the icon's corner; on hover or keyboard focus a flyout beside the rail shows the
     label and the section's sub-items.
   - expanded (wide mode, the drawer, or a Navigation outside a Frame): icon, label and count in a row; the active
     section's sub-items under it.
   The active section is a garnet rounded square (fill-brand, text-on-brand): the item itself when it is the page
   (aria-current), or the parent of the current sub-item. Hover and press are bg-rail-hover and bg-rail-active;
   secondary text text-on-rail-secondary.
   Outside a Frame the rail colours come from the nearest bg-rail container, so give it one. */
.bt-Navigation {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  gap: var(--bt-space-300);
  color: var(--bt-text-on-rail);
  font-family: var(--bt-font-sans);
}

.bt-Navigation__section {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-100);
}
/* Takes the free height, so the next section sits at the bottom of the rail. */
.bt-Navigation__section--fill { flex: 1 0 auto; }
.bt-Navigation__section--separator {
  border-block-start: 1px solid var(--bt-bg-rail-active);
  padding-block-start: var(--bt-space-300);
}

.bt-Navigation__sectionTitle {
  margin: 0;
  padding: var(--bt-space-100) var(--bt-space-300);
  color: var(--bt-text-on-rail-secondary);
  font-size: var(--bt-font-size-300);
  font-weight: var(--bt-font-weight-semibold);
  letter-spacing: 0.02em;
}

.bt-Navigation__list,
.bt-Navigation__subList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bt-Navigation__subList { padding-block: var(--bt-space-100); }

.bt-Navigation__listItem { position: relative; }

.bt-Navigation__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  inline-size: 100%;
  min-block-size: 44px;
  padding: 0 var(--bt-space-300);
  border: 0;
  border-radius: var(--bt-radius-400);
  background: transparent;
  color: var(--bt-text-on-rail);
  font: inherit;
  font-size: var(--bt-font-size-350);
  font-weight: var(--bt-font-weight-semibold);
  line-height: 1.2;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-standard);
}
.bt-Navigation__item:hover { background: var(--bt-bg-rail-hover); }
.bt-Navigation__item:active { background: var(--bt-bg-rail-active); }
.bt-Navigation__item:focus-visible {
  outline: 2px solid var(--bt-text-on-rail);
  outline-offset: 2px;
}

.bt-Navigation__icon {
  display: inline-flex;
  flex: none;
  color: var(--bt-text-on-rail-secondary);
}
.bt-Navigation__icon .bt-Icon { inline-size: 21px; block-size: 21px; }
.bt-Navigation__item:hover .bt-Navigation__icon,
.bt-Navigation__item:focus-visible .bt-Navigation__icon { color: var(--bt-text-on-rail); }

.bt-Navigation__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-Navigation__badge { display: inline-flex; flex: none; }

/* Sub-items: lighter rows lined up under the parent's label (icon 21px + gap). */
.bt-Navigation__item--sub {
  min-block-size: var(--bt-size-tree-row);
  padding-inline-start: calc(var(--bt-space-300) + 21px + var(--bt-space-300));
  border-radius: var(--bt-radius-350);
  color: var(--bt-text-on-rail-secondary);
  font-weight: var(--bt-font-weight-medium);
}
.bt-Navigation__item--sub:hover { color: var(--bt-text-on-rail); }

/* Desktop (the rail layout, from 768px like Frame's) with a fine pointer: tighter rows so a long menu fits.
   Touch and narrow screens keep 44px (36px for sub-items). */
@media (min-width: 768px) and (pointer: fine) {
  .bt-Navigation__item { min-block-size: var(--bt-size-nav-row-compact); }
  .bt-Navigation__item--sub { min-block-size: var(--bt-size-nav-sub-row-compact); }
}

/* The active section: garnet. The current sub-item: full-strength text, weight 600 and a hover tint. */
.bt-Navigation__item--selected:not(.bt-Navigation__item--sub),
.bt-Navigation__item--childActive,
.bt-Navigation__item--selected:not(.bt-Navigation__item--sub):hover,
.bt-Navigation__item--childActive:hover {
  background: var(--bt-fill-brand);
  color: var(--bt-text-on-brand);
}
.bt-Navigation__item--selected .bt-Navigation__icon,
.bt-Navigation__item--childActive .bt-Navigation__icon { color: var(--bt-text-on-brand); }
.bt-Navigation__item--selected .bt-CountBadge,
.bt-Navigation__item--childActive .bt-CountBadge {
  --bt-count-ring: var(--bt-fill-brand);
  background: var(--bt-text-on-brand);
  color: var(--bt-fill-brand);
}
.bt-Navigation__item--sub.bt-Navigation__item--selected {
  background: var(--bt-bg-rail-hover);
  color: var(--bt-text-on-rail);
  font-weight: var(--bt-font-weight-semibold);
}

.bt-Navigation__item--disabled,
.bt-Navigation__item--disabled:hover {
  background: transparent;
  color: var(--bt-text-on-rail-disabled);
  cursor: default;
}
.bt-Navigation__item--disabled .bt-Navigation__icon { color: inherit; }

/* ---- collapsed: the icon rail ---- */
/* Each item's pill (selected, hover, focus) is the brand tile's width (size-rail-brand), on the tile's axis. */
.bt-Navigation--collapsed .bt-Navigation__item:not(.bt-Navigation__item--sub) {
  justify-content: center;
  inline-size: var(--bt-size-rail-brand);
  margin-inline: auto;
  padding: 0;
}
.bt-Navigation--collapsed .bt-Navigation__item:not(.bt-Navigation__item--sub) > .bt-Navigation__label {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* The rail's count sits on the icon's corner, ringed in the rail colour (or garnet on the active item). */
.bt-Navigation--collapsed .bt-Navigation__item:not(.bt-Navigation__item--sub) > .bt-CountBadge {
  --bt-count-ring: var(--bt-bg-rail);
  position: absolute;
  inset-block-start: 4px;
  inset-inline-end: 5px;
}
.bt-Navigation--collapsed .bt-Navigation__item--selected > .bt-CountBadge,
.bt-Navigation--collapsed .bt-Navigation__item--childActive > .bt-CountBadge { --bt-count-ring: var(--bt-fill-brand); }
.bt-Navigation--collapsed .bt-Navigation__item:not(.bt-Navigation__item--sub) > .bt-Navigation__badge {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-end: 2px;
}
.bt-Navigation--collapsed .bt-Navigation__sectionTitle {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.bt-Navigation--collapsed .bt-Navigation__section--separator { margin-inline: var(--bt-space-200); }

/* The flyout: fixed beside the rail (Navigation.tsx sets top / left), shown while the pointer is over the item or
   keyboard focus is in it, until Escape. A short delay on leaving lets the pointer cross the gap. */
.bt-Navigation__flyout {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: var(--bt-z-tooltip);
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  max-inline-size: 16rem;
  padding: var(--bt-space-150) var(--bt-space-300);
  border-radius: var(--bt-radius-350);
  background: var(--bt-bg-rail);
  color: var(--bt-text-on-rail);
  box-shadow: inset 0 0 0 1px var(--bt-bg-rail-hover), var(--bt-shadow-soft-lg);
  color-scheme: dark;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity var(--bt-duration-fast) var(--bt-ease-exit),
    transform var(--bt-duration-fast) var(--bt-ease-exit),
    visibility 0s linear calc(var(--bt-duration-fast) + 80ms);
  transition-delay: 80ms;
}
.bt-Navigation__flyout:dir(rtl) { transform: translateX(6px); }
.bt-Navigation__flyout--menu {
  inline-size: 14.25rem;
  padding: var(--bt-space-200);
  border-radius: var(--bt-radius-450);
}
/* Covers the gap to the rail, so the pointer can reach the menu. */
.bt-Navigation__flyout::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-end: 100%;
  inline-size: 14px;
}
.bt-Navigation__flyoutHead {
  font-size: var(--bt-font-size-350);
  font-weight: var(--bt-font-weight-semibold);
  white-space: nowrap;
}
.bt-Navigation__flyout--menu > .bt-Navigation__flyoutHead {
  padding: var(--bt-space-200) 10px;
  font-size: var(--bt-font-size-375);
  font-weight: var(--bt-font-weight-bold);
}
.bt-Navigation__flyout .bt-Navigation__subList { padding-block: 0; }
.bt-Navigation__flyout .bt-Navigation__item--sub {
  min-block-size: var(--bt-size-menu-row);
  padding-inline: 10px;
  border-radius: var(--bt-radius-275);
}

.bt-Navigation--collapsed .bt-Navigation__listItem:hover > .bt-Navigation__flyout,
.bt-Navigation--collapsed .bt-Navigation__listItem:has(:focus-visible) > .bt-Navigation__flyout {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition:
    opacity var(--bt-duration-fast) var(--bt-ease-emphasized),
    transform var(--bt-duration-base) var(--bt-ease-emphasized),
    visibility 0s;
}
.bt-Navigation--collapsed .bt-Navigation__listItem[data-flyout-dismissed] > .bt-Navigation__flyout {
  visibility: hidden;
  opacity: 0;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .bt-Navigation__item,
  .bt-Navigation__flyout,
  .bt-Navigation--collapsed .bt-Navigation__listItem:hover > .bt-Navigation__flyout,
  .bt-Navigation--collapsed .bt-Navigation__listItem:has(:focus-visible) > .bt-Navigation__flyout {
    transition: none;
    transform: none;
  }
}

/* --- NumberField --- */
/* NumberField: TextField's box (bt-TextField classes) with the − / + buttons inside its trailing end, two 28px square (size-control-sm less space-100)
   tertiary buttons (radius-250) in secondary text, text on hover, bg-surface-hover behind; disabled at min / max in
   text-disabled. Out of the tab order as a native spinner is: ↑ / ↓ / PageUp / PageDown on the input do the same. */
.bt-NumberField { padding-inline-end: var(--bt-space-100); }
.bt-NumberField__Steps { display: inline-flex; flex: none; gap: var(--bt-space-050); }
.bt-NumberField__Step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--bt-size-control-sm) - var(--bt-space-100));
  height: calc(var(--bt-size-control-sm) - var(--bt-space-100));
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--bt-radius-250);
  background: transparent;
  color: var(--bt-text-secondary);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}
.bt-NumberField__Step:hover:not(:disabled) { background: var(--bt-bg-surface-hover); color: var(--bt-text); }
.bt-NumberField__Step:active:not(:disabled) { background: var(--bt-bg-surface-active); }
.bt-NumberField__Step:disabled { color: var(--bt-text-disabled); cursor: default; }
.bt-TextField--large.bt-NumberField .bt-NumberField__Step { width: var(--bt-size-control-sm); height: var(--bt-size-control-sm); }
.bt-NumberField--narrow { flex: none; inline-size: calc(var(--bt-space-2400) + var(--bt-size-control-sm)); max-inline-size: 100%; }

/* --- Page --- */
/* Page: a centred column with a header (back action, eyebrow, a large h1, metadata, subtitle, actions), an optional
   pill tabs row, then the content. Maximum width size-page, size-page-narrow for narrowWidth, none for fullWidth.
   Padding: the shell's gutter inside a Frame (--bt-page-gutter, --bt-page-padding-top from Frame.css), space-600
   alone (space-400 on a phone). The h1 is the template's display size, clamp(font-size-700, 2.6vw, font-size-900),
   weight 700, tight tracking; the actions sit on the title's last line (align-items: flex-end). The header wraps by
   its own width (flex-wrap), so the actions move under the title in a narrow page. Page.tsx measures the
   secondary buttons (in the unseen __Measurer row) and rolls those that don't fit next to the title into
   "Diğer işlemler"; below size-page-rollup of page width it rolls them all up, a lone one too. */
.bt-Page {
  --bt-page-pad: var(--bt-page-gutter, var(--bt-space-400));
  box-sizing: border-box;
  inline-size: 100%;
  /* The maximum is the content's: the padding comes on top. */
  max-inline-size: calc(var(--bt-size-page) + 2 * var(--bt-page-pad));
  margin-inline: auto;
  padding: var(--bt-page-padding-top, var(--bt-page-pad)) var(--bt-page-pad) var(--bt-space-1200);
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
  min-width: 0;
}
.bt-Page--narrowWidth { max-inline-size: calc(var(--bt-size-page-narrow) + 2 * var(--bt-page-pad)); }
.bt-Page--fullWidth { max-inline-size: none; }
@media (min-width: 768px) {
  .bt-Page { --bt-page-pad: var(--bt-page-gutter, var(--bt-space-600)); }
}
/* A header Page whose content continues in the next block (an app's frame) keeps no padding under it. */
.bt-Page.bt-Page--flushBottom { padding-block-end: 0; }

.bt-Page__Header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: var(--bt-space-400);
  row-gap: var(--bt-space-400);
  margin-block-end: var(--bt-space-500);
  position: relative;
}
/* A header holding only the visually hidden title takes no room; nor does the margin under the header of a
   flushBottom Page without content. */
.bt-Page__Header.bt-Page__Header--hidden,
.bt-Page--flushBottom > .bt-Page__Header:last-child { margin-block-end: 0; }
.bt-Page__Header--hidden > .bt-Page__TitleArea { padding-block: 0; }

.bt-Page__Back { flex: none; align-self: flex-start; padding-block-start: var(--bt-space-200); }

/* The title area takes the rest of the row, down to size-page-title-min before the actions wrap below. */
.bt-Page__TitleArea {
  flex: 1 1 var(--bt-size-page-title-min);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
}
.bt-Page__TitleArea--compact { gap: 0; }

.bt-Page__Eyebrow {
  margin: 0 0 calc(-1 * var(--bt-space-050));
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-325);
  font-weight: var(--bt-font-weight-semibold);
}

.bt-Page__TitleRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-200);
  min-width: 0;
}
.bt-Page__Title {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--bt-font-display);
  font-size: clamp(var(--bt-font-size-700), 2.6vw, var(--bt-font-size-900));
  font-weight: var(--bt-font-weight-bold);
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--bt-text);
}
/* An overview headline: two lines at most a readable width, chips set in the text. */
.bt-Page__Title:has(.bt-Page__TitleChip) { max-inline-size: 22em; line-height: 1.2; }
.bt-Page__TitleChip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 1.6em;
  block-size: 1.08em;
  margin: 0 0.04em;
  padding: 0 0.32em;
  vertical-align: -0.16em;
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface);
  box-shadow: inset 0 0 0 1px var(--bt-border-secondary), var(--bt-shadow-soft);
  color: var(--bt-text);
}
.bt-Page__TitleChip .bt-Icon { inline-size: 0.52em; block-size: 0.52em; }
.bt-Page__TitleChip--brand { background: var(--bt-fill-brand); color: var(--bt-text-on-brand); box-shadow: none; }
/* An AvatarStack in the chip rings its avatars in the chip's colour. */
.bt-Page__TitleChip--brand { --bt-avatar-ring: var(--bt-fill-brand); }
.bt-Page__TitleChip--stack { padding-inline: 6px; }
.bt-Page__TitleIcon { display: flex; flex: none; align-items: center; }
.bt-Page__TitleMetadata { display: flex; align-items: center; gap: var(--bt-space-200); }

.bt-Page__Subtitle { color: var(--bt-text-secondary); font-size: var(--bt-font-size-375); line-height: 1.45; }
.bt-Page__Subtitle > p { margin: 0; }
.bt-Page__Subtitle--maxWidth { max-inline-size: var(--bt-size-text-measure); }

.bt-Page__Actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--bt-space-200);
  margin-inline-start: auto;
  min-width: 0;
}
.bt-Page__ActionsNode,
.bt-Page__Secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--bt-space-200);
  min-width: 0;
}
.bt-Page__Primary,
.bt-Page__Pagination { display: flex; }

/* A badge after an action group's title, inside the button label. */
.bt-Page__GroupLabel { display: inline-flex; align-items: center; gap: var(--bt-space-150); }

/* Unseen copies of the secondary buttons, measured for the rollup: no size of its own (so it never widens
   or scrolls the page), its buttons at their natural width, hidden from pointer, focus and screen readers. */
.bt-Page__Measurer {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  display: flex;
  gap: var(--bt-space-200);
  inline-size: 0;
  block-size: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
}
.bt-Page__Measurer > * { flex: none; }

.bt-Page__GroupDetails {
  padding: var(--bt-space-300);
  border-block-start: 1px solid var(--bt-border);
}

.bt-Page__Tabs {
  min-width: 0;
  margin-block: calc(-1 * var(--bt-space-100)) var(--bt-space-500);
}
.bt-Page--flushBottom > .bt-Page__Tabs:last-child { margin-block-end: 0; }

.bt-Page__Content { min-width: 0; }

/* --- Pagination --- */
/* page: two round secondary buttons (Button's icon-only circle: card colour, hairline, soft shadow) with the
   label between them. table: a footer bar under a table, hairline on top, label start, slim circles end.
   Label: text (page) or text-secondary (table) on the card colour; both are checked pairs. */
.bt-Pagination { display: flex; align-items: center; }
.bt-Pagination__button { display: inline-flex; }
.bt-Pagination__buttons { display: inline-flex; align-items: center; gap: var(--bt-space-150); }
.bt-Pagination__label {
  display: inline-flex;
  padding-inline: var(--bt-space-200);
  white-space: nowrap;
}

.bt-Pagination--table {
  justify-content: space-between;
  gap: var(--bt-space-300);
  min-height: var(--bt-size-control-lg);
  padding-block: var(--bt-space-100);
  padding-inline: var(--bt-space-400) var(--bt-space-300);
  background: transparent;
  border-top: var(--bt-border-width-1) solid var(--bt-border-secondary);
}
.bt-Pagination--table .bt-Pagination__label { padding-inline: 0; }
.bt-Pagination--table .bt-Pagination__buttons { margin-inline-start: auto; }

/* --- PasswordField --- */
/* PasswordField: TextField's box (bt-TextField classes) with the show/hide toggle in its trailing end, a 28px square
   tertiary button (radius-250) in secondary text like NumberField's steppers. The strength meter sits under the box:
   three bars (bg-surface-secondary track) that fill critical, caution then success, and the level's word beside them. */
.bt-PasswordField { padding-inline-end: var(--bt-space-100); }
.bt-PasswordField__Toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: calc(var(--bt-size-control-sm) - var(--bt-space-100));
  height: calc(var(--bt-size-control-sm) - var(--bt-space-100));
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--bt-radius-250);
  background: transparent;
  color: var(--bt-text-secondary);
  cursor: pointer;
}
.bt-PasswordField__Toggle:hover:not(:disabled) { background: var(--bt-bg-surface-hover); color: var(--bt-text); }
.bt-PasswordField__Toggle:active:not(:disabled) { background: var(--bt-bg-surface-active); }
.bt-PasswordField__Toggle:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-PasswordField__Toggle:disabled { color: var(--bt-text-disabled); cursor: default; }
.bt-PasswordField__Toggle[aria-pressed="true"] { color: var(--bt-text); }
.bt-TextField--large.bt-PasswordField .bt-PasswordField__Toggle { width: var(--bt-size-control-sm); height: var(--bt-size-control-sm); }

.bt-PasswordField__Strength {
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  margin-block-start: var(--bt-space-200);
  min-height: var(--bt-space-500);
}
.bt-PasswordField__Bars { display: grid; flex: 1 1 auto; grid-template-columns: repeat(3, 1fr); gap: var(--bt-space-100); }
.bt-PasswordField__Bar { height: var(--bt-space-100); border-radius: var(--bt-radius-full); background: var(--bt-bg-surface-secondary); }
.bt-PasswordField__StrengthText {
  flex: none;
  min-width: var(--bt-space-1200);
  font-size: var(--bt-font-size-325);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
  color: var(--bt-text-secondary);
  text-align: end;
}
.bt-PasswordField__Strength--level1 .bt-PasswordField__Bar:nth-child(-n+1) { background: var(--bt-fill-critical); }
.bt-PasswordField__Strength--level2 .bt-PasswordField__Bar:nth-child(-n+2) { background: var(--bt-fill-caution); }
.bt-PasswordField__Strength--level3 .bt-PasswordField__Bar { background: var(--bt-fill-success); }
.bt-PasswordField__Strength--level1 .bt-PasswordField__StrengthText { color: var(--bt-text-critical); }
.bt-PasswordField__Strength--level3 .bt-PasswordField__StrengthText { color: var(--bt-text-success); }

@media (forced-colors: active) {
  .bt-PasswordField__Bar { border: 1px solid CanvasText; }
  .bt-PasswordField__Strength--level1 .bt-PasswordField__Bar:nth-child(-n+1),
  .bt-PasswordField__Strength--level2 .bt-PasswordField__Bar:nth-child(-n+2),
  .bt-PasswordField__Strength--level3 .bt-PasswordField__Bar { background: CanvasText; }
}

/* --- PaymentIcon --- */
/* PaymentIcon: a 36×24 card in the surface colour with a hairline border; the mark in the text colour. */
.bt-PaymentIcon { display: inline-block; flex: none; vertical-align: middle; height: auto; }
.bt-PaymentIcon--sizeSmall { width: var(--bt-space-600); }
.bt-PaymentIcon--sizeMedium { width: calc(var(--bt-space-800) + var(--bt-space-100)); }
.bt-PaymentIcon--sizeLarge { width: calc(var(--bt-space-1200) + var(--bt-space-150)); }
.bt-PaymentIcon__Card { fill: var(--bt-bg-surface); stroke: var(--bt-border); stroke-width: 1; }
.bt-PaymentIcon__Mark { fill: var(--bt-text); font-family: var(--bt-font-sans); font-weight: var(--bt-font-weight-extrabold); }
.bt-PaymentIcon__Mark--onFill { fill: var(--bt-bg-surface); }
.bt-PaymentIcon__Fill { fill: var(--bt-text); }
.bt-PaymentIcon__Fill--soft { fill: var(--bt-text-secondary); fill-opacity: 0.7; }
.bt-PaymentIcon__Ring { fill: none; stroke: var(--bt-text); stroke-width: 1.6; }
.bt-PaymentIcon__Line { fill: none; stroke: var(--bt-text); stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }

/* --- PhoneField --- */
/* PhoneField: one box drawn like TextField and Select (fill-secondary, border-strong line, border-focus line and
   bg-brand-subtle halo on focus or while the list is open), the country button (flag, calling code, chevron) at the
   start, a border-secondary hairline, then the number. The country list is Select's (popup.ts): searchable, a bottom
   sheet below 768px. */
.bt-PhoneField {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: var(--bt-size-control-md);
  background: var(--bt-fill-secondary);
  border: var(--bt-border-width-1) solid var(--bt-border-strong);
  border-radius: var(--bt-radius-350);
  color: var(--bt-text);
  transition: border-color var(--bt-duration-fast) var(--bt-ease-emphasized), box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-PhoneField:hover { border-color: var(--bt-border-hover); }
.bt-PhoneField:focus-within,
.bt-PhoneField--open {
  border-color: var(--bt-border-focus);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-focus), 0 0 0 var(--bt-space-100) var(--bt-bg-brand-subtle);
}
.bt-PhoneField--error,
.bt-PhoneField--error:hover { border-color: var(--bt-border-critical); }
.bt-PhoneField--error:focus-within,
.bt-PhoneField--error.bt-PhoneField--open {
  border-color: var(--bt-border-critical);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-critical), 0 0 0 var(--bt-space-100) var(--bt-bg-critical-subtle);
}
.bt-PhoneField--disabled,
.bt-PhoneField--disabled:hover { background: var(--bt-fill-disabled); border-color: var(--bt-border-secondary); color: var(--bt-text-disabled); }
.bt-PhoneField--readOnly { background: var(--bt-bg-surface-secondary); }

.bt-PhoneField__Country {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--bt-space-100);
  margin: 0;
  padding: 0 var(--bt-space-200) 0 var(--bt-space-300);
  border: 0;
  border-inline-end: var(--bt-border-width-1) solid var(--bt-border-secondary);
  border-start-start-radius: inherit;
  border-end-start-radius: inherit;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
  cursor: pointer;
}
.bt-PhoneField__Country:focus { outline: none; }
.bt-PhoneField__Country:focus-visible { background: var(--bt-bg-surface-hover); }
.bt-PhoneField__Country:disabled { cursor: default; }
.bt-PhoneField__Flag { display: inline-flex; line-height: 1; }
.bt-PhoneField__Dial { font-variant-numeric: tabular-nums; }
.bt-PhoneField__Chevron { display: inline-flex; color: var(--bt-text-secondary); }

.bt-PhoneField__Input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: var(--bt-space-200) var(--bt-space-300);
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  font-variant-numeric: tabular-nums;
}
.bt-PhoneField__Input:focus { outline: none; }
.bt-PhoneField__Input::placeholder { color: var(--bt-text-secondary); }
.bt-PhoneField__Input:disabled { color: var(--bt-text-disabled); }

.bt-PhoneField--large { min-height: var(--bt-size-control-lg); }
.bt-PhoneField--large .bt-PhoneField__Country,
.bt-PhoneField--large .bt-PhoneField__Input { font-size: var(--bt-font-size-400); line-height: var(--bt-font-line-height-600); }
.bt-PhoneField--large .bt-PhoneField__Input { padding-inline-start: var(--bt-space-400); }

/* --- Popover --- */
/* Popover: the card colour (bg-surface) with a border hairline, radius-350 and shadow-soft-lg, in a fixed-position portal on
   <body> (inside a Modal: in its dialog, which has no transform once it has entered), so scroll boxes
   never clip it. Placed by JS (top/left, max-height from the room on its side).
   Motion: a fade with a small move and scale, duration-fast and ease-emphasized; reduced motion keeps only the fade. */
.bt-Popover__Activator { min-width: 0; }

.bt-Popover {
  position: fixed;
  top: 0;
  left: 0;
  /* Above the modal layer (a popover inside a Modal), below toasts and tooltips. */
  z-index: calc(var(--bt-z-modal) + var(--bt-z-raised));
  /* 400px: overlay widths have no token family; never wider than the viewport minus its margins. */
  max-width: min(400px, calc(100vw - var(--bt-space-400)));
  animation: bt-Popover-in var(--bt-duration-fast) var(--bt-ease-emphasized) both;
}
.bt-Popover { transform-origin: top center; }
.bt-Popover[data-placement="above"] { animation-name: bt-Popover-in-above; transform-origin: bottom center; }
.bt-Popover--fullWidth { max-width: calc(100vw - var(--bt-space-400)); }
.bt-Popover--fluidContent { max-width: calc(100vw - var(--bt-space-400)); }

.bt-Popover__Content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: 500px; /* JS replaces it with the room on the chosen side (500px at most, as above). */
  overflow: hidden;
  border: var(--bt-border-width-1) solid var(--bt-border);
  border-radius: var(--bt-radius-350);
  background: var(--bt-bg-surface);
  color: var(--bt-text);
  box-shadow: var(--bt-shadow-soft-lg);
}
/* The container takes focus as a starting point (autofocusTarget="container"); it is not a control, so it
   draws no ring. The controls inside keep theirs. */
.bt-Popover__Content:focus { outline: none; }
.bt-Popover--fullWidth .bt-Popover__Content { width: 100%; }
.bt-Popover--fluidContent .bt-Popover__Content { max-height: none; }
.bt-Popover__Content--captureOverscroll,
.bt-Popover__Content--captureOverscroll .bt-Popover__Pane { overscroll-behavior: contain; }

.bt-Popover__Pane {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
.bt-Popover__Pane--fixed { flex: none; overflow: visible; }
.bt-Popover__Pane--subdued { background: var(--bt-bg-surface-secondary); }
.bt-Popover__Pane--captureOverscroll { overscroll-behavior: contain; }
.bt-Popover__Pane + .bt-Popover__Pane { border-top: var(--bt-border-width-1) solid var(--bt-border-secondary); }

.bt-Popover__Section { padding: var(--bt-space-300); }
.bt-Popover__Section + .bt-Popover__Section { border-top: var(--bt-border-width-1) solid var(--bt-border-secondary); }

@keyframes bt-Popover-in {
  from { opacity: 0; transform: translateY(calc(-1 * var(--bt-space-100))) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-Popover-in-above {
  from { opacity: 0; transform: translateY(var(--bt-space-100)) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-Popover-fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .bt-Popover,
  .bt-Popover[data-placement="above"] { animation-name: bt-Popover-fade-in; }
}

@media print {
  .bt-Popover--hideOnPrint { display: none; }
}

@media (forced-colors: active) {
  .bt-Popover__Content { border-color: CanvasText; }
}

/* --- ProgressBar --- */
/* ProgressBar: a track and a fill. Every fill keeps 3:1 against the track and the surfaces in both themes. */
.bt-ProgressBar {
  position: relative;
  width: 100%;
  height: var(--bt-space-200);
  overflow: hidden;
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface-active);
}
.bt-ProgressBar--sizeSmall { height: var(--bt-space-100); }
.bt-ProgressBar--sizeLarge { height: var(--bt-space-300); }

.bt-ProgressBar__indicator {
  height: 100%;
  border-radius: inherit;
  background: var(--bt-fill-brand);
}
.bt-ProgressBar--tonePrimary .bt-ProgressBar__indicator { background: var(--bt-bg-inverse); }
.bt-ProgressBar--toneSuccess .bt-ProgressBar__indicator { background: var(--bt-fill-success); }
.bt-ProgressBar--toneCritical .bt-ProgressBar__indicator { background: var(--bt-fill-critical); }

.bt-ProgressBar--animated .bt-ProgressBar__indicator {
  transition: width var(--bt-duration-slower) var(--bt-ease-standard);
  animation: bt-ProgressBar-in var(--bt-duration-fill) var(--bt-ease-in-out);
  transform-origin: left center;
}
[dir="rtl"] .bt-ProgressBar--animated .bt-ProgressBar__indicator { transform-origin: right center; }

@keyframes bt-ProgressBar-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .bt-ProgressBar--animated .bt-ProgressBar__indicator { transition: none; animation: none; }
}

@media (forced-colors: active) {
  .bt-ProgressBar { border: 1px solid CanvasText; }
  .bt-ProgressBar__indicator { background: Highlight; }
}

/* --- QRCode --- */
/* QRCode: shares Barcode.css (tile, colours, download buttons). */
.bt-QRCode { align-items: center; }

/* --- RadioButton --- */
/* A real radio, transparent, over a drawn 20px circle: fill-secondary with a border-strong line at rest (3:1);
   chosen: a filled fill-brand disc with a text-on-brand centre, as the checked Checkbox; focus: shadow-focus. */
.bt-RadioButton {
  position: relative;
  display: inline-flex;
  width: var(--bt-size-icon-md);
  height: var(--bt-size-icon-md);
}
.bt-RadioButton__Input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.bt-RadioButton__Input:disabled { cursor: default; }
.bt-RadioButton__Backdrop {
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
  background: var(--bt-fill-secondary);
  border: var(--bt-border-width-1) solid var(--bt-border-strong);
  border-radius: var(--bt-radius-full);
  transition: border-color var(--bt-duration-fast) var(--bt-ease-emphasized), background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-RadioButton__Backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: var(--bt-space-200);
  height: var(--bt-space-200);
  border-radius: var(--bt-radius-full);
  background: var(--bt-text-on-brand);
  transform: scale(0);
  transition: transform var(--bt-duration-base) var(--bt-ease-emphasized);
}
.bt-RadioButton__Input:hover + .bt-RadioButton__Backdrop { border-color: var(--bt-border-hover); }
.bt-RadioButton__Input:focus-visible + .bt-RadioButton__Backdrop { box-shadow: var(--bt-shadow-focus); }
.bt-RadioButton__Input:checked + .bt-RadioButton__Backdrop {
  background: var(--bt-fill-brand);
  border-color: var(--bt-fill-brand);
}
.bt-RadioButton__Input:checked:hover + .bt-RadioButton__Backdrop { background: var(--bt-fill-brand-hover); border-color: var(--bt-fill-brand-hover); }
.bt-RadioButton__Input:checked + .bt-RadioButton__Backdrop::after { transform: scale(1); }
.bt-RadioButton__Input:disabled + .bt-RadioButton__Backdrop,
.bt-RadioButton__Input:disabled:checked + .bt-RadioButton__Backdrop { background: var(--bt-fill-disabled); border-color: var(--bt-border); }
.bt-RadioButton__Input:disabled + .bt-RadioButton__Backdrop::after { background: var(--bt-text-disabled); }

@media (prefers-reduced-motion: reduce) {
  .bt-RadioButton__Backdrop,
  .bt-RadioButton__Backdrop::after { transition: none; }
}

@media (forced-colors: active) {
  .bt-RadioButton__Backdrop { border-color: CanvasText; }
  .bt-RadioButton__Input:checked + .bt-RadioButton__Backdrop { background: Highlight; border-color: Highlight; }
  .bt-RadioButton__Backdrop::after { background: HighlightText; }
  .bt-RadioButton__Input:focus-visible + .bt-RadioButton__Backdrop { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* --- RangeSlider --- */
/* RangeSlider: a native range input on tokens. Filled part fill-brand, the rest border-strong (3:1 on surfaces). */
.bt-RangeSlider {
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  min-height: var(--bt-size-control-md);
  min-width: 0;
  --bt-RangeSlider-track: var(--bt-border-strong);
  --bt-RangeSlider-active: var(--bt-fill-brand);
}
.bt-RangeSlider--error { --bt-RangeSlider-active: var(--bt-border-critical); }
.bt-RangeSlider--disabled {
  --bt-RangeSlider-track: var(--bt-fill-disabled);
  --bt-RangeSlider-active: var(--bt-border);
}
.bt-RangeSlider__Input {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--bt-space-600);
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: var(--bt-radius-200);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  --bt-RangeSlider-gradient: linear-gradient(
    to right,
    var(--bt-RangeSlider-active) var(--bt-RangeSlider-fill, 0%),
    var(--bt-RangeSlider-track) var(--bt-RangeSlider-fill, 0%)
  );
}
:dir(rtl) .bt-RangeSlider__Input {
  --bt-RangeSlider-gradient: linear-gradient(
    to left,
    var(--bt-RangeSlider-active) var(--bt-RangeSlider-fill, 0%),
    var(--bt-RangeSlider-track) var(--bt-RangeSlider-fill, 0%)
  );
}
.bt-RangeSlider__Input:disabled { cursor: default; }
.bt-RangeSlider__Input:focus-visible { outline: none; }
.bt-RangeSlider__Input::-webkit-slider-runnable-track {
  height: var(--bt-space-150);
  background: var(--bt-RangeSlider-gradient);
  border-radius: var(--bt-radius-full);
}
.bt-RangeSlider__Input::-moz-range-track {
  height: var(--bt-space-150);
  background: var(--bt-RangeSlider-gradient);
  border-radius: var(--bt-radius-full);
}
.bt-RangeSlider__Input::-webkit-slider-thumb {
  width: var(--bt-space-500);
  height: var(--bt-space-500);
  margin-top: calc((var(--bt-space-150) - var(--bt-space-500)) / 2);
  background: var(--bt-text-on-brand);
  border: var(--bt-border-width-2) solid var(--bt-RangeSlider-active);
  border-radius: 50%;
  box-shadow: var(--bt-shadow-100);
  transition: transform var(--bt-duration-fast) var(--bt-ease-emphasized);
  appearance: none;
  -webkit-appearance: none;
}
.bt-RangeSlider__Input::-moz-range-thumb {
  box-sizing: border-box;
  width: var(--bt-space-500);
  height: var(--bt-space-500);
  background: var(--bt-text-on-brand);
  border: var(--bt-border-width-2) solid var(--bt-RangeSlider-active);
  border-radius: 50%;
  box-shadow: var(--bt-shadow-100);
}
.bt-RangeSlider__Input:active::-webkit-slider-thumb { transform: scale(1.1); }
.bt-RangeSlider__Input:focus-visible::-webkit-slider-thumb { box-shadow: var(--bt-shadow-focus); }
.bt-RangeSlider__Input:focus-visible::-moz-range-thumb { box-shadow: var(--bt-shadow-focus); }
.bt-RangeSlider__Value {
  flex: none;
  min-width: var(--bt-space-1000);
  color: var(--bt-text);
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-semibold);
  font-variant-numeric: tabular-nums;
  text-align: end;
}
.bt-RangeSlider--disabled .bt-RangeSlider__Value { color: var(--bt-text-secondary); }

@media (prefers-reduced-motion: reduce) {
  .bt-RangeSlider__Input::-webkit-slider-thumb { transition: none; }
}

@media (forced-colors: active) {
  .bt-RangeSlider__Input { forced-color-adjust: auto; appearance: auto; -webkit-appearance: auto; }
}

/* --- RatingBreakdown --- */
/* RatingBreakdown: one row per star level on a subgrid, so the label, bar, count and percent columns line up.
   The bar is the template's pill meter: a bg-surface-hover track, the fill-rating share (3:1 or more on bg and the
   surfaces in both themes) fully rounded and grown in from the start (no motion when reduced). Text keeps 4.5:1: count in text, percent in
   text-secondary. */
.bt-RatingBreakdown {
  display: grid;
  /* label | bar | count | percent; the percent column fits "%100" (5ch, no size token for text widths). */
  grid-template-columns: max-content minmax(4rem, 1fr) max-content 5ch;
  row-gap: var(--bt-space-100);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--bt-text);
  --bt-RatingBreakdown-bar: var(--bt-space-200);
  --bt-RatingBreakdown-icon: var(--bt-size-icon-sm);
}
.bt-RatingBreakdown--sizeSm {
  row-gap: var(--bt-space-050);
  --bt-RatingBreakdown-bar: var(--bt-space-150);
}

.bt-RatingBreakdown__item,
.bt-RatingBreakdown__row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
}
.bt-RatingBreakdown__row {
  column-gap: var(--bt-space-300);
  font: inherit;
  color: inherit;
}
.bt-RatingBreakdown--sizeSm .bt-RatingBreakdown__row { column-gap: var(--bt-space-200); }

.bt-RatingBreakdown__button {
  margin: 0;
  padding: var(--bt-space-050) var(--bt-space-200);
  border: 0;
  border-radius: var(--bt-radius-full);
  background: transparent;
  text-align: start;
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-RatingBreakdown__button:hover { background: var(--bt-bg-surface-hover); }
.bt-RatingBreakdown__button:active { background: var(--bt-bg-surface-active); }
.bt-RatingBreakdown__button:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
/* Pressed: the selected surface inside a 2px border-brand frame (a shape cue, not only color; 5,9:1 or more on
   it in both themes). No weight change: bolder figures would widen the columns and shift every row. */
.bt-RatingBreakdown__button[aria-pressed="true"] {
  background: var(--bt-bg-surface-selected);
  box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-brand);
}
.bt-RatingBreakdown__button[aria-pressed="true"]:focus-visible {
  box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-brand), var(--bt-shadow-focus);
}

.bt-RatingBreakdown__stars {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-100);
  font-variant-numeric: tabular-nums;
}
.bt-RatingBreakdown__icon {
  display: block;
  flex: none;
  width: var(--bt-RatingBreakdown-icon);
  height: var(--bt-RatingBreakdown-icon);
  color: var(--bt-fill-rating);
}

.bt-RatingBreakdown__bar {
  display: flex;
  gap: 0;
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface-hover);
  height: var(--bt-RatingBreakdown-bar);
  min-width: 0;
  overflow: hidden;
}
.bt-RatingBreakdown__fill {
  flex: none;
  background: var(--bt-fill-rating);
  border-radius: var(--bt-radius-full);
  transform-origin: 0 50%;
  animation: bt-RatingBreakdown-grow var(--bt-duration-slow) var(--bt-ease-emphasized) both;
}
@keyframes bt-RatingBreakdown-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .bt-RatingBreakdown__fill { animation: none; } }
.bt-RatingBreakdown__track {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
}

.bt-RatingBreakdown__count,
.bt-RatingBreakdown__percent {
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.bt-RatingBreakdown__percent { color: var(--bt-text-secondary); }

.bt-RatingBreakdown__empty {
  margin: 0;
  color: var(--bt-text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .bt-RatingBreakdown__button { transition: none; }
}

@media (forced-colors: active) {
  .bt-RatingBreakdown__fill { background: CanvasText; }
  .bt-RatingBreakdown__bar { background: transparent; outline: 1px solid GrayText; outline-offset: -1px; }
  .bt-RatingBreakdown__icon { color: CanvasText; }
  .bt-RatingBreakdown__button[aria-pressed="true"] { outline: 2px solid Highlight; }
}

/* --- RatingInput --- */
/* RatingInput: RatingStars' look (fill-rating stars, border-strong outlines) on five native radios. */
.bt-RatingInput {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.bt-RatingInput__Legend { padding: 0; margin-bottom: var(--bt-space-100); }
.bt-RatingInput__Stars {
  display: inline-flex;
  vertical-align: top;
}
.bt-RatingInput__Star {
  position: relative;
  display: block;
  flex: none;
  padding: var(--bt-space-050);
  border-radius: var(--bt-radius-full);
  cursor: pointer;
}
/* The radio lies over its star, invisible: touch and screen-reader exploration find it there. */
.bt-RatingInput__Input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: inherit;
  opacity: 0;
}
.bt-RatingInput__Input:focus-visible + .bt-RatingInput__Glyph {
  border-radius: var(--bt-radius-full);
  box-shadow: var(--bt-shadow-focus);
}
.bt-RatingInput__Glyph {
  display: block;
  width: var(--bt-size-icon-lg);
  height: var(--bt-size-icon-lg);
  color: var(--bt-border-strong);
}
.bt-RatingInput__Glyph svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.bt-RatingInput__Glyph--filled { color: var(--bt-fill-rating); }
.bt-RatingInput--disabled .bt-RatingInput__Star { cursor: default; }
.bt-RatingInput--disabled .bt-RatingInput__Glyph { color: var(--bt-text-disabled); }
.bt-RatingInput--disabled .bt-RatingInput__Legend { color: var(--bt-text-disabled); }

@media (forced-colors: active) {
  .bt-RatingInput__Glyph { color: CanvasText; }
  .bt-RatingInput__Input:focus-visible + .bt-RatingInput__Glyph { outline: 2px solid Highlight; outline-offset: 1px; }
}

/* --- RatingStars --- */
/* RatingStars: filled stars in fill-rating (amber-600 light, amber-400 dark), empty ones as border-strong
   outlines; both keep 3:1 on bg, the surfaces and bg-code in both themes (build.py checks the pairs). */
.bt-RatingStars {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-150);
  vertical-align: middle;
  color: var(--bt-text);
  --bt-RatingStars-size: var(--bt-size-icon-md);
}
.bt-RatingStars--sizeSm {
  gap: var(--bt-space-100);
  --bt-RatingStars-size: var(--bt-size-icon-sm);
}

.bt-RatingStars__value { font-variant-numeric: tabular-nums; }

.bt-RatingStars__stars {
  display: inline-flex;
  gap: var(--bt-space-025);
}

.bt-RatingStars__star {
  position: relative;
  display: block;
  flex: none;
  width: var(--bt-RatingStars-size);
  height: var(--bt-RatingStars-size);
}
.bt-RatingStars__outline,
.bt-RatingStars__filled {
  display: block;
  width: var(--bt-RatingStars-size);
  height: var(--bt-RatingStars-size);
  overflow: visible;
}
.bt-RatingStars__outline { color: var(--bt-border-strong); }

.bt-RatingStars__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 100%;
  overflow: hidden;
  color: var(--bt-fill-rating);
}
/* The glyph is symmetric about x = 12, so half the box is exactly half the star. The stroke spills past the
   box edge (overflow visible on the svg), so clip-path, not the box, cuts the half. */
.bt-RatingStars__star--half .bt-RatingStars__fill {
  overflow: visible;
  clip-path: inset(-25% 50% -25% -25%);
}
.bt-RatingStars__star--full .bt-RatingStars__fill { overflow: visible; }

/* Right-to-left: a half star fills from the right. */
:dir(rtl) .bt-RatingStars__star--half .bt-RatingStars__fill {
  clip-path: inset(-25% -25% -25% 50%);
}

.bt-RatingStars__count {
  color: var(--bt-text-secondary);
  font-variant-numeric: tabular-nums;
}

@media (forced-colors: active) {
  .bt-RatingStars__outline,
  .bt-RatingStars__fill { color: CanvasText; }
}

/* --- ResourcePicker --- */
/* A modal with a search field on top and a list of rows under it: a box (checkbox, or radio for one), a
   thumbnail, title and subtitle, and meta at the end. Variants sit indented under their product with a smaller
   thumbnail. The search stays put while the list scrolls (Modal limitHeight). */
.bt-ResourcePicker { display: flex; flex-direction: column; min-block-size: 0; }
.bt-ResourcePicker__Search {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  padding: var(--bt-space-300) var(--bt-space-400);
  background: var(--bt-bg-surface);
  border-block-end: var(--bt-border-width-1) solid var(--bt-border-secondary);
}
.bt-ResourcePicker__Body { padding: var(--bt-space-150) var(--bt-space-200); }
.bt-ResourcePicker__List,
.bt-ResourcePicker__Children { margin: 0; padding: 0; list-style: none; }
.bt-ResourcePicker__Children { padding-inline-start: var(--bt-space-600); }
.bt-ResourcePicker__Item + .bt-ResourcePicker__Item:not(.bt-ResourcePicker__Item--nested) { border-block-start: var(--bt-border-width-1) solid var(--bt-border-secondary); }
.bt-ResourcePicker__Row {
  padding: var(--bt-space-150) var(--bt-space-200);
  border-radius: var(--bt-radius-200);
}
.bt-ResourcePicker__Row:hover { background: var(--bt-bg-surface-hover); }
.bt-ResourcePicker__Item--selected > .bt-ResourcePicker__Row { background: var(--bt-bg-surface-selected); }
.bt-ResourcePicker__Item--nested > .bt-ResourcePicker__Row { padding-block: var(--bt-space-100); }
.bt-ResourcePicker__Row .bt-Choice__Row { align-items: center; }
.bt-ResourcePicker__Row .bt-Choice__Label { flex: 1; }
.bt-ResourcePicker__Content,
.bt-ResourcePicker__Group { display: flex; align-items: center; gap: var(--bt-space-300); min-inline-size: 0; inline-size: 100%; }
.bt-ResourcePicker__Group { padding-inline-start: var(--bt-space-100); }
.bt-ResourcePicker__Text { display: flex; flex-direction: column; flex: 1; min-inline-size: 0; }
.bt-ResourcePicker__Title {
  font-weight: var(--bt-font-weight-medium);
  color: var(--bt-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-ResourcePicker__Subtitle,
.bt-ResourcePicker__Meta {
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  color: var(--bt-text-secondary);
}
.bt-ResourcePicker__Meta { flex: none; font-variant-numeric: tabular-nums; text-align: end; }
.bt-ResourcePicker__Empty {
  margin: 0;
  padding: var(--bt-space-800) var(--bt-space-400);
  color: var(--bt-text-secondary);
  text-align: center;
}
.bt-ResourcePicker__Loading,
.bt-ResourcePicker__More { display: flex; justify-content: center; padding: var(--bt-space-300); }
.bt-ResourcePicker__Count { color: var(--bt-text-secondary); font-variant-numeric: tabular-nums; }

/* --- RichTextEditor --- */
/* RichTextEditor: a toolbar on top of the writing surface, inside one field box drawn as TextField's multiline box
   (fill-secondary, border-strong line at 3:1, radius-400; border-hover on hover; border-focus line and halo on focus). */
.bt-RichTextEditor {
  min-width: 0;
  background: var(--bt-fill-secondary);
  border: var(--bt-border-width-1) solid var(--bt-border-strong);
  border-radius: var(--bt-radius-400);
  color: var(--bt-text);
  transition: border-color var(--bt-duration-fast) var(--bt-ease-emphasized), box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-RichTextEditor:hover { border-color: var(--bt-border-hover); }
.bt-RichTextEditor:focus-within {
  border-color: var(--bt-border-focus);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-focus), 0 0 0 var(--bt-space-100) var(--bt-bg-brand-subtle);
}
.bt-RichTextEditor--error,
.bt-RichTextEditor--error:hover { border-color: var(--bt-border-critical); }
.bt-RichTextEditor--error:focus-within {
  border-color: var(--bt-border-critical);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-critical), 0 0 0 var(--bt-space-100) var(--bt-bg-critical-subtle);
}
.bt-RichTextEditor--disabled,
.bt-RichTextEditor--disabled:hover {
  background: var(--bt-fill-disabled);
  border-color: var(--bt-border-secondary);
  color: var(--bt-text-disabled);
}

.bt-RichTextEditor__Toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-050);
  padding: var(--bt-space-150);
  border-block-end: var(--bt-border-width-1) solid var(--bt-border-secondary);
}
.bt-RichTextEditor__Spacer { flex: 1 1 auto; }
.bt-RichTextEditor__ToolWrap { display: inline-flex; }

.bt-RichTextEditor__Tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: var(--bt-size-control-sm);
  block-size: var(--bt-size-control-sm);
  padding: 0 var(--bt-space-100);
  border: 0;
  border-radius: var(--bt-radius-250);
  background: transparent;
  color: var(--bt-text-secondary);
  font: inherit;
  font-size: var(--bt-font-size-337);
  font-weight: var(--bt-font-weight-semibold);
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized), color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-RichTextEditor__Tool:hover:not(:disabled) { background: var(--bt-bg-surface-active); color: var(--bt-text); }
.bt-RichTextEditor__Tool:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
/* On: garnet marks the selection, as in the template's pickers. */
.bt-RichTextEditor__Tool[aria-pressed="true"],
.bt-RichTextEditor__Tool[aria-pressed="true"]:hover:not(:disabled) {
  background: var(--bt-bg-surface-selected);
  color: var(--bt-text-brand);
}
.bt-RichTextEditor__Tool[aria-pressed="true"]:focus-visible { box-shadow: var(--bt-shadow-focus); }
.bt-RichTextEditor__Tool:disabled { color: var(--bt-text-disabled); cursor: default; }
.bt-RichTextEditor__Tool--mono { font-family: var(--bt-font-mono); }
.bt-RichTextEditor__Glyph::before { content: attr(data-glyph); }
.bt-RichTextEditor__Glyph--bold { font-weight: 700; }
.bt-RichTextEditor__Glyph--italic { font-style: italic; }
.bt-RichTextEditor__Glyph--underline { text-decoration: underline; }
.bt-RichTextEditor__Glyph--strike { text-decoration: line-through; }
@media (prefers-reduced-motion: reduce) {
  .bt-RichTextEditor,
  .bt-RichTextEditor__Tool { transition: none; }
}
@media (pointer: coarse) {
  .bt-RichTextEditor__Tool { min-inline-size: var(--bt-size-control-md); block-size: var(--bt-size-control-md); }
}

.bt-RichTextEditor__Surface {
  min-block-size: 120px;
  max-block-size: 480px;
  overflow-y: auto;
  padding: var(--bt-space-300) var(--bt-space-400);
  overflow-wrap: anywhere;
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  outline: none;
  cursor: text;
}
.bt-RichTextEditor--disabled .bt-RichTextEditor__Surface { cursor: default; }
.bt-RichTextEditor__Surface > :first-child { margin-block-start: 0; }
.bt-RichTextEditor__Surface > :last-child { margin-block-end: 0; }
.bt-RichTextEditor__Surface p { margin: 0 0 var(--bt-space-200); }
.bt-RichTextEditor__Surface ul,
.bt-RichTextEditor__Surface ol { margin: 0 0 var(--bt-space-200); padding-inline-start: var(--bt-space-500); }
.bt-RichTextEditor__Surface blockquote {
  margin: 0 0 var(--bt-space-200);
  padding-inline-start: var(--bt-space-300);
  border-inline-start: var(--bt-border-width-2) solid var(--bt-border);
}
.bt-RichTextEditor__Surface h1,
.bt-RichTextEditor__Surface h2,
.bt-RichTextEditor__Surface h3,
.bt-RichTextEditor__Surface h4,
.bt-RichTextEditor__Surface h5,
.bt-RichTextEditor__Surface h6 { margin: var(--bt-space-300) 0 var(--bt-space-100); font-weight: 600; line-height: 1.3; }
.bt-RichTextEditor__Surface h1,
.bt-RichTextEditor__Surface h2 { font-size: 1.375em; }
.bt-RichTextEditor__Surface h3 { font-size: 1.2em; }
.bt-RichTextEditor__Surface h4,
.bt-RichTextEditor__Surface h5,
.bt-RichTextEditor__Surface h6 { font-size: 1.05em; }
.bt-RichTextEditor__Surface a { color: var(--bt-text-brand); text-decoration: underline; }
.bt-RichTextEditor__Surface img { max-inline-size: 100%; block-size: auto; }
.bt-RichTextEditor__Surface table { margin: 0 0 var(--bt-space-200); border-collapse: collapse; max-inline-size: 100%; }
.bt-RichTextEditor__Surface th,
.bt-RichTextEditor__Surface td { padding: var(--bt-space-100) var(--bt-space-200); border: var(--bt-border-width-1) solid var(--bt-border); vertical-align: top; text-align: start; }
.bt-RichTextEditor__Surface th { font-weight: 600; }
.bt-RichTextEditor__Surface td > :last-child,
.bt-RichTextEditor__Surface th > :last-child { margin-block-end: 0; }

.bt-RichTextEditor--inline .bt-RichTextEditor__Surface {
  min-block-size: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.bt-RichTextEditor__Source {
  display: block;
  inline-size: 100%;
  box-sizing: border-box;
  min-block-size: 120px;
  padding: var(--bt-space-300) var(--bt-space-400);
  border: 0;
  border-radius: 0 0 var(--bt-radius-400) var(--bt-radius-400);
  background: transparent;
  color: inherit;
  font-family: var(--bt-font-mono);
  font-size: var(--bt-font-size-325);
  line-height: 1.5;
  resize: vertical;
  outline: none;
}
.bt-RichTextEditor--inline .bt-RichTextEditor__Source { min-block-size: 0; }

.bt-RichTextEditor__Notice {
  margin: 0;
  padding: var(--bt-space-150) var(--bt-space-400);
  border-block-start: var(--bt-border-width-1) solid var(--bt-border-secondary);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-300);
  line-height: 1.4;
}

.bt-RichTextEditor__Link { display: flex; flex-direction: column; gap: var(--bt-space-200); inline-size: min(320px, 80vw); }
.bt-RichTextEditor__LinkActions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--bt-space-100); }

/* --- Ring --- */
/* Ring: the template's round gauge. A bg-surface-hover track ring, the arc in the tone color with round caps drawn
   from twelve o'clock (stroke-dashoffset, eased in), the percent centred; the caption (label, amount, status word)
   beside it. Tones as Meter: fill-brand, fill-success, border-caution, fill-critical. */
.bt-Ring {
  --bt-ring-color: var(--bt-fill-brand);
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-300);
  min-width: 0;
  font-family: var(--bt-font-sans);
}
.bt-Ring--success { --bt-ring-color: var(--bt-fill-success); }
.bt-Ring--warning { --bt-ring-color: var(--bt-border-caution); }
.bt-Ring--critical { --bt-ring-color: var(--bt-fill-critical); }

.bt-Ring__gauge { position: relative; flex: none; display: inline-grid; place-items: center; }
.bt-Ring__gauge svg { position: absolute; inset: 0; display: block; }
.bt-Ring__track { fill: none; stroke: var(--bt-bg-surface-hover); }
.bt-Ring__arc {
  fill: none;
  stroke: var(--bt-ring-color);
  stroke-linecap: round;
  stroke-dashoffset: var(--bt-ring-offset);
  animation: bt-Ring-in var(--bt-duration-slower) var(--bt-ease-emphasized) both;
}
@keyframes bt-Ring-in {
  from { stroke-dashoffset: var(--bt-ring-length); }
  to { stroke-dashoffset: var(--bt-ring-offset); }
}

.bt-Ring__in {
  position: relative;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.bt-Ring__caption { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bt-Ring__label { font-size: var(--bt-font-size-337); font-weight: 600; }
.bt-Ring__amount { font-size: var(--bt-font-size-312); font-weight: 600; color: var(--bt-text-secondary); font-variant-numeric: tabular-nums; }
.bt-Ring__status { font-size: var(--bt-font-size-300); font-weight: 600; color: var(--bt-text-warning); }
.bt-Ring--critical .bt-Ring__status { color: var(--bt-text-critical); }

@media (prefers-reduced-motion: reduce) {
  .bt-Ring__arc { animation: none; }
}

@media (forced-colors: active) {
  .bt-Ring__track { stroke: GrayText; }
  .bt-Ring__arc { stroke: CanvasText; }
}

/* --- SaveBar --- */
/* SaveBar: a floating dock pinned to the bottom of whatever scrolls (the page, or a contained Frame's content),
   above the content: the card colour, a hairline, radius-600 and shadow-soft-lg, inset space-300 from the edges,
   720px wide at most. A garnet dot marks the message. Closed it is an empty box: the live region stays in the page
   so that opening is announced. Motion: rises in with duration-slow, ease-emphasized; off under reduced motion. */
.bt-SaveBar { outline: none; }
.bt-SaveBar--open {
  position: sticky;
  inset-block-end: max(var(--bt-space-300), env(safe-area-inset-bottom));
  z-index: var(--bt-z-sticky);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--bt-space-200) var(--bt-space-400);
  /* 720px: no token covers widths. */
  width: min(calc(100% - 2 * var(--bt-space-300)), 720px);
  margin: 0 auto max(var(--bt-space-300), env(safe-area-inset-bottom));
  padding: var(--bt-space-200) var(--bt-space-200) var(--bt-space-200) var(--bt-space-500);
  background: var(--bt-bg-surface);
  border-radius: var(--bt-radius-600);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border), var(--bt-shadow-soft-lg);
  color: var(--bt-text);
  animation: bt-SaveBar-in var(--bt-duration-slow) var(--bt-ease-emphasized) both;
}
.bt-SaveBar__Message {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--bt-space-200);
  font: var(--bt-font-weight-semibold) var(--bt-font-size-337) / var(--bt-font-line-height-500) var(--bt-font-sans);
  overflow-wrap: anywhere;
}
.bt-SaveBar__Message::before {
  content: '';
  flex: none;
  width: var(--bt-space-200);
  height: var(--bt-space-200);
  border-radius: var(--bt-radius-full);
  background: var(--bt-fill-brand);
}
.bt-SaveBar__Actions {
  display: flex;
  flex: none;
  max-inline-size: 100%;
  flex-wrap: wrap;
  gap: var(--bt-space-200);
}
@keyframes bt-SaveBar-in {
  from { opacity: 0; transform: translateY(var(--bt-space-400)); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-SaveBar--open { animation: none; }
}
@media (forced-colors: active) {
  .bt-SaveBar--open { border: 1px solid CanvasText; }
  .bt-SaveBar__Message::before { background: CanvasText; }
}
@media print {
  .bt-SaveBar--open { display: none; }
}

/* --- SearchField --- */
/* SearchField: TextField with the search icon as its prefix, the clear button and the loading spinner; no styles of its own
   beyond filling its row. */
.bt-SearchField { min-width: 0; }

/* --- SegmentedControl --- */
/* SegmentedControl: a pill well (bg-surface-secondary with a border-secondary line) holding the segments; a
   thumb on the strong fill (fill-strong: ink in light, garnet in dark, like a selected chip or the primary pill)
   slides under the chosen one on ease-emphasized. Medium is 40 high (the field height: 32px segments in a 4px
   well), small 32. Chosen text: text-on-strong; the rest text-secondary. Brand tone: a fill-brand thumb with
   text-on-brand in both themes. */
.bt-SegmentedControl {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-050);
  max-width: 100%;
  padding: var(--bt-space-100);
  background: var(--bt-bg-surface-secondary);
  border-radius: var(--bt-radius-full);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
  --bt-SegmentedControl-height: var(--bt-size-control-sm);
}
.bt-SegmentedControl--small {
  padding: var(--bt-space-050);
  --bt-SegmentedControl-height: calc(var(--bt-size-control-sm) - var(--bt-space-100));
}
.bt-SegmentedControl--fill { display: flex; width: 100%; }

.bt-SegmentedControl__Thumb {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: var(--bt-radius-full);
  background: var(--bt-fill-strong);
  box-shadow: var(--bt-shadow-100);
  pointer-events: none;
  opacity: 0;
}
.bt-SegmentedControl__Thumb[data-state="shown"] { opacity: 1; }
.bt-SegmentedControl__Thumb[data-animate="true"] {
  transition: transform var(--bt-duration-base) var(--bt-ease-emphasized), width var(--bt-duration-base) var(--bt-ease-emphasized);
}
.bt-SegmentedControl--brand .bt-SegmentedControl__Thumb { background: var(--bt-fill-brand); box-shadow: none; }

.bt-SegmentedControl__Segment {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: center;
  gap: var(--bt-space-150);
  min-width: 0;
  height: var(--bt-SegmentedControl-height);
  margin: 0;
  padding: 0 var(--bt-space-300);
  border: 0;
  border-radius: var(--bt-radius-full);
  background: transparent;
  color: var(--bt-text-secondary);
  font-family: inherit;
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-semibold);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-SegmentedControl--small .bt-SegmentedControl__Segment { padding: 0 var(--bt-space-300); font-size: var(--bt-font-size-300); }
.bt-SegmentedControl--fill .bt-SegmentedControl__Segment { flex: 1 1 0; }
.bt-SegmentedControl__Segment--iconOnly { width: var(--bt-SegmentedControl-height); padding: 0; }
.bt-SegmentedControl__Label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bt-SegmentedControl__Segment:hover:not(:disabled, [aria-checked="true"]) { color: var(--bt-text); }
.bt-SegmentedControl__Segment[aria-checked="true"] { color: var(--bt-text-on-strong); }
.bt-SegmentedControl--brand .bt-SegmentedControl__Segment[aria-checked="true"] { color: var(--bt-text-on-brand); }
/* Until the thumb is placed (server HTML, before the first measurement) the chosen segment carries the fill. */
.bt-SegmentedControl__Thumb[data-state="hidden"] ~ .bt-SegmentedControl__Segment[aria-checked="true"] { background: var(--bt-fill-strong); }
.bt-SegmentedControl--brand .bt-SegmentedControl__Thumb[data-state="hidden"] ~ .bt-SegmentedControl__Segment[aria-checked="true"] { background: var(--bt-fill-brand); }
.bt-SegmentedControl--disabled .bt-SegmentedControl__Thumb[data-state="hidden"] ~ .bt-SegmentedControl__Segment[aria-checked="true"] { background: var(--bt-fill-disabled); }
.bt-SegmentedControl__Segment:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-SegmentedControl__Segment:disabled { color: var(--bt-text-disabled); cursor: default; }
.bt-SegmentedControl--disabled .bt-SegmentedControl__Thumb { background: var(--bt-fill-disabled); box-shadow: none; }
.bt-SegmentedControl--disabled .bt-SegmentedControl__Segment[aria-checked="true"] { color: var(--bt-text-disabled); }

@media (prefers-reduced-motion: reduce) {
  .bt-SegmentedControl__Thumb[data-animate="true"],
  .bt-SegmentedControl__Segment { transition: none; }
}

@media (forced-colors: active) {
  .bt-SegmentedControl { border: 1px solid CanvasText; }
  .bt-SegmentedControl__Thumb { forced-color-adjust: none; background: Highlight; }
  .bt-SegmentedControl__Segment[aria-checked="true"] { forced-color-adjust: none; color: HighlightText; }
  .bt-SegmentedControl__Segment:focus-visible { outline: 2px solid CanvasText; outline-offset: 1px; }
}

/* labelVisible: the label above the control, set like a field label. */
.bt-SegmentedControl__Field { display: inline-flex; flex-direction: column; align-items: flex-start; gap: var(--bt-space-150); max-width: 100%; }
.bt-SegmentedControl__Field--fill { display: flex; align-items: stretch; }
.bt-SegmentedControl__Title {
  font: var(--bt-font-weight-semibold) var(--bt-font-size-312) / var(--bt-font-line-height-450) var(--bt-font-sans);
  color: var(--bt-text);
}

/* --- Select --- */
/* Select: a button (role="combobox") drawn like TextField: fill-secondary with a border-strong line (3:1 on bg and
   bg-surface), border-hover on hover, a 2px border-focus line and a bg-brand-subtle halo on focus or while open.
   The list opens in a fixed layer on <body> (popup.ts): bg-surface, a border hairline, radius-350, shadow-soft-lg,
   options radius-250 with the active one ringed in border-focus and the chosen one semibold with a text-brand check.
   Below 768px (breakpoint-md) the list is a bottom sheet on the bg-overlay scrim, as Modal and Drawer are. */
.bt-Select {
  position: relative;
  display: flex;
  min-height: var(--bt-size-control-md);
  background: var(--bt-fill-secondary);
  border: var(--bt-border-width-1) solid var(--bt-border-strong);
  border-radius: var(--bt-radius-350);
  color: var(--bt-text);
  transition: border-color var(--bt-duration-fast) var(--bt-ease-emphasized), box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Select:hover { border-color: var(--bt-border-hover); }
.bt-Select:focus-within,
.bt-Select--open {
  border-color: var(--bt-border-focus);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-focus), 0 0 0 var(--bt-space-100) var(--bt-bg-brand-subtle);
}
.bt-Select--error,
.bt-Select--error:hover { border-color: var(--bt-border-critical); }
.bt-Select--error:focus-within,
.bt-Select--error.bt-Select--open {
  border-color: var(--bt-border-critical);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-critical), 0 0 0 var(--bt-space-100) var(--bt-bg-critical-subtle);
}
.bt-Select--disabled,
.bt-Select--disabled:hover { background: var(--bt-fill-disabled); border-color: var(--bt-border-secondary); color: var(--bt-text-disabled); }

/* DateRangeField's button sits in the same box; it has a class of its own so nothing takes it for a Select. */
.bt-Select__Trigger,
.bt-DateRangeField__Trigger {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: var(--bt-space-100);
  min-width: 0;
  margin: 0;
  padding: var(--bt-space-200) var(--bt-space-300);
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
  text-align: start;
  cursor: pointer;
}
/* The box draws the focus ring (focus-within), so the button draws none of its own. */
.bt-Select__Trigger:focus,
.bt-DateRangeField__Trigger:focus { outline: none; }
.bt-Select__Trigger:disabled,
.bt-DateRangeField__Trigger:disabled { cursor: default; }

/* The form's copy of the value: under the trigger, invisible, never hit; a browser's "fill this in" bubble points at it. */
.bt-Select__Value {
  position: absolute;
  inset-inline-start: var(--bt-space-300);
  bottom: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Large: 48px (size-control-lg), 16px text (body-lg) at every width; lines up with TextField and Button size="large". */
.bt-Select--large { min-height: var(--bt-size-control-lg); }
.bt-Select--large .bt-Select__Trigger,
.bt-Select--large .bt-DateRangeField__Trigger {
  gap: var(--bt-space-200);
  padding: var(--bt-space-200) var(--bt-space-300) var(--bt-space-200) var(--bt-space-400);
  font-size: var(--bt-font-size-400);
  line-height: var(--bt-font-line-height-600);
}
.bt-Select__InlineLabel { flex: none; color: var(--bt-text-secondary); }
.bt-Select__InlineLabel::after { content: ":"; }
.bt-Select__SelectedOption {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-Select--placeholder .bt-Select__SelectedOption { color: var(--bt-text-secondary); }
.bt-Select__Icon {
  display: inline-flex;
  flex: none;
  margin-inline-start: auto;
  color: var(--bt-text-secondary);
  transition: transform var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Select--open .bt-Select__Icon { transform: rotate(180deg); }
.bt-Select--disabled .bt-Select__InlineLabel,
.bt-Select--disabled .bt-Select__SelectedOption,
.bt-Select--disabled .bt-Select__Icon { color: var(--bt-text-disabled); }

/* ---- The list ---- */
.bt-Select__Popup {
  position: fixed;
  top: 0;
  left: 0;
  /* Above the modal layer (a select inside a Modal), below toasts and tooltips; as Popover. */
  z-index: calc(var(--bt-z-modal) + var(--bt-z-raised));
  font-family: var(--bt-font-sans);
  animation: bt-Select-in var(--bt-duration-fast) var(--bt-ease-emphasized) both;
}
.bt-Select__Popup[data-placement="above"] { animation-name: bt-Select-in-above; }
.bt-Select__Panel {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  /* 400px: overlay widths have no token family; as Popover. */
  max-width: min(400px, calc(100vw - var(--bt-space-400)));
  max-height: 320px; /* JS replaces it with the room on the chosen side. */
  overflow: hidden;
  border: var(--bt-border-width-1) solid var(--bt-border);
  border-radius: var(--bt-radius-350);
  background: var(--bt-bg-surface);
  color: var(--bt-text);
  box-shadow: var(--bt-shadow-soft-lg);
}
.bt-Select__Search {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--bt-space-200);
  margin: var(--bt-space-150) var(--bt-space-150) 0;
  padding: 0 var(--bt-space-300);
  min-height: var(--bt-size-control-md);
  box-sizing: border-box;
  border: var(--bt-border-width-1) solid var(--bt-border);
  border-radius: var(--bt-radius-275);
  background: var(--bt-fill-secondary);
  color: var(--bt-text-secondary);
}
.bt-Select__Search:focus-within { border-color: var(--bt-border-focus); box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-focus); }
.bt-Select__SearchIcon { display: inline-flex; flex: none; }
.bt-Select__SearchInput {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: var(--bt-space-150) 0;
  border: 0;
  background: transparent;
  color: var(--bt-text);
  font: inherit;
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
}
.bt-Select__SearchInput:focus { outline: none; }
.bt-Select__SearchInput::placeholder { color: var(--bt-text-secondary); opacity: 1; }
.bt-Select__Listbox {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--bt-space-150);
}
.bt-Select__Listbox[hidden] { display: none; }
.bt-Select__Group + .bt-Select__Group,
.bt-Select__Option + .bt-Select__Group { margin-top: var(--bt-space-150); padding-top: var(--bt-space-150); border-top: var(--bt-border-width-1) solid var(--bt-border-secondary); }
.bt-Select__GroupTitle {
  padding: var(--bt-space-150) var(--bt-space-300) var(--bt-space-100);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-300);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-semibold);
}
.bt-Select__Option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bt-space-200);
  min-height: var(--bt-size-control-md);
  box-sizing: border-box;
  padding: var(--bt-space-100) var(--bt-space-300);
  border-radius: var(--bt-radius-250);
  color: var(--bt-text);
  cursor: pointer;
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
}
/* The keyboard's (or the pointer's) place in the list; focus stays on the trigger, so this is the only sign of it. */
.bt-Select__Option--active { background: var(--bt-bg-surface-secondary); box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-focus); }
.bt-Select__Option--selected .bt-Select__OptionLabel { font-weight: var(--bt-font-weight-semibold); }
.bt-Select__Check { display: inline-flex; flex: none; color: var(--bt-text-brand); }
.bt-Select__Option--disabled { color: var(--bt-text-disabled); cursor: default; }
.bt-Select__OptionLabel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-Select__Status:empty { display: none; }
.bt-Select__Empty {
  padding: var(--bt-space-300) var(--bt-space-400) var(--bt-space-400);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
}
.bt-Select__Popup--large .bt-Select__Option { min-height: var(--bt-size-control-lg); font-size: var(--bt-font-size-400); line-height: var(--bt-font-line-height-600); }

/* ---- Phones: a bottom sheet ---- */
.bt-Select__Popup--sheet {
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: none;
}
.bt-Select__Backdrop {
  position: absolute;
  inset: 0;
  background: var(--bt-bg-overlay);
  animation: bt-Select-fade var(--bt-duration-base) var(--bt-ease-emphasized) both;
}
.bt-Select__Popup--sheet .bt-Select__Panel {
  position: relative;
  width: 100%;
  max-width: none;
  max-height: 70dvh;
  border-width: 0;
  border-radius: var(--bt-radius-600) var(--bt-radius-600) 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation: bt-Select-sheet var(--bt-duration-base) var(--bt-ease-emphasized) both;
}
.bt-Select__Grip {
  flex: none;
  width: var(--bt-space-1000);
  height: var(--bt-space-100);
  margin: var(--bt-space-200) auto 0;
  border-radius: var(--bt-radius-full);
  background: var(--bt-border);
}
.bt-Select__SheetTitle {
  flex: none;
  padding: var(--bt-space-300) var(--bt-space-500) var(--bt-space-100);
  font-size: var(--bt-font-size-425);
  line-height: var(--bt-font-line-height-600);
  font-weight: var(--bt-font-weight-bold);
}
.bt-Select__Popup--sheet .bt-Select__Search { margin: var(--bt-space-200) var(--bt-space-300) 0; }
.bt-Select__Popup--sheet .bt-Select__Listbox { padding: var(--bt-space-200) var(--bt-space-300) var(--bt-space-400); }
/* 44px rows (touch) and 16px text so iOS Safari does not zoom into the search field. */
.bt-Select__Popup--sheet .bt-Select__Option { min-height: 44px; font-size: var(--bt-font-size-400); line-height: var(--bt-font-line-height-600); }
.bt-Select__Popup--sheet .bt-Select__SearchInput { font-size: var(--bt-font-size-400); }

/* Phones: 16px (body-lg) in the box too; 768px is breakpoint-md. */
@media (max-width: 767.98px) {
  .bt-Select__Trigger,
  .bt-DateRangeField__Trigger { font-size: var(--bt-font-size-400); line-height: var(--bt-font-line-height-600); padding-top: var(--bt-space-150); padding-bottom: var(--bt-space-150); }
}

@keyframes bt-Select-in {
  from { opacity: 0; transform: translateY(calc(-1 * var(--bt-space-100))); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-Select-in-above {
  from { opacity: 0; transform: translateY(var(--bt-space-100)); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-Select-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes bt-Select-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .bt-Select,
  .bt-Select__Icon { transition: none; }
  .bt-Select__Popup,
  .bt-Select__Popup[data-placement="above"] { animation-name: bt-Select-fade; }
  .bt-Select__Popup--sheet .bt-Select__Panel { animation-name: bt-Select-fade; }
}

@media (forced-colors: active) {
  .bt-Select { border-color: CanvasText; }
  .bt-Select:focus-within { outline: 2px solid Highlight; outline-offset: 1px; }
  .bt-Select__Panel { border: 1px solid CanvasText; }
  .bt-Select__Option--active { outline: 2px solid Highlight; outline-offset: -2px; }
  .bt-Select__Option--disabled { color: GrayText; }
}

/* --- SkeletonBodyText --- */
/* SkeletonBodyText: pill bars on the rhythm of body text lines (body-md: 14px type on a 20px line, so a 12px bar
   and an 8px gap); the last of several stops at 80%. */
.bt-SkeletonBodyText {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-200);
  padding-block: var(--bt-space-050);
}
.bt-SkeletonBodyText__Line {
  block-size: var(--bt-space-300);
  border-radius: var(--bt-radius-full);
}
.bt-SkeletonBodyText__Line:last-child:not(:first-child) { inline-size: 80%; }

/* The shapes: token fills with a gentle sweep. background-attachment: fixed lays one gradient over the
   whole window, so every shape on the page shimmers in step. 1.6s is a loop length the duration tokens
   (UI transitions, at most 420ms) do not cover. No sweep under reduced motion. */
.bt-SkeletonBodyText__Line {
  background-color: var(--bt-bg-surface-active);
  background-image: linear-gradient(90deg, transparent 40%, var(--bt-bg-surface-hover) 50%, transparent 60%);
  background-size: 300% 100%;
  background-attachment: fixed;
  background-repeat: no-repeat;
  animation: bt-SkeletonBodyText-shimmer 1.6s var(--bt-ease-standard) infinite;
}
@keyframes bt-SkeletonBodyText-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-SkeletonBodyText__Line { animation: none; background-image: none; }
}

/* --- SkeletonDisplayText --- */
/* SkeletonDisplayText: one pill bar for a heading, about the heading's line minus its leading: small for a card
   heading (15-17px), medium for a section heading (20-22px), large for the page title (28-36px), extraLarge for
   the 34px display headline. */
.bt-SkeletonDisplayText {
  inline-size: 100%;
  max-inline-size: var(--bt-size-layout-third);
  border-radius: var(--bt-radius-full);
}
.bt-SkeletonDisplayText--sizeSmall { block-size: var(--bt-space-400); }
.bt-SkeletonDisplayText--sizeMedium { block-size: var(--bt-space-500); }
.bt-SkeletonDisplayText--sizeLarge { block-size: var(--bt-space-800); }
.bt-SkeletonDisplayText--sizeExtraLarge { block-size: var(--bt-space-1000); }

/* The shapes: token fills with a gentle sweep. background-attachment: fixed lays one gradient over the
   whole window, so every shape on the page shimmers in step. 1.6s is a loop length the duration tokens
   (UI transitions, at most 420ms) do not cover. No sweep under reduced motion. */
.bt-SkeletonDisplayText {
  background-color: var(--bt-bg-surface-active);
  background-image: linear-gradient(90deg, transparent 40%, var(--bt-bg-surface-hover) 50%, transparent 60%);
  background-size: 300% 100%;
  background-attachment: fixed;
  background-repeat: no-repeat;
  animation: bt-SkeletonDisplayText-shimmer 1.6s var(--bt-ease-standard) infinite;
}
@keyframes bt-SkeletonDisplayText-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-SkeletonDisplayText { animation: none; background-image: none; }
}

/* --- SkeletonPage --- */
/* SkeletonPage: Page's width, padding and header (Page.css: a 16 / 24px gutter on top of size-page, the header
   bottom-aligned with 16px gaps and 20px under it), with a round placeholder for the back button and a pill for the
   primary action, both control height. The title is the real one in Page's title type, or a SkeletonDisplayText. */
.bt-SkeletonPage {
  --bt-SkeletonPage-pad: var(--bt-space-400);
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: calc(var(--bt-size-page) + 2 * var(--bt-SkeletonPage-pad));
  margin-inline: auto;
  padding: var(--bt-SkeletonPage-pad) var(--bt-SkeletonPage-pad) var(--bt-space-1200);
  color: var(--bt-text);
  min-width: 0;
}
.bt-SkeletonPage--narrowWidth { max-inline-size: calc(var(--bt-size-page-narrow) + 2 * var(--bt-SkeletonPage-pad)); }
.bt-SkeletonPage--fullWidth { max-inline-size: none; }

.bt-SkeletonPage__Header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--bt-space-400);
  margin-block-end: var(--bt-space-500);
  min-block-size: var(--bt-size-control-md);
}
.bt-SkeletonPage__Title {
  flex: 1 1 var(--bt-size-page-title-min);
  min-width: 0;
}
/* Page's title type (Page.css .bt-Page__Title). */
.bt-SkeletonPage__Title > h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--bt-font-display);
  font-size: clamp(var(--bt-font-size-700), 2.6vw, var(--bt-font-size-900));
  font-weight: var(--bt-font-weight-bold);
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.bt-SkeletonPage__Back {
  flex: none;
  align-self: flex-start;
  inline-size: var(--bt-size-control-md);
  block-size: var(--bt-size-control-md);
  border-radius: var(--bt-radius-full);
}
.bt-SkeletonPage__Action {
  flex: none;
  inline-size: var(--bt-space-2400);
  block-size: var(--bt-size-control-md);
  border-radius: var(--bt-radius-full);
}
@media (min-width: 768px) {
  .bt-SkeletonPage { --bt-SkeletonPage-pad: var(--bt-space-600); }
}

/* The shapes sit on the canvas, so they take the card colour with a border hairline (the secondary button and the
   tab chip on bg), and a gentle sweep in step with the other skeletons (background-attachment: fixed lays one
   gradient over the window). 1.6s is a loop length the duration tokens do not cover. */
.bt-SkeletonPage__Back,
.bt-SkeletonPage__Action {
  background-color: var(--bt-bg-surface);
  background-image: linear-gradient(90deg, transparent 40%, var(--bt-bg-surface-hover) 50%, transparent 60%);
  background-size: 300% 100%;
  background-attachment: fixed;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border);
  animation: bt-SkeletonPage-shimmer 1.6s var(--bt-ease-standard) infinite;
}
@keyframes bt-SkeletonPage-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-SkeletonPage__Back,
  .bt-SkeletonPage__Action { animation: none; background-image: none; }
}

/* --- SkeletonTabs --- */
/* SkeletonTabs: a row of pill chips the size of Tabs' (13.5px label on a 16px line, 10px x 17px padding: 36px
   high, radius-full, 6px apart), drawn as the chip's hairline outline on the card colour with a short pill bar
   inside, so the row reads as tabs, not as a block of text. fitted shares the width as Tabs fitted does. */
.bt-SkeletonTabs {
  display: flex;
  gap: var(--bt-space-150);
  overflow: hidden;
}
.bt-SkeletonTabs__Tab {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  block-size: calc(2 * (var(--bt-space-200) + var(--bt-space-050)) + var(--bt-font-line-height-400));
  padding-inline: calc(var(--bt-space-400) + var(--bt-space-025));
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border);
}
.bt-SkeletonTabs--fitted .bt-SkeletonTabs__Tab { flex: 1 0 auto; }
.bt-SkeletonTabs__Bar {
  inline-size: var(--bt-space-1200);
  block-size: var(--bt-space-200);
  border-radius: var(--bt-radius-full);
}

/* The shapes: token fills with a gentle sweep. background-attachment: fixed lays one gradient over the
   whole window, so every shape on the page shimmers in step. 1.6s is a loop length the duration tokens
   (UI transitions, at most 420ms) do not cover. No sweep under reduced motion. */
.bt-SkeletonTabs__Bar {
  background-color: var(--bt-bg-surface-active);
  background-image: linear-gradient(90deg, transparent 40%, var(--bt-bg-surface-hover) 50%, transparent 60%);
  background-size: 300% 100%;
  background-attachment: fixed;
  background-repeat: no-repeat;
  animation: bt-SkeletonTabs-shimmer 1.6s var(--bt-ease-standard) infinite;
}
@keyframes bt-SkeletonTabs-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-SkeletonTabs__Bar { animation: none; background-image: none; }
}

/* --- SkeletonThumbnail --- */
/* SkeletonThumbnail: the Thumbnail sizes and corners (60px and 80px as in Thumbnail.css: no size token); the
   template's inner tile radius 14 at medium and large, 10 small, 8 extra small. */
.bt-SkeletonThumbnail {
  flex: none;
  inline-size: 60px;
  block-size: 60px;
  border-radius: var(--bt-radius-350);
}
.bt-SkeletonThumbnail--sizeExtraSmall { inline-size: var(--bt-size-icon-lg); block-size: var(--bt-size-icon-lg); border-radius: var(--bt-radius-200); }
.bt-SkeletonThumbnail--sizeSmall { inline-size: var(--bt-size-control-md); block-size: var(--bt-size-control-md); border-radius: var(--bt-radius-250); }
.bt-SkeletonThumbnail--sizeLarge { inline-size: 80px; block-size: 80px; }

/* The shapes: token fills with a gentle sweep. background-attachment: fixed lays one gradient over the
   whole window, so every shape on the page shimmers in step. 1.6s is a loop length the duration tokens
   (UI transitions, at most 420ms) do not cover. No sweep under reduced motion. */
.bt-SkeletonThumbnail {
  background-color: var(--bt-bg-surface-active);
  background-image: linear-gradient(90deg, transparent 40%, var(--bt-bg-surface-hover) 50%, transparent 60%);
  background-size: 300% 100%;
  background-attachment: fixed;
  background-repeat: no-repeat;
  animation: bt-SkeletonThumbnail-shimmer 1.6s var(--bt-ease-standard) infinite;
}
@keyframes bt-SkeletonThumbnail-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-SkeletonThumbnail { animation: none; background-image: none; }
}

/* --- Sortable --- */
/* A vertical list with a grip on each row. The rows' positions during a drag are transforms set from the script.
   The grip is a round icon button (hover: the card's second tone); the dragged row lifts as a card tile
   (radius 14, bg-surface, the large soft shadow) while the others make way on the emphasized easing. */
.bt-Sortable { min-inline-size: 0; }
.bt-Sortable__List {
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-100);
  margin: 0;
  padding: 0;
  list-style: none;
}
.bt-Sortable__Item {
  display: flex;
  align-items: flex-start;
  gap: var(--bt-space-200);
  min-inline-size: 0;
  border-radius: var(--bt-radius-350);
}
.bt-Sortable__Content { flex: 1; min-inline-size: 0; }

.bt-Sortable__Grip {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: var(--bt-size-control-sm);
  block-size: var(--bt-size-control-sm);
  padding: 0;
  border: 0;
  border-radius: var(--bt-radius-full);
  background: transparent;
  color: var(--bt-text-secondary);
  cursor: grab;
  /* A finger on the grip drags: it does not scroll the page. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized), color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Sortable__Grip:hover:not(:disabled) { background: var(--bt-bg-surface-secondary); color: var(--bt-text); }
.bt-Sortable__Grip:active:not(:disabled) { background: var(--bt-bg-surface-active); }
.bt-Sortable__Grip:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-Sortable__Grip:disabled { color: var(--bt-text-disabled); cursor: default; }
@media (pointer: coarse) {
  .bt-Sortable__Grip { inline-size: var(--bt-size-control-md); block-size: var(--bt-size-control-md); }
}
@media (forced-colors: active) {
  .bt-Sortable__Grip:focus-visible { outline: 2px solid Highlight; outline-offset: 1px; }
}

.bt-Sortable--dragging { user-select: none; -webkit-user-select: none; }
.bt-Sortable--dragging > .bt-Sortable__List > .bt-Sortable__Item { transition: transform var(--bt-duration-base) var(--bt-ease-emphasized); }
.bt-Sortable--dragging > .bt-Sortable__List > .bt-Sortable__Item--dragging {
  position: relative;
  z-index: 1;
  background: var(--bt-bg-surface);
  box-shadow: var(--bt-shadow-soft-lg), 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
  transition: box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Sortable__Item--dragging > .bt-Sortable__Grip { cursor: grabbing; background: var(--bt-bg-surface-secondary); color: var(--bt-text); }
@media (prefers-reduced-motion: reduce) {
  .bt-Sortable--dragging > .bt-Sortable__List > .bt-Sortable__Item,
  .bt-Sortable__Grip { transition: none; }
}

/* --- Sparkline --- */
/* Sparkline: one series, no axes. The 2px line and the soft area wear the series color (--bt-Sparkline-color, a viz
   token set inline); dots carry a 2px viz-surface ring; the crosshair is a viz-axis hairline. */
.bt-Sparkline {
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
  vertical-align: middle;
}
.bt-Sparkline--fluid { display: flex; width: 100%; }

.bt-Sparkline__plot {
  position: relative;
  width: 100%;
  border-radius: var(--bt-radius-100);
}
.bt-Sparkline--interactive .bt-Sparkline__plot { cursor: crosshair; touch-action: pan-y; }
.bt-Sparkline__plot:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }

.bt-Sparkline__svg { display: block; overflow: visible; }

.bt-Sparkline__line {
  fill: none;
  stroke: var(--bt-Sparkline-color);
  stroke-width: 2px;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.bt-Sparkline__area {
  fill: var(--bt-Sparkline-color);
  /* The area wash (12%, as the template's sparkline); no token family holds opacities. */
  fill-opacity: 0.12;
  stroke: none;
}
.bt-Sparkline__dot {
  fill: var(--bt-Sparkline-color);
  stroke: var(--bt-viz-surface);
  stroke-width: 2px;
}
.bt-Sparkline__dot--active { fill: var(--bt-viz-surface); stroke: var(--bt-Sparkline-color); stroke-width: 2.5px; }
.bt-Sparkline__crosshair {
  stroke: var(--bt-viz-axis);
  stroke-width: 1px;
  shape-rendering: crispEdges;
}

/* The readout sits above the plot at the active point; near the ends it hangs inward so it stays over the plot. */
.bt-Sparkline__readout {
  bottom: calc(100% + var(--bt-space-100));
  transform: translateX(-50%);
  animation: bt-Sparkline-in var(--bt-duration-fast) var(--bt-ease-emphasized) both;
}
.bt-Sparkline__readout--start { transform: translateX(calc(-1 * var(--bt-space-200))); }
.bt-Sparkline__readout--end { transform: translateX(calc(-100% + var(--bt-space-200))); }

@keyframes bt-Sparkline-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .bt-Sparkline__readout { animation: none; }
}

@media (forced-colors: active) {
  .bt-Sparkline__line { stroke: CanvasText; }
  .bt-Sparkline__area { fill: CanvasText; }
  .bt-Sparkline__dot { fill: CanvasText; stroke: Canvas; }
  .bt-Sparkline__dot--active { fill: Canvas; stroke: CanvasText; }
  .bt-Sparkline__crosshair { stroke: GrayText; }
}

/* --- Spinner --- */
.bt-Spinner {
  display: inline-flex;
  flex: none;
  vertical-align: middle;
  color: var(--bt-fill-brand);
}
.bt-Spinner--small { width: var(--bt-size-icon-md); height: var(--bt-size-icon-md); }
/* The large spinner is 44px: the touch-target size token. */
.bt-Spinner--large { width: var(--bt-size-touch-min); height: var(--bt-size-touch-min); }

.bt-Spinner__svg {
  width: 100%;
  height: 100%;
  /* One turn = 2 x duration-slower (840ms). */
  animation: bt-Spinner-spin calc(var(--bt-duration-slower) * 2) linear infinite;
}
.bt-Spinner__track,
.bt-Spinner__arc {
  fill: none;
  stroke-width: 2.5; /* viewBox units, scales with size */
}
.bt-Spinner__track { stroke: var(--bt-border); }
.bt-Spinner__arc {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-dasharray: 30 100;
}

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

/* Reduced motion: a slow turn (about 5s) keeps "still loading" visible without the fast spin. */
@media (prefers-reduced-motion: reduce) {
  .bt-Spinner__svg { animation-duration: calc(var(--bt-duration-slower) * 12); }
}

/* --- StatTile --- */
/* StatTile: the template's KPI tile. Label (600, muted) with an optional icon, the hero value (600, proportional
   figures, the sans face), and a foot with the delta pill (arrow + signed percent in a soft status tint) and the
   comparison, a small sparkline at the end. Grounds: surface card (hairline + soft shadow), muted inner tile,
   pastel tints bg-tile-1..6 with text-on-tile, the strong lead tile (bg-rail ink) and brand garnet. */
.bt-StatTile {
  --bt-stat-ink: var(--bt-text);
  --bt-stat-muted: var(--bt-text-secondary);
  position: relative;
  display: flex;
  flex-direction: column;
  /* Grows in an InlineStack / flex row from 192px (2 x space-2400), so four tiles share a row and wrap on narrow screens. */
  flex: 1 1 calc(var(--bt-space-2400) * 2);
  min-width: 0;
  min-height: 124px;
  box-sizing: border-box;
  padding: var(--bt-space-400) 18px 14px;
  background: var(--bt-bg-surface);
  color: var(--bt-stat-ink);
  border-radius: var(--bt-radius-600);
  box-shadow: inset 0 0 0 1px var(--bt-border-secondary), var(--bt-shadow-soft);
  font-family: var(--bt-font-sans);
  overflow: hidden;
}
/* A label and a value alone (no delta, hint, sparkline or extra) need no reserved foot. */
.bt-StatTile--bare { min-height: 0; }
.bt-StatTile--small {
  min-height: 0;
  padding: var(--bt-space-300) 14px;
  border-radius: var(--bt-radius-350);
}

.bt-StatTile--muted { background: var(--bt-bg-surface-secondary); box-shadow: inset 0 0 0 1px var(--bt-border-secondary); }
.bt-StatTile--tile { --bt-stat-ink: var(--bt-text-on-tile); --bt-stat-muted: var(--bt-text-on-tile-secondary); --bt-text: var(--bt-text-on-tile); --bt-text-secondary: var(--bt-text-on-tile-secondary); box-shadow: inset 0 0 0 1px var(--bt-border-secondary); }
.bt-StatTile--tile-1 { background: var(--bt-bg-tile-1); }
.bt-StatTile--tile-2 { background: var(--bt-bg-tile-2); }
.bt-StatTile--tile-3 { background: var(--bt-bg-tile-3); }
.bt-StatTile--tile-4 { background: var(--bt-bg-tile-4); }
.bt-StatTile--tile-5 { background: var(--bt-bg-tile-5); }
.bt-StatTile--tile-6 { background: var(--bt-bg-tile-6); }
/* The lead tile of a summary strip (template `night`): fill-strong, ink in light and garnet in dark (the rail ink
   vanished on the dark canvas). The dimmed label is text-on-strong-secondary. Strong and brand re-point text and text-secondary
   for their subtree, so children (a Meter, a Text) take the tile's colours without tone="inherit". */
.bt-StatTile--strong {
  --bt-stat-ink: var(--bt-text-on-strong);
  --bt-stat-muted: var(--bt-text-on-strong-secondary);
  --bt-text: var(--bt-text-on-strong);
  --bt-text-secondary: var(--bt-text-on-strong-secondary);
  background: var(--bt-fill-strong);
  box-shadow: none;
}
.bt-StatTile--brand {
  --bt-stat-ink: var(--bt-text-on-brand);
  --bt-stat-muted: color-mix(in oklab, var(--bt-text-on-brand) 80%, transparent);
  --bt-text: var(--bt-text-on-brand);
  --bt-text-secondary: color-mix(in oklab, var(--bt-text-on-brand) 80%, transparent);
  background: var(--bt-bg-brand);
  box-shadow: none;
}

.bt-StatTile__label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--bt-space-200);
  font-size: var(--bt-font-size-312);
  line-height: 1.4;
  font-weight: 600;
  color: var(--bt-stat-muted);
}
.bt-StatTile--small .bt-StatTile__label { font-size: var(--bt-font-size-300); }
.bt-StatTile__icon { display: inline-flex; color: var(--bt-stat-ink); }

.bt-StatTile__value {
  margin: 10px 0 0;
  font-size: var(--bt-font-size-550);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--bt-stat-ink);
  font-variant-numeric: proportional-nums;
  overflow-wrap: anywhere;
}
.bt-StatTile--small .bt-StatTile__value { margin-top: 2px; font-size: var(--bt-font-size-425); }
.bt-StatTile--strong .bt-StatTile__value,
.bt-StatTile--brand .bt-StatTile__value { font-size: var(--bt-font-size-650); letter-spacing: -0.02em; }
.bt-StatTile__suffix { font-size: var(--bt-font-size-312); font-weight: 600; color: var(--bt-stat-muted); letter-spacing: 0; }
.bt-StatTile__value--empty { color: var(--bt-stat-muted); }

.bt-StatTile__foot {
  display: flex;
  align-items: flex-end;
  gap: var(--bt-space-200);
  margin-top: auto;
  padding-top: var(--bt-space-200);
  min-width: 0;
}
.bt-StatTile__sparkline { margin-inline-start: auto; flex: none; }

.bt-StatTile__empty,
.bt-StatTile__hint,
.bt-StatTile__delta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bt-space-050) var(--bt-space-150);
  font-size: var(--bt-font-size-300);
  line-height: 1.4;
  font-weight: 600;
  color: var(--bt-stat-muted);
  min-width: 0;
}
.bt-StatTile__empty { margin-top: var(--bt-space-100); }
/* The comparison wraps under the pill as a whole before its words break. */
.bt-StatTile__comparison { flex: 0 0 auto; max-width: 100%; }

/* The delta pill: status text on its soft tint; on tinted and strong grounds a veil of the card instead. */
.bt-StatTile__change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 7px 2px 5px;
  border-radius: var(--bt-radius-full);
  white-space: nowrap;
  font-size: var(--bt-font-size-275);
  font-weight: 700;
  font-variant-numeric: proportional-nums;
  background: var(--bt-bg-surface-secondary);
  color: var(--bt-text-secondary);
}
.bt-StatTile__change .bt-Icon { width: 14px; height: 14px; color: currentColor; }
.bt-StatTile__delta--good .bt-StatTile__change { background: var(--bt-bg-success-subtle); color: var(--bt-text-success); }
.bt-StatTile__delta--bad .bt-StatTile__change { background: var(--bt-bg-critical-subtle); color: var(--bt-text-critical); }
.bt-StatTile--tile .bt-StatTile__change { background: color-mix(in oklab, var(--bt-bg-surface) 62%, transparent); }
.bt-StatTile--strong .bt-StatTile__change,
.bt-StatTile--brand .bt-StatTile__change { background: color-mix(in oklab, currentColor 16%, transparent); color: var(--bt-stat-ink); }

.bt-StatTile__extra { margin-top: var(--bt-space-300); }

/* Loading: two pulsing bars in the value's and the delta's places, so the tile keeps its height. */
.bt-StatTile__skeleton {
  display: block;
  border-radius: var(--bt-radius-full);
  background: color-mix(in oklab, var(--bt-stat-ink) 10%, transparent);
  animation: bt-StatTile-pulse calc(var(--bt-duration-slower) * 3) var(--bt-ease-standard) infinite alternate;
}
.bt-StatTile__skeleton--value { width: 60%; height: var(--bt-space-600); margin-block: var(--bt-space-050); }
.bt-StatTile--small .bt-StatTile__skeleton--value { height: var(--bt-space-500); }
.bt-StatTile__skeleton--delta { width: 40%; height: var(--bt-space-300); margin-top: auto; }
@keyframes bt-StatTile-pulse { from { opacity: 1; } to { opacity: 0.45; } }

/* Clickable: one link or button stretched over the whole tile (its name comes from the label, value and delta). */
.bt-StatTile__action {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bt-StatTile__action:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-StatTile--clickable { transition: transform var(--bt-duration-fast) var(--bt-ease-emphasized), box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized); }
.bt-StatTile--clickable:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--bt-border), var(--bt-shadow-soft-lg); }
.bt-StatTile--clickable:active { transform: none; }

/* StatTile.Row: a KPI row. Columns of at least 12rem from 480px; on phones two columns (`phoneColumns={1}` for long
   money values) with compact tiles, so four figures take two short rows instead of four tall ones. */
.bt-StatTileRow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--bt-space-400);
  min-width: 0;
}
@media (max-width: 479.98px) {
  .bt-StatTileRow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bt-space-200); }
  .bt-StatTileRow--phone1 { grid-template-columns: minmax(0, 1fr); }
  .bt-StatTileRow > .bt-StatTile { min-height: 0; padding: var(--bt-space-300) 14px; border-radius: var(--bt-radius-500); }
  .bt-StatTileRow > .bt-StatTile .bt-StatTile__value { margin-top: 2px; font-size: var(--bt-font-size-425); }
  .bt-StatTileRow > .bt-StatTile .bt-StatTile__foot { flex-wrap: wrap; }
  .bt-StatTileRow > .bt-StatTile .bt-StatTile__sparkline { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bt-StatTile--clickable { transition: none; }
  .bt-StatTile--clickable:hover { transform: none; }
  .bt-StatTile__skeleton { animation: none; }
}

@media (forced-colors: active) {
  .bt-StatTile { border: 1px solid CanvasText; }
  .bt-StatTile__change { border: 1px solid CanvasText; }
  .bt-StatTile__skeleton { background: GrayText; }
  .bt-StatTile__action:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* --- Stepper --- */
/* Stepper: an ordered list of steps, each a round mark joined to the next by a connector. The base layout is
   vertical (marks in a column, a 2px line between them, the text and an optional log tile beside each mark);
   the horizontal stepper switches to a row of dots with a bar between them and the labels under them once its
   own width is 400px or more (a container query on the wrapper), so a narrow column keeps it readable.
   Marks: upcoming a border-strong ring (3:1) with the number in text-secondary; current a garnet ring with the
   number in text-brand; complete garnet with a check (text-on-brand); error fill-critical with an alert
   (text-on-critical); skipped a dashed ring with a minus. The connector is filled garnet along the way the flow
   has come. */
.bt-Stepper {
  container-type: inline-size;
  width: 100%;
  min-width: 0;
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
  --bt-Stepper-mark: calc(var(--bt-space-600) + var(--bt-space-050));
  --bt-Stepper-line: var(--bt-border-width-2);
}

.bt-Stepper__list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }

/* ---- the base (vertical) layout ---- */
.bt-Stepper__step {
  position: relative;
  display: grid;
  grid-template-columns: var(--bt-Stepper-mark) minmax(0, 1fr);
  column-gap: var(--bt-space-300);
  padding-block-end: var(--bt-space-500);
  min-width: 0;
}
.bt-Stepper__step:last-child { padding-block-end: 0; }

.bt-Stepper__mark {
  position: relative;
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  inline-size: var(--bt-Stepper-mark);
  block-size: var(--bt-Stepper-mark);
  box-sizing: border-box;
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface);
  box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-strong);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-275);
  line-height: 1;
  font-weight: var(--bt-font-weight-bold);
  font-variant-numeric: tabular-nums;
}
.bt-Stepper__mark .bt-Icon { width: var(--bt-space-400); height: var(--bt-space-400); }

.bt-Stepper__step--current .bt-Stepper__mark { box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-fill-brand); color: var(--bt-text-brand); }
.bt-Stepper__step--complete .bt-Stepper__mark { background: var(--bt-fill-brand); box-shadow: none; color: var(--bt-text-on-brand); }
.bt-Stepper__step--error .bt-Stepper__mark { background: var(--bt-fill-critical); box-shadow: none; color: var(--bt-text-on-critical); }
.bt-Stepper__step--skipped .bt-Stepper__mark {
  border: var(--bt-border-width-2) dashed var(--bt-border-strong);
  box-shadow: none;
  color: var(--bt-text-secondary);
}

/* From under this mark to just above the next one. */
.bt-Stepper__connector {
  position: absolute;
  inset-inline-start: calc(var(--bt-Stepper-mark) / 2 - var(--bt-Stepper-line) / 2);
  inset-block: calc(var(--bt-Stepper-mark) + var(--bt-space-100)) var(--bt-space-100);
  inline-size: var(--bt-Stepper-line);
  border-radius: var(--bt-radius-full);
  background: var(--bt-border);
}
.bt-Stepper__connector--done { background: var(--bt-fill-brand); }

.bt-Stepper__text {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-050);
  min-width: 0;
  /* The label's first line sits on the mark's middle. */
  padding-block-start: calc((var(--bt-Stepper-mark) - var(--bt-font-line-height-500)) / 2);
}
.bt-Stepper__label {
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-semibold);
  overflow-wrap: anywhere;
}
.bt-Stepper__description {
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  overflow-wrap: anywhere;
}
.bt-Stepper__step--upcoming .bt-Stepper__label,
.bt-Stepper__step--skipped .bt-Stepper__label { color: var(--bt-text-secondary); }

/* The log: the template's step-log tile, radius 14 on the card's second tone; a failed step's on the critical tint. */
.bt-Stepper__log {
  margin-block-start: var(--bt-space-200);
  padding: calc(var(--bt-space-200) + var(--bt-space-050)) var(--bt-space-300);
  border-radius: var(--bt-radius-350);
  background: var(--bt-bg-surface-secondary);
  color: var(--bt-text);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  overflow-wrap: anywhere;
}
.bt-Stepper__step--error .bt-Stepper__log { background: var(--bt-bg-critical-subtle); }

/* ---- horizontal, from 400px of its own width ---- */
@container (min-width: 400px) {
  .bt-Stepper--horizontal { --bt-Stepper-mark: calc(var(--bt-space-500) + var(--bt-space-050)); }
  .bt-Stepper--horizontal .bt-Stepper__list { flex-direction: row; }
  .bt-Stepper--horizontal .bt-Stepper__step {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    gap: var(--bt-space-200);
    padding-block-end: 0;
  }
  .bt-Stepper--horizontal .bt-Stepper__step:last-child { flex: none; max-inline-size: 30%; }
  .bt-Stepper--horizontal .bt-Stepper__connector {
    inset-block: calc(var(--bt-Stepper-mark) / 2 - var(--bt-Stepper-line) / 2) auto;
    inset-inline: calc(var(--bt-Stepper-mark) + var(--bt-space-100)) var(--bt-space-100);
    inline-size: auto;
    block-size: var(--bt-Stepper-line);
  }
  .bt-Stepper--horizontal .bt-Stepper__text { padding-block-start: 0; padding-inline-end: var(--bt-space-150); }
  .bt-Stepper--horizontal .bt-Stepper__label {
    font-size: var(--bt-font-size-300);
    line-height: var(--bt-font-line-height-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .bt-Stepper--horizontal .bt-Stepper__description { font-size: var(--bt-font-size-275); line-height: var(--bt-font-line-height-400); }
  .bt-Stepper--horizontal .bt-Stepper__mark .bt-Icon { width: calc(var(--bt-space-300) + var(--bt-space-050)); height: calc(var(--bt-space-300) + var(--bt-space-050)); }
}

@media (forced-colors: active) {
  .bt-Stepper__mark { border: 2px solid CanvasText; box-shadow: none; }
  .bt-Stepper__step--current .bt-Stepper__mark,
  .bt-Stepper__step--complete .bt-Stepper__mark { border-color: Highlight; }
  .bt-Stepper__step--complete .bt-Stepper__mark { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .bt-Stepper__connector { background: CanvasText; }
  .bt-Stepper__connector--done { background: Highlight; }
}

/* --- Switch --- */
/* A real checkbox with role="switch", transparent, over a drawn 42 x 24 track and a 20px thumb.
   Off: bg-surface-active track with a border-strong line (3:1 on surfaces), white thumb; on: fill-brand track.
   Thumb travel = track width - track height; motion uses ease-emphasized. */
.bt-Switch {
  position: relative;
  display: inline-flex;
  /* 42 x 24: size-control-md plus a 2px step (no toggle width token), size-icon-lg high */
  width: calc(var(--bt-size-control-md) + var(--bt-space-050));
  height: var(--bt-size-icon-lg);
}
.bt-Switch__Input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.bt-Switch__Input:disabled { cursor: default; }
.bt-Switch__Track {
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface-active);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-strong);
  transition: background-color var(--bt-duration-base) var(--bt-ease-emphasized), box-shadow var(--bt-duration-base) var(--bt-ease-emphasized);
}
.bt-Switch__Thumb {
  position: absolute;
  top: var(--bt-space-050);
  left: var(--bt-space-050);
  width: var(--bt-size-icon-md);
  height: var(--bt-size-icon-md);
  border-radius: var(--bt-radius-full);
  background: var(--bt-text-on-brand);
  box-shadow: var(--bt-shadow-100), 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
  transition: transform var(--bt-duration-base) var(--bt-ease-emphasized), background-color var(--bt-duration-base) var(--bt-ease-emphasized);
}
.bt-Switch__Input:hover + .bt-Switch__Track { box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-hover); }

.bt-Switch__Input:checked + .bt-Switch__Track { background: var(--bt-fill-brand); box-shadow: none; }
.bt-Switch__Input:checked:hover + .bt-Switch__Track { background: var(--bt-fill-brand-hover); }
.bt-Switch__Input:checked + .bt-Switch__Track .bt-Switch__Thumb {
  /* travel = track width - track height */
  transform: translateX(calc(var(--bt-size-control-md) + var(--bt-space-050) - var(--bt-size-icon-lg)));
}
[dir="rtl"] .bt-Switch__Input:checked + .bt-Switch__Track .bt-Switch__Thumb { transform: translateX(calc(var(--bt-size-icon-lg) - var(--bt-size-control-md) - var(--bt-space-050))); }
/* error: a critical outline on the track, off or on. */
.bt-Switch--error .bt-Switch__Input + .bt-Switch__Track { box-shadow: inset 0 0 0 var(--bt-border-width-2) var(--bt-border-critical); }
/* Keyboard focus last, so it wins over the hover and checked shadows. */
.bt-Switch__Input:focus-visible + .bt-Switch__Track { box-shadow: var(--bt-shadow-focus); }
[dir="rtl"] .bt-Switch__Thumb { left: auto; right: var(--bt-space-050); }
.bt-Switch__Input:disabled + .bt-Switch__Track { background: var(--bt-fill-disabled); box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border); }
.bt-Switch__Input:disabled + .bt-Switch__Track .bt-Switch__Thumb { background: var(--bt-text-disabled); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .bt-Switch__Track,
  .bt-Switch__Thumb { transition: none; }
}

@media (forced-colors: active) {
  .bt-Switch__Track { background: Canvas; border: 1px solid CanvasText; }
  .bt-Switch__Thumb { background: CanvasText; top: 1px; }
  .bt-Switch__Input:checked + .bt-Switch__Track { background: Highlight; border-color: Highlight; }
  .bt-Switch__Input:checked + .bt-Switch__Track .bt-Switch__Thumb { background: HighlightText; }
  .bt-Switch__Input:focus-visible + .bt-Switch__Track { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* --- Tabs --- */
/* Tabs: a row of pill chips. Unselected chips sit on the card colour with a hairline; the selected one is filled
   with the strong fill (ink in light, garnet in dark) and its text is text-on-strong (4.5:1 on all three fills). */
.bt-Tabs { min-width: 0; }

/* Scrolls sideways on narrow widths with the bar hidden; an edge that hides chips fades out (bt-ScrollFade in
   shared/scroll-fade.css). The padding keeps the focus ring inside the clip; the negative margin cancels it so the
   chips line up with the content. */
.bt-Tabs__scroller {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: var(--bt-space-100);
  margin: calc(-1 * var(--bt-space-100));
  -webkit-overflow-scrolling: touch;
}
.bt-Tabs__scroller::-webkit-scrollbar { display: none; }

.bt-Tabs__list {
  display: flex;
  gap: var(--bt-space-150);
  width: max-content;
}
.bt-Tabs--fitted .bt-Tabs__list { width: auto; min-width: 100%; }
.bt-Tabs--fitted .bt-Tabs__tab { flex: 1 0 auto; justify-content: center; }

/* The template chip: 13.5px semibold, 10px x 17px padding (about 36px high). */
.bt-Tabs__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-150);
  flex: none;
  margin: 0;
  padding: calc(var(--bt-space-200) + var(--bt-space-050)) calc(var(--bt-space-400) + var(--bt-space-025));
  border: 0;
  border-radius: var(--bt-radius-full);
  background: var(--bt-bg-surface);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border);
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-337);
  font-weight: var(--bt-font-weight-semibold);
  line-height: var(--bt-font-line-height-400);
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--bt-duration-fast) var(--bt-ease-emphasized),
    color var(--bt-duration-fast) var(--bt-ease-emphasized),
    box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Tabs__tab:hover:not(:disabled):not(.bt-Tabs__tab--selected) { background: var(--bt-bg-surface-secondary); }
.bt-Tabs__tab:active:not(:disabled):not(.bt-Tabs__tab--selected) { background: var(--bt-bg-surface-active); }
.bt-Tabs__tab:focus { outline: none; }
.bt-Tabs__tab:focus-visible { box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border), var(--bt-shadow-focus); z-index: 1; }

.bt-Tabs__tab--selected {
  background: var(--bt-fill-strong);
  box-shadow: none;
  color: var(--bt-text-on-strong);
}
.bt-Tabs__tab--selected:hover:not(:disabled) { background: var(--bt-fill-strong-hover); }
.bt-Tabs__tab--selected:active:not(:disabled) { background: var(--bt-fill-strong-active); }
.bt-Tabs__tab--selected:focus-visible { box-shadow: var(--bt-shadow-focus); }

.bt-Tabs__tab:disabled { background: transparent; color: var(--bt-text-disabled); cursor: default; }
.bt-Tabs__tab--selected:disabled { background: var(--bt-fill-disabled); box-shadow: none; }

/* The count: a garnet pill (size-tab-count, 19px), bold 11px tabular figures. On the selected chip it inverts, so it never sits
   garnet on garnet (dark). */
.bt-Tabs__count {
  display: inline-grid;
  place-items: center;
  min-width: var(--bt-size-tab-count);
  height: var(--bt-size-tab-count);
  padding: 0 calc(var(--bt-space-100) + var(--bt-space-025));
  border-radius: var(--bt-radius-full);
  background: var(--bt-fill-brand);
  color: var(--bt-text-on-brand);
  font-size: var(--bt-font-size-275);
  font-weight: var(--bt-font-weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.bt-Tabs__tab--selected .bt-Tabs__count { background: var(--bt-text-on-strong); color: var(--bt-fill-strong); }
.bt-Tabs__tab:disabled .bt-Tabs__count { background: var(--bt-fill-disabled); color: var(--bt-text-disabled); }

.bt-Tabs__panel { border-radius: var(--bt-radius-250); }
.bt-Tabs__panel:focus { outline: none; }
.bt-Tabs__panel:focus-visible { box-shadow: var(--bt-shadow-focus); }

@media (prefers-reduced-motion: reduce) {
  .bt-Tabs__tab { transition: none; }
}
@media (forced-colors: active) {
  .bt-Tabs__tab { border: 1px solid ButtonText; }
  .bt-Tabs__tab--selected { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .bt-Tabs__tab:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
  .bt-Tabs__count { border: 1px solid currentColor; }
}

/* --- Tag --- */
/* Tag: a pill chip on the card colour with a hairline; text in text-secondary, 12.5px semibold. A clickable chip
   that is selected takes fill-strong (ink in light, garnet in dark), like the primary Button. */
.bt-Tag {
  --bt-tag-height: var(--bt-size-chip);
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: var(--bt-tag-height);
  padding: 0 var(--bt-space-300);
  background: var(--bt-bg-surface);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border);
  border-radius: var(--bt-radius-full);
  color: var(--bt-text);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-weight: var(--bt-font-weight-semibold);
  vertical-align: middle;
  transition:
    background-color var(--bt-duration-fast) var(--bt-ease-emphasized),
    color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-Tag--sizeLarge { --bt-tag-height: var(--bt-size-chip-lg); padding: 0 var(--bt-space-400); }
.bt-Tag--removable { padding-inline-end: var(--bt-space-050); }
.bt-Tag--disabled { background: var(--bt-fill-disabled); box-shadow: none; color: var(--bt-text-disabled); }

.bt-Tag__Label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-Tag__Count { display: inline-flex; flex: none; margin-inline-start: var(--bt-space-150); }

/* Clickable: the whole chip is the button; secondary text until hover or selection. */
.bt-Tag--clickable { padding: 0; color: var(--bt-text-secondary); }
.bt-Tag--clickable:hover:not(.bt-Tag--disabled) { color: var(--bt-text); background: var(--bt-bg-surface-secondary); }
.bt-Tag__Button {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: var(--bt-tag-height);
  margin: 0;
  padding: 0 var(--bt-space-300);
  border: 0;
  border-radius: var(--bt-radius-full);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.bt-Tag--sizeLarge .bt-Tag__Button { padding: 0 var(--bt-space-400); }
.bt-Tag--clickable.bt-Tag--removable .bt-Tag__Button { padding-inline-end: var(--bt-space-100); }
.bt-Tag__Button:focus { outline: none; }
.bt-Tag__Button:focus-visible { box-shadow: var(--bt-shadow-focus); }
.bt-Tag__Button:disabled { cursor: default; }
.bt-Tag--selected,
.bt-Tag--selected:hover:not(.bt-Tag--disabled) {
  background: var(--bt-fill-strong);
  box-shadow: none;
  color: var(--bt-text-on-strong);
}
.bt-Tag--selected .bt-CountBadge { background: transparent; color: inherit; box-shadow: inset 0 0 0 var(--bt-border-width-1) currentColor; }

.bt-Tag__Remove {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--bt-space-600);
  height: var(--bt-space-600);
  margin-inline-start: var(--bt-space-100);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--bt-radius-full);
  color: var(--bt-text-secondary);
  cursor: pointer;
}
.bt-Tag__Remove:hover { background: var(--bt-bg-surface-hover); color: var(--bt-text); }
.bt-Tag--selected .bt-Tag__Remove { color: inherit; }
.bt-Tag__Remove:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-Tag__Remove:disabled { background: transparent; color: var(--bt-text-disabled); cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .bt-Tag { transition: none; }
}
@media (forced-colors: active) {
  .bt-Tag { border: 1px solid CanvasText; }
  .bt-Tag--selected { border: 2px solid Highlight; }
  .bt-Tag__Button:focus-visible,
  .bt-Tag__Remove:focus-visible { outline: 2px solid Highlight; outline-offset: 1px; }
}

/* --- TagInput --- */
/* TagInput: tags above the input, inside TextField's box (its verticalContent). */
.bt-TagInput { min-width: 0; }
.bt-TagInput__Tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bt-space-100);
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bt-TagInput__Tag { display: inline-flex; min-width: 0; max-width: 100%; }

/* --- Text --- */
/* Text: tone, weight, alignment and wrapping. The variants (.bt-Text--<variant>) are the type scale in tokens.json
   (type.groups), written to shared/text-styles.css by scripts/build-components.mjs, which loads before this file. */
.bt-Text {
  margin: 0;
  color: var(--bt-text);
}

.bt-Text--toneBase { color: var(--bt-text); }
.bt-Text--toneInherit { color: inherit; }
.bt-Text--toneSubdued { color: var(--bt-text-secondary); }
.bt-Text--toneDisabled { color: var(--bt-text-disabled); }
.bt-Text--toneSuccess { color: var(--bt-text-success); }
.bt-Text--toneCritical { color: var(--bt-text-critical); }
.bt-Text--toneCaution { color: var(--bt-text-warning); }
.bt-Text--toneInfo { color: var(--bt-text-info); }
.bt-Text--toneBrand { color: var(--bt-text-brand); }
.bt-Text--toneAccent { color: var(--bt-text-accent); }
.bt-Text--toneTextInverse { color: var(--bt-text-inverse); }

/* fontWeight overrides the variant's weight (after the variants, same specificity). */
.bt-Text--regular { font-weight: var(--bt-font-weight-regular); }
.bt-Text--medium { font-weight: var(--bt-font-weight-medium); }
.bt-Text--semibold { font-weight: var(--bt-font-weight-semibold); }
.bt-Text--bold { font-weight: var(--bt-font-weight-bold); }

/* An alignment gives an inline element (span, strong) a block box, so it can align. */
.bt-Text--alignStart,
.bt-Text--alignCenter,
.bt-Text--alignEnd,
.bt-Text--alignJustify { display: block; }
.bt-Text--alignStart { text-align: start; }
.bt-Text--alignCenter { text-align: center; }
.bt-Text--alignEnd { text-align: end; }
.bt-Text--alignJustify { text-align: justify; }

.bt-Text--truncate {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bt-Text--breakWord { overflow-wrap: anywhere; word-break: break-word; }
.bt-Text--numeric { font-variant-numeric: tabular-nums lining-nums; }
/* The display face's tabular set makes punctuation as wide as a digit ("4 , 8"); these sizes stand alone and keep
   proportional figures, as the data-viz rules ask of hero values. */
.bt-Text--numeric:is(.bt-Text--display, .bt-Text--heading3xl, .bt-Text--heading2xl, .bt-Text--headingXl, .bt-Text--headingLg, .bt-Text--headingMd, .bt-Text--headingSm) {
  font-variant-numeric: lining-nums;
}
.bt-Text--lineThrough { text-decoration-line: line-through; }

/* --- TextField --- */
/* The field box. Rest: fill-secondary (the card colour in light, one step up in dark) with a border-strong line
   (3:1 or more on bg, bg-surface and the fill in both themes, so the box shows inside a Card); hover: border-hover; focus: a 2px border-focus line plus a soft bg-brand-subtle halo, for mouse and
   keyboard as on every input. Radius 14 (radius-350), 16 (radius-400) when multiline. */
.bt-TextField {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--bt-space-200);
  min-height: var(--bt-size-control-md);
  padding: 0 var(--bt-space-300);
  background: var(--bt-fill-secondary);
  border: var(--bt-border-width-1) solid var(--bt-border-strong);
  border-radius: var(--bt-radius-350);
  color: var(--bt-text);
  cursor: text;
  transition: border-color var(--bt-duration-fast) var(--bt-ease-emphasized), box-shadow var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-TextField:hover { border-color: var(--bt-border-hover); }
.bt-TextField:focus-within {
  border-color: var(--bt-border-focus);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-focus), 0 0 0 var(--bt-space-100) var(--bt-bg-brand-subtle);
}
.bt-TextField--slim { min-height: var(--bt-size-control-sm); padding: 0 var(--bt-space-200); border-radius: var(--bt-radius-250); }
/* Large: 48px (size-control-lg) for the storefront and checkout, 16px text at every width, so iOS never zooms. */
.bt-TextField--large { min-height: var(--bt-size-control-lg); padding: 0 var(--bt-space-400); gap: var(--bt-space-300); }
.bt-TextField--large.bt-TextField--multiline { padding-top: var(--bt-space-300); padding-bottom: var(--bt-space-300); }
/* Narrow: a number's width (a quantity or a weight in a table cell or a line item), whatever its container. */
.bt-TextField--narrow { flex: none; inline-size: var(--bt-space-2400); max-inline-size: 100%; }
/* Borderless: no box at rest (inside a popover or a card header); the focus ring and the error border stay. */
.bt-TextField--borderless,
.bt-TextField--borderless:hover,
.bt-TextField--borderless.bt-TextField--readOnly,
.bt-TextField--borderless.bt-TextField--disabled { background: transparent; border-color: transparent; }
.bt-TextField--borderless.bt-TextField--error { border-color: var(--bt-border-critical); }
.bt-TextField--borderless:focus-within { border-color: var(--bt-border-focus); }
.bt-TextField--multiline {
  align-items: flex-start;
  padding-top: var(--bt-space-300);
  padding-bottom: var(--bt-space-300);
  border-radius: var(--bt-radius-400);
}
/* Error: border-critical, kept under focus with a critical halo, so an invalid field still reads as invalid while typed in. */
.bt-TextField--error,
.bt-TextField--error:hover { border-color: var(--bt-border-critical); }
.bt-TextField--error:focus-within {
  border-color: var(--bt-border-critical);
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-critical), 0 0 0 var(--bt-space-100) var(--bt-bg-critical-subtle);
}
.bt-TextField--readOnly { background: var(--bt-bg-surface-secondary); }
.bt-TextField--disabled,
.bt-TextField--disabled:hover {
  background: var(--bt-fill-disabled);
  border-color: var(--bt-border-secondary);
  color: var(--bt-text-disabled);
  cursor: default;
}

.bt-TextField__Input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: var(--bt-space-200) 0;
  border: 0;
  outline: none; /* the box shows focus (:focus-within above) */
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
  resize: none;
  appearance: none;
}
.bt-TextField--slim .bt-TextField__Input { padding: var(--bt-space-150) 0; }
.bt-TextField--large .bt-TextField__Input,
.bt-TextField--large .bt-TextField__Prefix,
.bt-TextField--large .bt-TextField__Suffix,
.bt-TextField--large .bt-TextField__AutoSizeWrapper { font-size: var(--bt-font-size-400); line-height: var(--bt-font-line-height-600); }
.bt-TextField--large .bt-TextField__Input { padding: var(--bt-space-200) 0; }
.bt-TextField--large textarea.bt-TextField__Input { padding: 0; min-height: calc(var(--bt-size-control-lg) - 2 * var(--bt-space-300)); }
textarea.bt-TextField__Input { padding: 0; resize: vertical; min-height: calc(var(--bt-size-control-md) - 2 * var(--bt-space-200)); }
.bt-TextField__Input::placeholder { color: var(--bt-text-secondary); opacity: 1; }
.bt-TextField__Input:disabled { color: var(--bt-text-disabled); -webkit-text-fill-color: var(--bt-text-disabled); cursor: default; }
.bt-TextField__Input:disabled::placeholder { color: var(--bt-text-disabled); }
.bt-TextField--monospaced .bt-TextField__Input { font-family: var(--bt-font-mono); }
.bt-TextField--numeric .bt-TextField__Input { font-variant-numeric: tabular-nums; }
.bt-TextField--alignLeft .bt-TextField__Input { text-align: left; }
.bt-TextField--alignCenter .bt-TextField__Input { text-align: center; }
.bt-TextField--alignRight .bt-TextField__Input { text-align: right; }
/* Currency: no spin buttons (amounts are typed, not stepped). */
.bt-TextField--currency .bt-TextField__Input::-webkit-outer-spin-button,
.bt-TextField--currency .bt-TextField__Input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bt-TextField--currency .bt-TextField__Input { -moz-appearance: textfield; }
/* type="search": only our clear button shows (no engine cancel button, no WebKit search decoration). */
.bt-TextField__Input[type="search"]::-webkit-search-cancel-button,
.bt-TextField__Input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.bt-TextField__Prefix,
.bt-TextField__Suffix {
  display: inline-flex;
  flex: none;
  align-items: center;
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
  cursor: text;
  user-select: none;
}
.bt-TextField--multiline .bt-TextField__Prefix,
.bt-TextField--multiline .bt-TextField__Suffix { align-self: flex-start; }
.bt-TextField--disabled .bt-TextField__Prefix,
.bt-TextField--disabled .bt-TextField__Suffix { color: var(--bt-text-disabled); }

.bt-TextField__Spinner { display: inline-flex; flex: none; align-items: center; color: var(--bt-text-secondary); cursor: text; }
.bt-TextField--multiline .bt-TextField__Spinner { align-self: flex-start; }

.bt-TextField__CharacterCount {
  flex: none;
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  font-variant-numeric: tabular-nums;
}
.bt-TextField--multiline .bt-TextField__Spinner { display: inline-flex; flex: none; align-items: center; color: var(--bt-text-secondary); cursor: text; }
.bt-TextField--multiline .bt-TextField__Spinner { align-self: flex-start; }

.bt-TextField__CharacterCount { align-self: flex-end; }
.bt-TextField--large .bt-TextField__CharacterCount { font-size: var(--bt-font-size-350); line-height: var(--bt-font-line-height-500); }

/* autoSize: the wrapper is one grid cell holding the input and a hidden copy of its text; the copy sets the
   width (a percentage-width input adds nothing to it), so a suffix follows the value. */
.bt-TextField--autoSize .bt-TextField__Input { flex: none; }
.bt-TextField__AutoSizeWrapper {
  display: inline-grid;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  font-size: var(--bt-font-size-350); /* as the input */
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
}
.bt-TextField__AutoSizeWrapper > .bt-TextField__Input,
.bt-TextField__AutoSizeWrapper::after { grid-area: 1 / 1; }
.bt-TextField__AutoSizeWrapper::after {
  content: attr(data-auto-size) " ";
  height: 0;
  overflow: hidden;
  visibility: hidden;
  white-space: pre;
  font: inherit;
}
.bt-TextField--monospaced .bt-TextField__AutoSizeWrapper { font-family: var(--bt-font-mono); }

/* verticalContent: tags (or other content) stacked above the input inside the box. */
.bt-TextField--verticalContent { align-items: center; }
.bt-TextField__VerticalContent {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: var(--bt-space-100);
  min-width: 0;
  padding: var(--bt-space-200) 0;
  cursor: text;
}
.bt-TextField__VerticalContent > .bt-TextField__Input,
.bt-TextField__VerticalContent > .bt-TextField__AutoSizeWrapper > .bt-TextField__Input { padding: 0; }
.bt-TextField--large .bt-TextField__VerticalContent { padding: var(--bt-space-300) 0; }
.bt-TextField--verticalContent .bt-TextField__AutoSizeWrapper { align-self: flex-start; }

.bt-TextField__ClearButton {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--bt-size-icon-md);
  height: var(--bt-size-icon-md);
  margin: 0 calc(-1 * var(--bt-space-050));
  padding: 0;
  border: 0;
  border-radius: var(--bt-radius-full);
  background: transparent;
  color: var(--bt-text-secondary);
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-standard), color var(--bt-duration-fast) var(--bt-ease-standard);
}
.bt-TextField__ClearButton:hover { background: var(--bt-bg-surface-active); color: var(--bt-text); }
.bt-TextField__ClearButton:active { background: var(--bt-bg-surface-secondary); }
.bt-TextField__ClearButton:focus-visible { outline: none; box-shadow: var(--bt-shadow-focus); }
.bt-TextField--large .bt-TextField__ClearButton { width: var(--bt-size-icon-lg); height: var(--bt-size-icon-lg); }

.bt-TextField__Connected { display: flex; align-items: flex-start; gap: var(--bt-space-200); }
.bt-TextField__ConnectedPrimary { flex: 1 1 auto; min-width: 0; }
.bt-TextField__ConnectedItem { flex: none; }

/* Input group: a connected item whose children are Buttons joins the field. The item overlaps the field by one
   border width (one shared line, no gap), the touching corners are square and the outer ones keep the radius, and
   the buttons take the field's height. Other connected content (a swatch, a Select) keeps the gap. */
.bt-TextField__ConnectedItem:has(> .bt-Button) { display: flex; align-self: stretch; }
.bt-TextField__ConnectedItem:last-child:has(> .bt-Button) { margin-inline-start: calc(-1 * var(--bt-space-200) - var(--bt-border-width-1)); }
.bt-TextField__ConnectedItem:first-child:has(> .bt-Button) { margin-inline-end: calc(-1 * var(--bt-space-200) - var(--bt-border-width-1)); }
.bt-TextField__ConnectedItem > .bt-Button { border-radius: 0; --bt-btn-height: var(--bt-size-control-md); --bt-btn-pad: var(--bt-space-400); }
.bt-TextField__ConnectedItem > .bt-Button + .bt-Button { margin-inline-start: calc(-1 * var(--bt-border-width-1)); }
.bt-TextField__ConnectedItem:last-child > .bt-Button:last-child { border-start-end-radius: var(--bt-radius-350); border-end-end-radius: var(--bt-radius-350); }
.bt-TextField__ConnectedItem:first-child > .bt-Button:first-child { border-start-start-radius: var(--bt-radius-350); border-end-start-radius: var(--bt-radius-350); }
.bt-TextField__Connected:has(> .bt-TextField__ConnectedItem:last-child > .bt-Button) > .bt-TextField__ConnectedPrimary > .bt-TextField { border-start-end-radius: 0; border-end-end-radius: 0; }
.bt-TextField__Connected:has(> .bt-TextField__ConnectedItem:first-child > .bt-Button) > .bt-TextField__ConnectedPrimary > .bt-TextField { border-start-start-radius: 0; border-end-start-radius: 0; }
/* The buttons follow the field's size; a multiline field keeps them on its first row. */
.bt-TextField__Connected:has(> .bt-TextField__ConnectedPrimary > .bt-TextField--slim) > .bt-TextField__ConnectedItem > .bt-Button { --bt-btn-height: var(--bt-size-control-sm); --bt-btn-pad: var(--bt-space-300); }
.bt-TextField__Connected:has(> .bt-TextField__ConnectedPrimary > .bt-TextField--large) > .bt-TextField__ConnectedItem > .bt-Button { --bt-btn-height: var(--bt-size-control-lg); --bt-btn-pad: var(--bt-space-500); }
.bt-TextField__Connected:has(> .bt-TextField__ConnectedPrimary > .bt-TextField--multiline) > .bt-TextField__ConnectedItem:has(> .bt-Button) { align-self: flex-start; }
/* The hovered or invalid neighbour draws the shared line; a focus ring sits above both. */
.bt-TextField__ConnectedPrimary > .bt-TextField--error,
.bt-TextField__ConnectedItem > .bt-Button:hover { z-index: 1; }
.bt-TextField__Connected:has(> .bt-TextField__ConnectedItem > .bt-Button) > .bt-TextField__ConnectedPrimary > .bt-TextField:focus-within,
.bt-TextField__ConnectedItem > .bt-Button:focus-visible { z-index: 2; }

/* Phones: 16px (body-lg) so iOS Safari does not zoom into the field; 768px is breakpoint-md (no var() in media queries). */
@media (max-width: 767.98px) {
  .bt-TextField__Input,
  .bt-TextField__Prefix,
  .bt-TextField__Suffix,
  .bt-TextField__AutoSizeWrapper { font-size: var(--bt-font-size-400); line-height: var(--bt-font-line-height-600); }
  .bt-TextField__Input { padding: var(--bt-space-150) 0; }
  /* slim stays 32px (size-control-sm) with the 24px line. */
  .bt-TextField--slim .bt-TextField__Input { padding: var(--bt-space-100) 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bt-TextField,
  .bt-TextField__ClearButton { transition: none; }
}

@media (forced-colors: active) {
  .bt-TextField { border-color: CanvasText; }
  .bt-TextField:focus-within { outline: 2px solid Highlight; outline-offset: 1px; }
}

/* --- Thumbnail --- */
/* Thumbnail: a square image or icon tile, the template's inner tile: radius 14 at medium and large (10 small,
   8 extra small), the card colour behind an image, an inset border-secondary hairline that stays on top of it. */
.bt-Thumbnail {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* The 60px medium: no size token covers it. */
  width: 60px;
  height: 60px;
  border-radius: var(--bt-radius-350);
  background: var(--bt-bg-surface);
  vertical-align: middle;
}
/* The hairline is drawn over the image, so a white product shot still has an edge on the card. */
.bt-Thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 var(--bt-border-width-1) var(--bt-border-secondary);
  pointer-events: none;
}
.bt-Thumbnail--sizeExtraSmall { width: var(--bt-size-icon-lg); height: var(--bt-size-icon-lg); border-radius: var(--bt-radius-200); }
.bt-Thumbnail--sizeSmall { width: var(--bt-size-control-md); height: var(--bt-size-control-md); border-radius: var(--bt-radius-250); }
/* The 80px large: no size token covers it. */
.bt-Thumbnail--sizeLarge { width: 80px; height: 80px; }

.bt-Thumbnail--transparent { background: transparent; }

.bt-Thumbnail__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Icon tile: secondary text on the card's second tone; a tint puts it on a pastel tile with text-on-tile
   (4.5:1 or more on each tile, both themes). Tiles have no hairline. */
.bt-Thumbnail--icon { background: var(--bt-bg-surface-secondary); color: var(--bt-text-secondary); }
.bt-Thumbnail--icon.bt-Thumbnail--transparent { background: transparent; }
.bt-Thumbnail--tile1 { background: var(--bt-bg-tile-1); }
.bt-Thumbnail--tile2 { background: var(--bt-bg-tile-2); }
.bt-Thumbnail--tile3 { background: var(--bt-bg-tile-3); }
.bt-Thumbnail--tile4 { background: var(--bt-bg-tile-4); }
.bt-Thumbnail--tile5 { background: var(--bt-bg-tile-5); }
.bt-Thumbnail--tile6 { background: var(--bt-bg-tile-6); }
.bt-Thumbnail[class*='bt-Thumbnail--tile'] { color: var(--bt-text-on-tile); }
.bt-Thumbnail[class*='bt-Thumbnail--tile']::after { content: none; }

@media (forced-colors: active) {
  .bt-Thumbnail::after,
  .bt-Thumbnail[class*='bt-Thumbnail--tile']::after { content: ''; box-shadow: none; border: 1px solid CanvasText; }
}

/* The large tile's icon is 32px (space-800): the 24px icon size looks lost in 80px. */
.bt-Thumbnail--sizeLarge.bt-Thumbnail--icon .bt-Icon { width: var(--bt-space-800); height: var(--bt-space-800); }

/* --- Timeline --- */
/* Timeline: days over a rail of markers. The rail is a hairline behind the markers; a marker sits on the surface
   behind it (--bt-Timeline-surface), so the line appears to pass under it. Day headings are the template's
   section label (overline: 11px bold capitals in text-secondary). The feed variant drops the rail for rows with a
   tinted icon tile and the time at the end, divided by hairlines. */
.bt-Timeline {
  --bt-Timeline-surface: var(--bt-bg-surface);
  --bt-Timeline-marker: var(--bt-space-500);
  display: flex;
  flex-direction: column;
  gap: var(--bt-space-400);
  min-width: 0;
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
}

.bt-Timeline__days,
.bt-Timeline__events { margin: 0; padding: 0; list-style: none; }
.bt-Timeline__days { display: flex; flex-direction: column; gap: var(--bt-space-500); }
.bt-Timeline__day { display: flex; flex-direction: column; gap: var(--bt-space-300); min-width: 0; }

.bt-Timeline__heading { margin: 0; color: var(--bt-text-secondary); }

.bt-Timeline__event {
  position: relative;
  display: flex;
  gap: var(--bt-space-300);
  padding-block-end: var(--bt-space-400);
  --bt-Timeline-tone: var(--bt-text-secondary);
  --bt-Timeline-tint: var(--bt-bg-surface-secondary);
}
.bt-Timeline__event:last-child { padding-block-end: 0; }
.bt-Timeline__event--info { --bt-Timeline-tone: var(--bt-text-info); --bt-Timeline-tint: var(--bt-bg-info-subtle); }
.bt-Timeline__event--success { --bt-Timeline-tone: var(--bt-text-success); --bt-Timeline-tint: var(--bt-bg-success-subtle); }
.bt-Timeline__event--warning { --bt-Timeline-tone: var(--bt-text-warning); --bt-Timeline-tint: var(--bt-bg-warning-subtle); }
.bt-Timeline__event--critical { --bt-Timeline-tone: var(--bt-text-critical); --bt-Timeline-tint: var(--bt-bg-critical-subtle); }
/* A live event without a tone is the brand's: garnet. */
.bt-Timeline__event--brand {
  --bt-Timeline-tone: var(--bt-text-brand);
  --bt-Timeline-tint: var(--bt-bg-brand-subtle);
}

.bt-Timeline__event:not(:last-child)::before {
  content: '';
  position: absolute;
  inset-block: calc(var(--bt-Timeline-marker) + var(--bt-space-100)) var(--bt-space-100);
  inset-inline-start: calc(var(--bt-Timeline-marker) / 2 - 0.5px);
  border-inline-start: var(--bt-border-width-1) solid var(--bt-border);
}

.bt-Timeline__marker {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: var(--bt-Timeline-marker);
  block-size: var(--bt-Timeline-marker);
  border-radius: var(--bt-radius-full);
  background: var(--bt-Timeline-surface);
  color: var(--bt-Timeline-tone);
}
/* An icon marker is a small round tile in the tone's tint. */
.bt-Timeline__marker--icon { background: var(--bt-Timeline-tint); box-shadow: 0 0 0 var(--bt-border-width-2) var(--bt-Timeline-surface); }
/* The template's status dot: 9px. */
.bt-Timeline__dot {
  inline-size: calc(var(--bt-space-200) + var(--bt-space-025));
  block-size: calc(var(--bt-space-200) + var(--bt-space-025));
  border-radius: var(--bt-radius-full);
  background: currentColor;
}
/* Live: a soft halo breathes around the dot or the tile. */
.bt-Timeline__event--live .bt-Timeline__marker::after {
  content: '';
  position: absolute;
  inset: calc(var(--bt-space-100) * -1);
  border-radius: inherit;
  background: currentColor;
  opacity: 0.18;
  animation: bt-Timeline-breathe 2s var(--bt-ease-standard) infinite;
}
.bt-Timeline__event--live .bt-Timeline__marker:not(.bt-Timeline__marker--icon)::after { inset: var(--bt-space-050); }
@keyframes bt-Timeline-breathe {
  0%, 100% { opacity: 0.08; transform: scale(0.85); }
  50% { opacity: 0.28; transform: scale(1); }
}

.bt-Timeline__body { display: flex; flex-direction: column; gap: var(--bt-space-050); min-width: 0; flex: 1; }
.bt-Timeline__message {
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
  overflow-wrap: anywhere;
}
.bt-Timeline__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--bt-space-200);
  row-gap: var(--bt-space-050);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
}
.bt-Timeline__meta time,
.bt-Timeline__time time { font-variant-numeric: tabular-nums; }
.bt-Timeline__actor { font-weight: var(--bt-font-weight-semibold); color: var(--bt-text); }

.bt-Timeline__empty {
  margin: 0;
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-350);
  line-height: var(--bt-font-line-height-500);
}

/* ---- feed ---- */
.bt-Timeline--feed { --bt-Timeline-marker: var(--bt-space-800); }
.bt-Timeline--feed .bt-Timeline__days { gap: var(--bt-space-400); }
.bt-Timeline--feed .bt-Timeline__day { gap: 0; }
.bt-Timeline--feed .bt-Timeline__heading { padding-block-end: var(--bt-space-100); }
.bt-Timeline--feed .bt-Timeline__event {
  align-items: center;
  padding-block: calc(var(--bt-space-200) + var(--bt-space-050));
  border-block-end: var(--bt-border-width-1) solid var(--bt-border-secondary);
}
.bt-Timeline--feed .bt-Timeline__event:last-child { border-block-end: 0; padding-block-end: 0; }
.bt-Timeline--feed .bt-Timeline__event::before { content: none; }
/* The tile: 32px, radius 10, the tone's tint (neutral without a tone). */
.bt-Timeline--feed .bt-Timeline__marker,
.bt-Timeline--feed .bt-Timeline__marker--icon {
  border-radius: var(--bt-radius-250);
  background: var(--bt-Timeline-tint);
  box-shadow: none;
}
.bt-Timeline--feed .bt-Timeline__message { font-weight: var(--bt-font-weight-semibold); }
.bt-Timeline__time {
  flex: none;
  align-self: center;
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-312);
  line-height: var(--bt-font-line-height-450);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .bt-Timeline__event--live .bt-Timeline__marker::after { animation: none; opacity: 0.2; }
}
@media (forced-colors: active) {
  .bt-Timeline__marker { color: CanvasText; background: Canvas; }
  .bt-Timeline--feed .bt-Timeline__marker { border: 1px solid CanvasText; }
  .bt-Timeline__event:not(:last-child)::before { border-color: CanvasText; }
  .bt-Timeline__event--live .bt-Timeline__marker::after { animation: none; background: Highlight; }
}

/* --- Toast --- */
/* Toast: one shared bottom-centre region (440px wide at most); pill-shaped toasts on the inverse surface
   (bg-inverse + text-inverse; radius-650, so a toast that wraps to two lines keeps soft corners), errors on the
   critical fill (fill-critical + text-on-critical). The action is a pill with a faint wash of the text colour.
   Enter motion: duration-slow, ease-emphasized, rising and settling. */
.bt-ToastRegion {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--bt-space-600);
  z-index: var(--bt-z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--bt-space-400);
  pointer-events: none;
}
.bt-ToastRegion__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bt-space-200);
  width: 100%;
}
/* Empty lists stay in the page (never display:none) so screen readers keep them as live regions. */
.bt-ToastRegion__list:not(:empty) + .bt-ToastRegion__list:not(:empty) { margin-top: var(--bt-space-200); }

.bt-Toast {
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  /* Toast width cap: 440px (the template's; no token family covers widths). */
  width: min(100%, 440px);
  min-height: var(--bt-size-control-lg);
  padding: var(--bt-space-100) var(--bt-space-150) var(--bt-space-100) var(--bt-space-400);
  border-radius: var(--bt-radius-650);
  background: var(--bt-bg-inverse);
  color: var(--bt-text-inverse);
  box-shadow: var(--bt-shadow-soft-lg);
  pointer-events: auto;
  animation: bt-Toast-in var(--bt-duration-slow) var(--bt-ease-emphasized) both;
}
.bt-Toast--error { background: var(--bt-fill-critical); color: var(--bt-text-on-critical); }

.bt-Toast__icon { flex: none; display: inline-flex; }
.bt-Toast .bt-Toast__content {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--bt-space-150) 0;
  font: var(--bt-font-weight-semibold) var(--bt-font-size-337) / var(--bt-font-line-height-500) var(--bt-font-sans);
  overflow-wrap: anywhere;
}
.bt-Toast__action { flex: none; display: inline-flex; }
.bt-Toast__close { flex: none; display: inline-flex; }
/* monochromePlain buttons take the toast's text colour. The action: a slim pill on a 14% wash of it. */
.bt-Toast .bt-Toast__action .bt-Button {
  min-height: var(--bt-size-control-sm);
  padding: 0 var(--bt-space-400);
  border-radius: var(--bt-radius-full);
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-weight: var(--bt-font-weight-bold);
  text-decoration: none;
}
.bt-Toast .bt-Toast__action .bt-Button:hover { background: color-mix(in srgb, currentColor 22%, transparent); }
.bt-Toast .bt-Toast__action .bt-Button__label { text-decoration: none; }
.bt-Toast .bt-Toast__close .bt-Button {
  width: var(--bt-size-control-sm);
  height: var(--bt-size-control-sm);
  border-radius: var(--bt-radius-full);
}
.bt-Toast .bt-Toast__close .bt-Button:hover { background: color-mix(in srgb, currentColor 14%, transparent); }

@keyframes bt-Toast-in {
  from { opacity: 0; transform: translateY(var(--bt-space-400)) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-Toast-fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .bt-Toast { animation-name: bt-Toast-fade-in; }
}

@media (forced-colors: active) {
  .bt-Toast { border: 1px solid CanvasText; }
}

/* --- Tooltip --- */
/* Tooltip: the inverse surface (bg-inverse + text-inverse), radius-250, shadow-soft; 12.5px medium text.
   It reads in both themes: an ink bubble on the light theme, a light one on the dark theme.
   Motion: duration-base, ease-emphasized, a small move and scale. */
.bt-Tooltip__activator { display: inline-block; max-width: 100%; }
.bt-Tooltip__activator:focus { outline: none; }
.bt-Tooltip__activator:focus-visible { border-radius: var(--bt-radius-100); box-shadow: var(--bt-shadow-focus); }
.bt-Tooltip__activator--underline {
  text-decoration: underline dotted var(--bt-border-strong);
  text-decoration-thickness: var(--bt-border-width-2);
  text-underline-offset: 0.25em;
  cursor: help;
}

.bt-Tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--bt-z-tooltip);
  /* Tooltip widths have no token family: 200px default, 275px wide. */
  max-width: min(200px, calc(100vw - var(--bt-space-400)));
  padding: var(--bt-space-150) calc(var(--bt-space-200) + var(--bt-space-050));
  border-radius: var(--bt-radius-250);
  background: var(--bt-bg-inverse);
  color: var(--bt-text-inverse);
  box-shadow: var(--bt-shadow-soft);
  font: var(--bt-font-weight-medium) var(--bt-font-size-312) / var(--bt-font-line-height-450) var(--bt-font-sans);
  overflow-wrap: anywhere;
  animation: bt-Tooltip-in var(--bt-duration-base) var(--bt-ease-emphasized) both;
}
.bt-Tooltip[data-placement="below"] { animation-name: bt-Tooltip-in-below; }
.bt-Tooltip[data-placement="cover"] { animation-name: bt-Tooltip-fade-in; }
.bt-Tooltip--widthWide { max-width: min(275px, calc(100vw - var(--bt-space-400))); }
.bt-Tooltip--padding400 { padding: var(--bt-space-400); }
.bt-Tooltip--radius100 { border-radius: var(--bt-radius-100); }
.bt-Tooltip--radius200 { border-radius: var(--bt-radius-200); }
.bt-Tooltip--passThrough { pointer-events: none; }
.bt-Tooltip .bt-Tooltip__content { margin: 0; font: inherit; }

@keyframes bt-Tooltip-in {
  from { opacity: 0; transform: translateY(var(--bt-space-100)) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-Tooltip-in-below {
  from { opacity: 0; transform: translateY(calc(-1 * var(--bt-space-100))) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-Tooltip-fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .bt-Tooltip,
  .bt-Tooltip[data-placement="below"] { animation-name: bt-Tooltip-fade-in; }
}

/* --- TopBar --- */
/* TopBar: a transparent row of pills on the canvas, size-top-bar (52px) tall: the menu button (drawer only), the
   workspace switcher (or a context Badge), the search pill centred in the free room (max 30rem), then round icon buttons
   and the primary action. Pills and round buttons are bg-surface with a border-secondary hairline and
   shadow-soft; hover bg-surface-secondary. Narrow bars (container queries on the bar's own width) fold the
   search into a round button, the primary action to its icon and the switcher to its initials. */
.bt-TopBar {
  container: bt-topbar / inline-size;
  font-family: var(--bt-font-sans);
  color: var(--bt-text);
}
/* The row lives inside the container, since a container can't query its own size. */
.bt-TopBar__row {
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  min-block-size: var(--bt-size-top-bar);
}

/* A pill or round control on the canvas: card colour, hairline, soft shadow. */
.bt-TopBar__searchButton,
.bt-TopBar__workspace {
  border: 0;
  background: var(--bt-bg-surface);
  box-shadow: inset 0 0 0 1px var(--bt-border-secondary), var(--bt-shadow-soft);
  color: var(--bt-text);
  font: inherit;
  cursor: pointer;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-standard), box-shadow var(--bt-duration-fast) var(--bt-ease-standard);
}
.bt-TopBar__workspace:hover { background: var(--bt-bg-surface-secondary); }
.bt-TopBar__workspace:active { background: var(--bt-bg-surface-active); }
.bt-TopBar__searchButton:focus-visible,
.bt-TopBar__workspace:focus-visible {
  outline: none;
  box-shadow: var(--bt-shadow-focus), var(--bt-shadow-soft);
}

/* Round icon buttons (TopBar.IconButton) and the primary pill are Buttons, at the bar's height (size-top-bar). */
.bt-TopBar__row .bt-Button { --bt-btn-height: var(--bt-size-top-bar); }

.bt-TopBar__navigationToggle { display: inline-flex; flex: none; }
.bt-TopBar__contextControl { display: flex; align-items: center; min-inline-size: 0; flex: 0 1 auto; }

/* ---- the workspace switcher ---- */
.bt-TopBar__workspace {
  display: inline-flex;
  align-items: center;
  gap: var(--bt-space-300);
  min-inline-size: 0;
  max-inline-size: 18rem;
  block-size: var(--bt-size-top-bar);
  padding: 0 var(--bt-space-400) 0 6px;
  border-radius: var(--bt-radius-full);
  text-align: start;
}
/* The store's mark: an Avatar on its bg-tile colour, 40px (32px on a phone). */
.bt-TopBar__workspaceMark { display: inline-flex; flex: none; }
.bt-TopBar__workspaceMark .bt-Avatar { --bt-avatar-size: 40px; font-size: var(--bt-font-size-300); }

/* The name and the detail line, shared with the rail's account button (Frame.UserMenu). */
.bt-MenuButton__text {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  line-height: 1.2;
}
.bt-MenuButton__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--bt-font-size-350);
  font-weight: var(--bt-font-weight-semibold);
}
.bt-MenuButton__detail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-275);
  font-weight: var(--bt-font-weight-semibold);
}
.bt-MenuButton__detail > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.bt-MenuButton__chevron { display: inline-flex; flex: none; color: var(--bt-text-secondary); }

.bt-TopBar__status {
  flex: none;
  inline-size: 7px;
  block-size: 7px;
  border-radius: var(--bt-radius-full);
  background: var(--bt-text-secondary);
}
.bt-TopBar__status--success { background: var(--bt-fill-success); }
.bt-TopBar__status--warning { background: var(--bt-fill-caution); }
.bt-TopBar__status--critical { background: var(--bt-fill-critical); }

/* ---- the search pill (a trigger, not a field) ---- */
.bt-TopBar__search {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-inline-size: 0;
}
.bt-TopBar__searchButton {
  display: flex;
  align-items: center;
  gap: var(--bt-space-300);
  inline-size: 100%;
  max-inline-size: 30rem;
  block-size: var(--bt-size-top-bar);
  padding: 0 10px 0 18px;
  border-radius: var(--bt-radius-full);
  color: var(--bt-text-secondary);
  font-size: var(--bt-font-size-350);
  font-weight: var(--bt-font-weight-medium);
  text-align: start;
}
.bt-TopBar__searchButton:hover { box-shadow: inset 0 0 0 1px var(--bt-border), var(--bt-shadow-soft); }
.bt-TopBar__searchIcon { display: inline-flex; flex: none; color: var(--bt-text-secondary); }
.bt-TopBar__searchText {
  flex: 1 1 auto;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The ⌘K hint: a Kbd cap. */
.bt-TopBar__kbd { display: inline-flex; flex: none; }

/* Without a search the tools go to the end. */
.bt-TopBar__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}
.bt-TopBar__search + .bt-TopBar__tools { margin-inline-start: 0; }
.bt-TopBar__actions { display: flex; align-items: center; gap: 10px; }
.bt-TopBar__primary { display: inline-flex; }

/* ---- narrower bars ---- */
@container bt-topbar (max-width: 59.99rem) {
  .bt-TopBar__searchButton { max-inline-size: 22.5rem; }
}
/* No room for the pill: the search is a round button, the primary action its icon (the label still names it). */
@container bt-topbar (max-width: 45.99rem) {
  .bt-TopBar__search { flex: 0 0 auto; margin-inline-start: auto; }
  .bt-TopBar__searchButton {
    inline-size: var(--bt-size-top-bar);
    padding: 0;
    justify-content: center;
    color: var(--bt-text);
  }
  .bt-TopBar__searchIcon { color: var(--bt-text); }
  .bt-TopBar__searchText {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .bt-TopBar__kbd { display: none; }
  .bt-TopBar__primary .bt-Button {
    inline-size: var(--bt-btn-height);
    padding-inline: 0;
    justify-content: center;
  }
  .bt-TopBar__primary .bt-Button__label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
/* A phone: 40px controls, the switcher shows only its initials. */
@container bt-topbar (max-width: 35.99rem) {
  .bt-TopBar__row,
  .bt-TopBar__tools,
  .bt-TopBar__actions { gap: var(--bt-space-150); }
  .bt-TopBar__row { min-block-size: 40px; }
  .bt-TopBar__row .bt-Button { --bt-btn-height: 40px; }
  .bt-TopBar__searchButton { inline-size: 40px; block-size: 40px; }
  .bt-TopBar__workspace { block-size: 40px; padding: 0 var(--bt-space-200) 0 4px; gap: var(--bt-space-100); }
  .bt-TopBar__workspaceMark .bt-Avatar { --bt-avatar-size: 32px; }
  .bt-TopBar__workspaceText {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bt-TopBar__searchButton,
  .bt-TopBar__workspace { transition: none; }
}

/* --- TreeList --- */
/* Rows that open and close. Each level indents its row, not its group, so a row's background runs the full width.
   Rows are size-tree-row (36px) tiles (radius 10) in 13.5px medium type; hover is the card's second tone; the selected row is
   garnet: text-brand on bg-brand-subtle (a checked pair, both themes), semibold. */
.bt-TreeList,
.bt-TreeList__Group {
  margin: 0;
  padding: 0;
  list-style: none;
  min-inline-size: 0;
}
.bt-TreeList {
  color: var(--bt-text);
  font-family: var(--bt-font-sans);
  font-size: var(--bt-font-size-337);
  line-height: var(--bt-font-line-height-500);
  font-weight: var(--bt-font-weight-medium);
}
.bt-TreeList__Group { display: flex; flex-direction: column; gap: var(--bt-space-025); }
.bt-TreeList { display: flex; flex-direction: column; gap: var(--bt-space-025); }
.bt-TreeList__Row {
  display: flex;
  align-items: center;
  gap: var(--bt-space-200);
  min-block-size: var(--bt-size-tree-row);
  padding-block: var(--bt-space-050);
  padding-inline: calc(var(--bt-TreeList-level, 0) * var(--bt-space-500) + var(--bt-space-200)) var(--bt-space-200);
  box-sizing: border-box;
  border-radius: var(--bt-radius-250);
  cursor: pointer;
  outline: none;
  transition: background-color var(--bt-duration-fast) var(--bt-ease-emphasized), color var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-TreeList__Row:hover { background: var(--bt-bg-surface-secondary); }
.bt-TreeList__Row:focus-visible { box-shadow: var(--bt-shadow-focus); position: relative; z-index: 1; }
.bt-TreeList__Row--selected,
.bt-TreeList__Row--selected:hover { background: var(--bt-bg-brand-subtle); color: var(--bt-text-brand); }
.bt-TreeList__Row--selected > .bt-TreeList__Label { font-weight: var(--bt-font-weight-semibold); }
.bt-TreeList__Row--selected > .bt-TreeList__Icon,
.bt-TreeList__Row--selected > .bt-TreeList__Toggle { color: var(--bt-text-brand); }
.bt-TreeList__Row--disabled { cursor: default; }
.bt-TreeList__Row--disabled > .bt-TreeList__Label,
.bt-TreeList__Row--disabled > .bt-TreeList__Icon { color: var(--bt-text-disabled); }
.bt-TreeList__Row--disabled:hover { background: none; }
@media (pointer: coarse) {
  .bt-TreeList__Row { min-block-size: var(--bt-size-control-md); }
}
@media (forced-colors: active) {
  .bt-TreeList__Row:focus-visible { outline: 2px solid Highlight; outline-offset: -2px; }
  .bt-TreeList__Row--selected { outline: 1px solid Highlight; outline-offset: -1px; }
}

.bt-TreeList__Toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 16px;
  block-size: 16px;
  color: var(--bt-text-secondary);
  transition: transform var(--bt-duration-fast) var(--bt-ease-emphasized);
}
.bt-TreeList__Toggle:dir(rtl) { transform: scaleX(-1); }
.bt-TreeList__Toggle--open,
.bt-TreeList__Toggle--open:dir(rtl) { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  .bt-TreeList__Row,
  .bt-TreeList__Toggle { transition: none; }
}
.bt-TreeList__Icon { flex: none; display: inline-flex; color: var(--bt-text-secondary); }
.bt-TreeList__Label { flex: 1; min-inline-size: 0; overflow-wrap: anywhere; }
.bt-TreeList__Badge { flex: none; display: inline-flex; align-items: center; }
.bt-TreeList__Actions { flex: none; display: inline-flex; align-items: center; gap: var(--bt-space-050); cursor: default; }
