/* Generated by scripts/build-css.mjs. Do not edit. */

@layer ff.base, ff.components;

/* Generated by scripts/build-tokens.mjs from tokens/*.json. Do not edit. */

:root {
  --brand-teiggrau: #F2EBE3;
  --brand-minzblau: #B4E1D7;
  --brand-lachsrot: #ED8578;
  --brand-meeresblau: #1E4150;
  --brand-seegruen: #326973;
  --bg-page: #EEF2F3;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F7F9F9;
  --bg-hover: #F1F4F5;
  --bg-pressed: #E4EAEC;
  --bg-selected: #E9F4F4;
  --bg-selected-hover: #D2E8E8;
  --bg-inverse: #1E4150;
  --bg-error-subtle: #FDF3F1;
  --text-primary: #0F2A35;
  --text-heading: #1E4150;
  --text-secondary: #526B77;
  --text-muted: #4A6975;
  --text-link: #246F74;
  --text-disabled: #8A9EA6;
  --text-disabled-2: #A3B3BA;
  --text-on-action: #FFFFFF;
  --text-on-inverse: #FFFFFF;
  --border-default: #E1E7E9;
  --border-row: #CDD6D9;
  --border-control: #7B9199;
  --border-strong: #627880;
  --border-selected: #7FB8BB;
  --border-inverse: var(--bg-inverse);
  --action-primary: #2B7F84;
  --action-primary-hover: #236A6E;
  --action-primary-pressed: #1C5659;
  --status-success-bg: #E4F1F1;
  --status-success-fg: #1F6468;
  --status-info-bg: #E3EEF6;
  --status-info-fg: #1D4E6E;
  --status-warning-bg: #FBF0DC;
  --status-warning-fg: #7A4E0B;
  --status-warning-text: #5E3C08;
  --status-warning-border: #F0D8A8;
  --status-warning-control: #E2C285;
  --status-error-bg: #FCEBE8;
  --status-error-bg-strong: #F8D9D3;
  --status-error-fg: #A33524;
  --status-error-border: #F1C4BC;
  --status-error-focus: #C2503C;
  --focus-ring: var(--action-primary);
  --focus-on-inverse: #B4E1D7;
  --chip-border-soft: #B9DCDC;
  --chip-fg-strong: #174F52;
  --chip-hover: #F1F8F8;
  --chip-pressed: #D2E8E8;
  --nav-gradient-start: #1F4553;
  --nav-gradient-end: #16303B;
  --nav-fg: rgba(242,235,227,0.86);
  --nav-fg-subtle: rgba(242,235,227,0.72);
  --nav-fg-active: #FFFFFF;
  --nav-item-hover: rgba(255,255,255,0.06);
  --nav-item-selected: rgba(255,255,255,0.14);
  --nav-border: rgba(255,255,255,0.1);
  --chart-umsatz: #2F5B64;
  --chart-abschriften: #C4604C;
  --chart-abschriftquote: #B7791F;
  --chart-vergleich-umsatz: #8FB3B7;
  --chart-vergleich-abschriften: #EDB9AD;
  --chart-series-1: var(--chart-umsatz);
  --chart-series-2: var(--chart-abschriften);
  --chart-series-3: var(--chart-abschriftquote);
  --chart-series-4: #4F7F3A;
  --chart-series-5: #7A5A9A;
  --chart-series-6: #2F7FA8;
  --chart-other: #8A9EA6;
  --scrim-modal: rgba(15,42,53,0.65);
  --scrim-drawer: rgba(15,42,53,0.3);
  --font-sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --fs-kpi: 32px;
  --fs-page-title: 24px;
  --fs-section: 18px;
  --fs-card-title: 16px;
  --fs-body: 14px;
  --fs-control: 13px;
  --fs-caption: 12px;
  --fs-micro: 11px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-pill: 999px;
  --h-button-m: 40px;
  --h-button-s: 32px;
  --h-chip: 36px;
  --h-input: 40px;
  --h-pill: 24px;
  --h-menu-item: 36px;
  --h-table-row: 49px;
  --size-icon-button: 32px;
  --size-icon: 16px;
  --size-icon-md: 20px;
  --size-icon-lg: 24px;
  --size-icon-xl: 32px;
  --shadow-popover: 0 14px 40px rgba(15,42,53,0.12), 0 4px 10px rgba(15,42,53,0.05);
  --shadow-modal: 0 24px 64px rgba(15,42,53,0.28);
  --shadow-input-inset: inset 0 1px 2px rgba(15,42,53,0.08);
  --shadow-sticky: 0 8px 16px -12px rgba(15,42,53,0.35);
  --z-sticky: 100;
  --z-dropdown: 200;
  --z-popover: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"], .theme-dark {
  color-scheme: dark;
  --brand-teiggrau: #F2EBE3;
  --brand-minzblau: #B4E1D7;
  --brand-lachsrot: #ED8578;
  --brand-meeresblau: #1E4150;
  --brand-seegruen: #326973;
  --bg-page: #0E1F26;
  --bg-surface: #15282F;
  --bg-subtle: #1A2F37;
  --bg-hover: #213740;
  --bg-pressed: #2A414A;
  --bg-selected: #1D3B3E;
  --bg-selected-hover: #24474A;
  --bg-inverse: #0A171C;
  --bg-error-subtle: #2E1B19;
  --text-primary: #E8EEF0;
  --text-heading: #F2F6F7;
  --text-secondary: #A3B5BC;
  --text-muted: #B3C3C9;
  --text-link: #6CC0C2;
  --text-disabled: #5E737B;
  --text-disabled-2: #556A72;
  --text-on-action: #0E1F26;
  --text-on-inverse: #FFFFFF;
  --border-default: #2A3F47;
  --border-row: #2F444C;
  --border-control: #647A82;
  --border-strong: #7A929B;
  --border-selected: #3E7C80;
  --border-inverse: var(--border-control);
  --action-primary: #3FA3A8;
  --action-primary-hover: #52B3B8;
  --action-primary-pressed: #64BFC4;
  --status-success-bg: #163A3B;
  --status-success-fg: #8FD3CF;
  --status-info-bg: #16314A;
  --status-info-fg: #9CC4E6;
  --status-warning-bg: #3B2C10;
  --status-warning-fg: #F2C878;
  --status-warning-text: #F2C878;
  --status-warning-border: #5C4518;
  --status-warning-control: #6B5220;
  --status-error-bg: #4A1F1A;
  --status-error-bg-strong: #5A2620;
  --status-error-fg: #FFB4A8;
  --status-error-border: #6E2E25;
  --status-error-focus: #FF8F7F;
  --focus-ring: var(--action-primary);
  --focus-on-inverse: #B4E1D7;
  --chip-border-soft: #2D5B5E;
  --chip-fg-strong: #A6DCD8;
  --chip-hover: #1F3A3C;
  --chip-pressed: #24474A;
  --nav-gradient-start: #1F4553;
  --nav-gradient-end: #16303B;
  --nav-fg: rgba(242,235,227,0.86);
  --nav-fg-subtle: rgba(242,235,227,0.72);
  --nav-fg-active: #FFFFFF;
  --nav-item-hover: rgba(255,255,255,0.06);
  --nav-item-selected: rgba(255,255,255,0.14);
  --nav-border: rgba(255,255,255,0.1);
  --chart-umsatz: #6FA7B0;
  --chart-abschriften: #E8A090;
  --chart-abschriftquote: #F2C878;
  --chart-vergleich-umsatz: #4F7A80;
  --chart-vergleich-abschriften: #7A4A40;
  --chart-series-1: var(--chart-umsatz);
  --chart-series-2: var(--chart-abschriften);
  --chart-series-3: var(--chart-abschriftquote);
  --chart-series-4: #A3C98A;
  --chart-series-5: #C2A8E0;
  --chart-series-6: #86C4E6;
  --chart-other: #5E737B;
  --scrim-modal: rgba(0,0,0,0.72);
  --scrim-drawer: rgba(0,0,0,0.4);
  --shadow-popover: 0 14px 40px rgba(0,0,0,0.45), 0 4px 10px rgba(0,0,0,0.3);
  --shadow-modal: 0 24px 64px rgba(0,0,0,0.6);
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    color-scheme: dark;
    --brand-teiggrau: #F2EBE3;
    --brand-minzblau: #B4E1D7;
    --brand-lachsrot: #ED8578;
    --brand-meeresblau: #1E4150;
    --brand-seegruen: #326973;
    --bg-page: #0E1F26;
    --bg-surface: #15282F;
    --bg-subtle: #1A2F37;
    --bg-hover: #213740;
    --bg-pressed: #2A414A;
    --bg-selected: #1D3B3E;
    --bg-selected-hover: #24474A;
    --bg-inverse: #0A171C;
    --bg-error-subtle: #2E1B19;
    --text-primary: #E8EEF0;
    --text-heading: #F2F6F7;
    --text-secondary: #A3B5BC;
    --text-muted: #B3C3C9;
    --text-link: #6CC0C2;
    --text-disabled: #5E737B;
    --text-disabled-2: #556A72;
    --text-on-action: #0E1F26;
    --text-on-inverse: #FFFFFF;
    --border-default: #2A3F47;
    --border-row: #2F444C;
    --border-control: #647A82;
    --border-strong: #7A929B;
    --border-selected: #3E7C80;
    --border-inverse: var(--border-control);
    --action-primary: #3FA3A8;
    --action-primary-hover: #52B3B8;
    --action-primary-pressed: #64BFC4;
    --status-success-bg: #163A3B;
    --status-success-fg: #8FD3CF;
    --status-info-bg: #16314A;
    --status-info-fg: #9CC4E6;
    --status-warning-bg: #3B2C10;
    --status-warning-fg: #F2C878;
    --status-warning-text: #F2C878;
    --status-warning-border: #5C4518;
    --status-warning-control: #6B5220;
    --status-error-bg: #4A1F1A;
    --status-error-bg-strong: #5A2620;
    --status-error-fg: #FFB4A8;
    --status-error-border: #6E2E25;
    --status-error-focus: #FF8F7F;
    --focus-ring: var(--action-primary);
    --focus-on-inverse: #B4E1D7;
    --chip-border-soft: #2D5B5E;
    --chip-fg-strong: #A6DCD8;
    --chip-hover: #1F3A3C;
    --chip-pressed: #24474A;
    --nav-gradient-start: #1F4553;
    --nav-gradient-end: #16303B;
    --nav-fg: rgba(242,235,227,0.86);
    --nav-fg-subtle: rgba(242,235,227,0.72);
    --nav-fg-active: #FFFFFF;
    --nav-item-hover: rgba(255,255,255,0.06);
    --nav-item-selected: rgba(255,255,255,0.14);
    --nav-border: rgba(255,255,255,0.1);
    --chart-umsatz: #6FA7B0;
    --chart-abschriften: #E8A090;
    --chart-abschriftquote: #F2C878;
    --chart-vergleich-umsatz: #4F7A80;
    --chart-vergleich-abschriften: #7A4A40;
    --chart-series-1: var(--chart-umsatz);
    --chart-series-2: var(--chart-abschriften);
    --chart-series-3: var(--chart-abschriftquote);
    --chart-series-4: #A3C98A;
    --chart-series-5: #C2A8E0;
    --chart-series-6: #86C4E6;
    --chart-other: #5E737B;
    --scrim-modal: rgba(0,0,0,0.72);
    --scrim-drawer: rgba(0,0,0,0.4);
    --shadow-popover: 0 14px 40px rgba(0,0,0,0.45), 0 4px 10px rgba(0,0,0,0.3);
    --shadow-modal: 0 24px 64px rgba(0,0,0,0.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
  }
}

@layer ff.base {
/* src/foundations/base.css */
/* Zero-specificity defaults so that consuming projects can override them without effort. */
:where(body) {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:where(a) {
  color: var(--text-link);
}

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

.ff-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ff-num {
  font-variant-numeric: tabular-nums;
}

.ff-empty-value {
  color: var(--text-disabled);
}

/* src/foundations/icons.css */
/* Stroke icons from src/icons/, drawn on a 24 × 24 grid. Color always comes from currentColor. */
.ff-icon {
  width: var(--size-icon);
  height: var(--size-icon);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ff-icon--md {
  width: var(--size-icon-md);
  height: var(--size-icon-md);
}

.ff-icon--lg {
  width: var(--size-icon-lg);
  height: var(--size-icon-lg);
}

.ff-icon--xl {
  width: var(--size-icon-xl);
  height: var(--size-icon-xl);
}

/* src/foundations/typography.css */
.ff-page-title {
  margin: 0;
  font-size: var(--fs-page-title);
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-heading);
}

.ff-section-title {
  margin: 0;
  font-size: var(--fs-section);
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-heading);
}

.ff-card-title {
  margin: 0;
  font-size: var(--fs-card-title);
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
}

.ff-text-secondary {
  color: var(--text-secondary);
}

.ff-caption {
  font-size: var(--fs-caption);
  line-height: 1.4;
  color: var(--text-secondary);
}

.ff-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
}

@layer ff.components {
/* src/components/accordion/accordion.css */
.ff-accordion__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 52px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  box-sizing: border-box;
}

.ff-accordion__head::-webkit-details-marker {
  display: none;
}

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

.ff-accordion__title {
  font: 500 var(--fs-body)/1.5 var(--font-sans);
  color: var(--text-heading);
}

.ff-accordion__head:hover .ff-accordion__title {
  text-decoration: underline;
}

.ff-accordion__meta {
  font: 400 var(--fs-caption)/1.4 var(--font-sans);
  color: var(--text-secondary);
}

.ff-accordion__chevron {
  display: flex;
  flex: none;
  margin-left: auto;
  color: var(--text-secondary);
  transition: transform var(--dur-fast) var(--ease-out);
}

.ff-accordion[open] > .ff-accordion__head .ff-accordion__chevron {
  transform: rotate(180deg);
}

.ff-accordion__body {
  padding-bottom: var(--sp-4);
}

.ff-card > .ff-accordion > .ff-accordion__head,
.ff-card > .ff-accordion > .ff-accordion__body {
  padding-inline: var(--sp-4);
}

.ff-card > .ff-accordion > .ff-accordion__head:focus-visible {
  outline-offset: -2px;
}

.ff-accordion + .ff-accordion {
  border-top: 1px solid var(--border-default);
}

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

/* src/components/attribute-list/attribute-list.css */
/* The list adapts to its own width (container query), so it fits a modal header as well as a full page. */
.ff-attribute-list {
  container: ff-attribute-list / inline-size;
  display: grid;
  row-gap: var(--sp-1);
  margin: 0;
}

.ff-attribute-list__label {
  font: 500 var(--fs-caption)/1.4 var(--font-sans);
  color: var(--text-secondary);
}

.ff-attribute-list__value {
  margin: 0;
  font: 400 var(--fs-caption)/1.4 var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

@container ff-attribute-list (width >= 400px) {
  .ff-attribute-list__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: var(--sp-4);
  }

  .ff-attribute-list__value {
    text-align: right;
  }
}

.ff-attribute-list--stacked {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-3) var(--sp-6);
}

.ff-attribute-list--stacked .ff-attribute-list__item {
  display: block;
}

.ff-attribute-list--stacked .ff-attribute-list__label {
  line-height: 24px;
}

.ff-attribute-list--stacked .ff-attribute-list__value {
  font-size: var(--fs-body);
  line-height: 1.5;
  text-align: left;
}

/* src/components/avatar/avatar.css */
.ff-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--action-primary);
  color: var(--text-on-action);
  font: 600 var(--fs-caption)/1 var(--font-sans);
  box-sizing: border-box;
}

/* src/components/bar/bar.css */
.ff-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--bg-pressed);
}

.ff-bar--sm {
  height: 6px;
}

.ff-bar__fill {
  height: 100%;
  background: var(--ff-bar-color, var(--border-strong));
  box-sizing: border-box;
  transition: width var(--dur-base) var(--ease-out);
}

.ff-bar__fill:only-child {
  border-radius: var(--radius-pill);
}

.ff-bar__fill + .ff-bar__fill {
  border-left: 2px solid var(--bg-surface);
}

.ff-bar__fill--success {
  --ff-bar-color: var(--status-success-fg);
}

.ff-bar__fill--warning {
  --ff-bar-color: var(--status-warning-fg);
}

.ff-bar__fill--error {
  --ff-bar-color: var(--status-error-fg);
}

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

/* src/components/batch-bar/batch-bar.css */
/* Floating bar inside .ff-table, between the scroll area and the footer. It takes its own space in
   the flow, so the last row stays reachable, and sticks to the bottom of the window while the table
   is taller than the window. <ff-table> toggles [hidden] and writes the count. */
.ff-batch-bar {
  position: sticky;
  bottom: var(--sp-3);
  z-index: var(--z-sticky);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-inverse);
  border-radius: var(--radius-xl);
  background: var(--bg-inverse);
  box-shadow: var(--shadow-popover);
  color: var(--text-on-inverse);
  font-size: var(--fs-control);
  animation: ff-batch-bar-in var(--dur-fast) var(--ease-out);
}

/* The bar's own display would otherwise override the hidden attribute. */
.ff-batch-bar[hidden] {
  display: none;
}

.ff-batch-bar__count {
  font-variant-numeric: tabular-nums;
}

.ff-batch-bar__all {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--focus-on-inverse);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ff-batch-bar__all[hidden] {
  display: none;
}

.ff-batch-bar__all:focus-visible {
  outline: 2px solid var(--focus-on-inverse);
  outline-offset: 2px;
}

.ff-batch-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-inline-start: auto;
}

@container ff-table (width < 560px) {
  .ff-batch-bar__actions {
    flex-basis: 100%;
    margin-inline-start: 0;
  }
}

@keyframes ff-batch-bar-in {
  from {
    opacity: 0;
  }
}

@media (forced-colors: active) {
  .ff-batch-bar {
    border-color: CanvasText;
  }
}

/* src/components/button/button.css */
.ff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--h-button-m);
  padding: 0 var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-heading);
  font: 500 var(--fs-body)/1 var(--font-sans);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

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

.ff-btn--primary {
  background: var(--action-primary);
  color: var(--text-on-action);
}

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

.ff-btn--primary:is(:active, [aria-expanded="true"]) {
  background: var(--action-primary-pressed);
}

.ff-btn--secondary {
  border-color: var(--border-control);
}

.ff-btn--secondary:hover {
  background: var(--bg-hover);
}

.ff-btn--secondary:is(:active, [aria-expanded="true"]) {
  background: var(--bg-pressed);
}

.ff-btn--ghost {
  background: transparent;
  color: var(--text-link);
}

.ff-btn--ghost:hover {
  background: var(--bg-hover);
}

.ff-btn--ghost:is(:active, [aria-expanded="true"]) {
  background: var(--bg-pressed);
}

.ff-btn--danger {
  color: var(--status-error-fg);
  border-color: var(--status-error-border);
}

.ff-btn--danger:hover {
  background: var(--status-error-bg);
}

.ff-btn--danger:is(:active, [aria-expanded="true"]) {
  background: var(--status-error-bg-strong);
}

.ff-btn--danger-solid {
  background: var(--status-error-fg);
  color: var(--text-on-inverse);
}

.ff-btn--danger-solid:hover,
.ff-btn--danger-solid:is(:active, [aria-expanded="true"]) {
  background: var(--status-error-focus);
}

.ff-btn--danger:focus-visible,
.ff-btn--danger-solid:focus-visible {
  outline-color: var(--status-error-focus);
}

.ff-btn--sm {
  height: var(--h-button-s);
  padding: 0 var(--sp-3);
  font-size: var(--fs-control);
}

.ff-btn--icon {
  width: var(--h-button-m);
  padding: 0;
  border-color: var(--border-control);
  color: var(--text-muted);
}

.ff-btn--icon.ff-btn--sm {
  width: var(--size-icon-button);
}

.ff-btn--icon:hover {
  background: var(--bg-hover);
}

.ff-btn--icon:is(:active, [aria-expanded="true"]) {
  background: var(--bg-pressed);
}

.ff-btn--icon.ff-btn--ghost {
  border-color: transparent;
  color: var(--text-secondary);
}

.ff-btn--on-inverse {
  background: transparent;
  border-color: color-mix(in srgb, var(--text-on-inverse) 30%, transparent);
  color: var(--text-on-inverse);
}

.ff-btn--on-inverse:hover {
  background: color-mix(in srgb, var(--text-on-inverse) 10%, transparent);
}

.ff-btn--on-inverse:is(:active, [aria-expanded="true"]) {
  background: color-mix(in srgb, var(--text-on-inverse) 18%, transparent);
}

.ff-btn--on-inverse:focus-visible {
  outline-color: var(--focus-on-inverse);
}

.ff-btn:disabled,
.ff-btn[aria-disabled="true"] {
  background: var(--bg-pressed);
  border-color: transparent;
  color: var(--text-disabled);
  cursor: not-allowed;
}

.ff-btn--ghost:disabled,
.ff-btn--ghost[aria-disabled="true"] {
  background: transparent;
  color: var(--text-disabled-2);
}

/* src/components/card/card.css */
.ff-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.ff-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-default);
}

.ff-card__subtitle {
  margin: 2px 0 0;
  font: 400 var(--fs-control)/1.4 var(--font-sans);
  color: var(--text-secondary);
}

.ff-card__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

.ff-card__body {
  padding: var(--sp-2) var(--sp-4);
}

.ff-card__body:only-child {
  padding: var(--sp-6);
}

/* src/components/chart/chart.css */
/* Frame, legend and tooltip around a chart. The chart itself is drawn by a library (ApexCharts) or as
   server-rendered SVG; readChartTheme() from "@foodforecast/last-crumb/chart-theme" feeds it the same tokens.
   Series colors come in through --ff-chart-color on the element (legend item, swatch, SVG mark). */
.ff-chart {
  container: ff-chart / inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0;
  min-width: 0;
}

.ff-chart__canvas {
  position: relative;
  min-height: var(--ff-chart-height, 240px);
  color: var(--text-secondary);
  font: 400 var(--fs-caption)/1.3 var(--font-sans);
}

.ff-chart__canvas > svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.ff-chart__summary {
  margin: 0;
  font-size: var(--fs-control);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Marks for server-rendered SVG charts. Libraries get the same values from readChartTheme(). */
.ff-chart__grid {
  stroke: var(--border-default);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.ff-chart__axis {
  fill: var(--text-secondary);
  font: 400 var(--fs-caption) var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.ff-chart__crosshair {
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.ff-chart__benchmark {
  stroke: var(--text-secondary);
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.ff-chart__line {
  fill: none;
  stroke: var(--ff-chart-color, var(--chart-other));
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ff-chart__line--compare {
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.ff-chart__point {
  fill: var(--bg-surface);
  stroke: var(--ff-chart-color, var(--chart-other));
  stroke-width: 2;
}

.ff-chart__bar {
  fill: var(--ff-chart-color, var(--chart-other));
  transition: opacity var(--dur-fast) var(--ease-out);
}

/* Hovering one group dims all other bars to 35 %, without a background band. */
.ff-chart__canvas:has(.ff-chart__group:hover) .ff-chart__group:not(:hover) .ff-chart__bar {
  opacity: 0.35;
}

.ff-chart__canvas [data-hidden] {
  display: none;
}

/* Legend: below the chart, centered, each entry toggles its series. */
.ff-chart__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  box-sizing: border-box;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: 400 var(--fs-control)/1 var(--font-sans);
  color: var(--text-primary);
  white-space: nowrap;
}

button.ff-chart__legend-item {
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

button.ff-chart__legend-item:hover {
  background: var(--bg-hover);
}

button.ff-chart__legend-item:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.ff-chart__legend-item[aria-pressed="false"] {
  --ff-chart-color: var(--text-disabled);
  color: var(--text-disabled);
}

.ff-chart__swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-xs);
  background: var(--ff-chart-color, var(--chart-other));
}

.ff-chart__swatch--line {
  width: 16px;
  height: 3px;
  border-radius: var(--radius-pill);
}

.ff-chart__swatch--dashed {
  width: 16px;
  height: 2px;
  border-radius: 0;
  background: repeating-linear-gradient(90deg, var(--ff-chart-color, var(--chart-other)) 0 5px, transparent 5px 8px);
}

/* Tooltip: one box for all series of a point in time. Libraries render this markup into their tooltip
   container; positioning stays with the library. */
.ff-chart__tooltip {
  box-sizing: border-box;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-popover);
  font: 400 var(--fs-control)/1.4 var(--font-sans);
  color: var(--text-primary);
}

.ff-chart__tooltip-title {
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-default);
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--text-secondary);
}

.ff-chart__tooltip-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--sp-2);
  padding-block: 2px;
}

.ff-chart__tooltip-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--ff-chart-color, var(--chart-other));
}

.ff-chart__tooltip-label {
  color: var(--text-secondary);
}

.ff-chart__tooltip-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

/* Narrow: the legend starts left so it reads like a list. */
@container ff-chart (width < 400px) {
  .ff-chart__legend {
    justify-content: flex-start;
    gap: var(--sp-1);
  }
}

/* src/components/chip/chip.css */
.ff-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--h-chip);
  margin: 0;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font: 400 var(--fs-body)/1 var(--font-sans);
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

:is(button, a).ff-chip {
  cursor: pointer;
}

:is(button, a).ff-chip:where(:not(:disabled, [aria-disabled="true"])):hover {
  background: var(--bg-hover);
}

:is(button, a).ff-chip:where(:not(:disabled, [aria-disabled="true"])):is(:active, [aria-expanded="true"]) {
  background: var(--bg-pressed);
}

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

.ff-chip--active {
  border-color: var(--action-primary);
  box-shadow: inset 0 0 0 1px var(--action-primary);
  background: var(--bg-surface);
  color: var(--status-success-fg);
}

:is(button, a).ff-chip--active:where(:not(:disabled, [aria-disabled="true"])):hover {
  background: var(--chip-hover);
}

:is(button, a).ff-chip--active:where(:not(:disabled, [aria-disabled="true"])):is(:active, [aria-expanded="true"]) {
  background: var(--chip-pressed);
}

.ff-chip--add {
  border-style: dashed;
  color: var(--text-secondary);
}

:is(button, a).ff-chip--add:where(:not(:disabled, [aria-disabled="true"])):hover {
  color: var(--text-primary);
}

/* Only chips with __label get a max-width: a bare text node cannot be shortened and would overflow. */
.ff-chip:has(> .ff-chip__label) {
  max-width: 280px;
}

.ff-chip__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ff-chip--dropdown {
  justify-content: space-between;
  min-width: 140px;
}

.ff-chip:is(:disabled, [aria-disabled="true"]) {
  background: var(--bg-surface);
  color: var(--text-disabled);
  cursor: not-allowed;
}

.ff-chip:has(> .ff-chip__remove) {
  padding-right: 6px;
}

.ff-chip__remove {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

/* Enlarges the hit area to 32 × 32 without changing the visible size. */
.ff-chip__remove::after {
  content: "";
  position: absolute;
  inset: -4px;
}

.ff-chip__remove:hover {
  background: var(--bg-pressed);
}

.ff-chip--active .ff-chip__remove:hover {
  background: var(--chip-pressed);
}

.ff-chip__remove:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}

/* src/components/choices/choices.css */
.ff-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-2);
}

.ff-choices__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3) 14px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

/* The radio stays focusable and keeps arrow-key navigation; the card shows its state. */
.ff-choices__item > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.ff-choices__item:hover {
  border-color: var(--border-strong);
}

.ff-choices__item:has(> input:checked) {
  border-color: var(--action-primary);
  box-shadow: inset 0 0 0 1px var(--action-primary);
  background: var(--bg-surface);
}

.ff-choices__item:has(> input:checked):where(:not(:has(> input:disabled))):hover {
  background: var(--chip-hover);
}

.ff-choices__item:has(> input:checked):where(:not(:has(> input:disabled))):active {
  background: var(--chip-pressed);
}

.ff-choices__item:has(> input:not(:checked):disabled) {
  border-color: var(--border-control);
}

.ff-choices__item:has(> input:disabled) {
  background: var(--bg-subtle);
  cursor: not-allowed;
}

.ff-choices__item:has(> input:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.ff-choices__title {
  color: var(--text-primary);
  font: 600 var(--fs-body)/1.4 var(--font-sans);
}

.ff-choices__description {
  color: var(--text-secondary);
  font: 400 var(--fs-caption)/1.45 var(--font-sans);
}

.ff-choices__item:has(> input:disabled) :is(.ff-choices__title, .ff-choices__description) {
  color: var(--text-disabled);
}

/* src/components/count/count.css */
.ff-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-page);
  color: var(--text-secondary);
  font: 600 var(--fs-micro)/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}

.ff-count--info {
  background: var(--status-info-bg);
  color: var(--status-info-fg);
}

.ff-count--important {
  background: var(--status-error-fg);
  color: var(--text-on-inverse);
}

/* src/components/date-range/date-range.css */
/* Date range picker: presets, month grid and from/to inputs. Behavior and the grid come from <ff-date-range>. */
ff-date-range {
  display: block;
  container: ff-date-range / inline-size;
}

.ff-date-range {
  --ff-date-range-day-size: 36px;
  --ff-date-range-presets-width: 180px;
  --ff-date-range-range-bg: var(--bg-selected);
  display: flex;
  gap: var(--sp-4);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text-primary);
}

/* Presets */

.ff-date-range__presets {
  display: flex;
  flex: 0 0 var(--ff-date-range-presets-width);
  flex-direction: column;
  gap: 2px;
  box-sizing: border-box;
  min-inline-size: 0;
  margin: 0;
  padding: 0 var(--sp-3) 0 0;
  border: 0;
  border-inline-end: 1px solid var(--border-default);
}

.ff-date-range__preset {
  display: flex;
  align-items: center;
  gap: calc(var(--sp-2) + 2px);
  min-height: var(--h-menu-item);
  padding: 0 calc(var(--sp-2) + 2px);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.ff-date-range__preset > input[type="radio"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--action-primary);
  cursor: inherit;
}

.ff-date-range__preset:hover {
  background: var(--bg-hover);
}

.ff-date-range__preset:has(> input:checked) {
  background: var(--bg-selected);
  font-weight: 500;
}

.ff-date-range__preset:has(> input:checked):hover {
  background: var(--bg-selected-hover);
}

.ff-date-range__preset > input:focus-visible {
  outline: none;
}

.ff-date-range__preset:has(> input:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

/* Calendar and inputs */

.ff-date-range__main {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
}

.ff-date-range__back {
  display: none;
  align-self: flex-start;
}

.ff-date-range__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.ff-date-range__month {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text-heading);
}

.ff-date-range__grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.ff-date-range__weekday,
.ff-date-range__week {
  height: 28px;
  padding: 0;
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  font-weight: 500;
  text-align: center;
}

.ff-date-range__week {
  width: 32px;
  font-weight: 400;
}

.ff-date-range__day {
  height: var(--ff-date-range-day-size);
  padding: 0;
  font-size: var(--fs-control);
  text-align: center;
  cursor: pointer;
}

.ff-date-range__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.ff-date-range__day:hover > .ff-date-range__number {
  background: var(--bg-hover);
}

.ff-date-range__day[data-outside] {
  color: var(--text-secondary);
}

.ff-date-range__day[aria-current="date"] {
  color: var(--text-link);
  font-weight: 600;
}

/* Range band: full cells in between, half cells at the ends. */
.ff-date-range__day[data-in-range] {
  background: var(--ff-date-range-range-bg);
}

.ff-date-range__grid:not([data-open-range]) .ff-date-range__day[data-range-start]:not([data-range-end]) {
  background: linear-gradient(to right, transparent 50%, var(--ff-date-range-range-bg) 50%);
}

.ff-date-range__day[data-range-end]:not([data-range-start]) {
  background: linear-gradient(to left, transparent 50%, var(--ff-date-range-range-bg) 50%);
}

.ff-date-range__day:is([data-range-start], [data-range-end]) > .ff-date-range__number {
  background: var(--action-primary);
  color: var(--text-on-action);
  font-weight: 500;
}

.ff-date-range__day:is([data-range-start], [data-range-end]):hover > .ff-date-range__number {
  background: var(--action-primary-hover);
}

.ff-date-range__day[aria-disabled="true"] {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.ff-date-range__day[aria-disabled="true"]:hover > .ff-date-range__number {
  background: transparent;
}

.ff-date-range__day:focus-visible {
  outline: none;
}

.ff-date-range__day:focus-visible > .ff-date-range__number {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.ff-date-range__inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.ff-date-range__inputs .ff-input {
  width: 100%;
  min-width: 0;
}

/* Compact: presets first, "custom range" shows the calendar in their place. */
@container ff-date-range (width < 560px) {
  .ff-date-range {
    flex-direction: column;
  }

  .ff-date-range__presets {
    flex-basis: auto;
    padding: 0;
    border-inline-end: 0;
  }

  .ff-date-range:has(> .ff-date-range__presets):not([data-view="calendar"]) > .ff-date-range__main,
  .ff-date-range[data-view="calendar"] > .ff-date-range__presets {
    display: none;
  }

  .ff-date-range[data-view="calendar"] .ff-date-range__back {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ff-date-range__preset,
  .ff-date-range__number {
    transition: none;
  }
}

@media (forced-colors: active) {
  .ff-date-range__day:is([data-range-start], [data-range-end]) > .ff-date-range__number {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }

  .ff-date-range__day[data-in-range] > .ff-date-range__number {
    outline: 1px solid Highlight;
  }

  .ff-date-range__day:focus-visible > .ff-date-range__number {
    outline-color: Highlight;
  }

  .ff-date-range__day[aria-disabled="true"] {
    color: GrayText;
  }
}

/* src/components/empty-state/empty-state.css */
.ff-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-8) 0;
  text-align: center;
}

.ff-empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.ff-empty-state__title {
  margin: 0;
  font: 600 var(--fs-card-title)/1.25 var(--font-sans);
  color: var(--text-heading);
}

.ff-empty-state__description {
  max-width: 320px;
  margin: calc(var(--sp-1) - var(--sp-3)) 0 0;
  font: 400 var(--fs-body)/1.5 var(--font-sans);
  color: var(--text-secondary);
}

/* src/components/field/field.css */
.ff-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ff-field__label {
  font: 500 var(--fs-control)/1.3 var(--font-sans);
  color: var(--text-heading);
}

.ff-field__optional {
  font-weight: 400;
  color: var(--text-secondary);
}

.ff-field__hint {
  font-size: var(--fs-caption);
  line-height: 1.4;
  color: var(--text-secondary);
}

.ff-field__error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-caption);
  line-height: 1.4;
  color: var(--status-error-fg);
}

.ff-input {
  width: 100%;
  height: var(--h-input);
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-input-inset);
  color: var(--text-primary);
  font: 400 var(--fs-body) var(--font-sans);
  box-sizing: border-box;
  transition: border-color var(--dur-fast) var(--ease-out);
}

textarea.ff-input {
  height: auto;
  min-height: 96px;
  padding: 10px var(--sp-3);
  line-height: 1.5;
  resize: vertical;
}

select.ff-input {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.ff-input::placeholder {
  color: var(--text-muted);
}

.ff-input:hover {
  border-color: var(--border-strong);
}

.ff-input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
  border-color: var(--focus-ring);
}

.ff-input:disabled {
  background: var(--bg-subtle);
  color: var(--text-disabled);
  cursor: not-allowed;
}

.ff-input[aria-invalid="true"] {
  border-color: var(--status-error-fg);
}

.ff-input[aria-invalid="true"]:focus-visible {
  outline-color: var(--status-error-focus);
}

.ff-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--action-primary);
}

.ff-search {
  position: relative;
  display: flex;
  align-items: center;
}

.ff-search > .ff-icon {
  position: absolute;
  left: var(--sp-3);
  color: var(--text-secondary);
  pointer-events: none;
}

.ff-search .ff-input {
  height: var(--h-chip);
  padding-left: 36px;
}

.ff-search .ff-input::-webkit-search-decoration,
.ff-search .ff-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.ff-search:has(.ff-search__clear) .ff-input {
  padding-right: 34px;
}

.ff-search__clear {
  position: absolute;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

/* Enlarges the hit area to 32 × 32 without changing the visible size. */
.ff-search__clear::after {
  content: "";
  position: absolute;
  inset: -4px;
}

.ff-search__clear:hover {
  background: var(--bg-pressed);
  color: var(--text-primary);
}

.ff-search__clear:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}

.ff-search:has(.ff-input:placeholder-shown) .ff-search__clear {
  display: none;
}

/* src/components/filter-bar/filter-bar.css */
/* Layout only: search, chips and view switch keep their own styles. The bar wraps instead of scrolling,
   so active filters stay visible and focus rings are never clipped. */
.ff-filter-bar {
  --ff-filter-bar-search-width: 280px;
  container: ff-filter-bar / inline-size;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--sp-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* A <form> inside <search> carries the same layout. */
.ff-filter-bar > form {
  display: contents;
}

.ff-filter-bar__search {
  flex: 0 1 var(--ff-filter-bar-search-width);
  min-width: min(100%, 160px);
}

/* Basis 0 keeps the chip group next to the search field and lets it wrap within itself. */
.ff-filter-bar__filters {
  display: flex;
  flex: 1 1 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  min-width: min(100%, 240px);
}

.ff-filter-bar__end {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-left: auto;
}

@container ff-filter-bar (width < 560px) {
  .ff-filter-bar__search,
  .ff-filter-bar__filters {
    flex-basis: 100%;
  }

  .ff-filter-bar__end {
    margin-left: 0;
  }
}

/* src/components/heatmap/heatmap.css */
/* Calendar heatmap: one column per week, Monday on top. The server sets --ff-heatmap-ratio (0 … 1)
   on each cell; the color runs from --border-selected to --status-success-fg. */
.ff-heatmap {
  --ff-heatmap-cell: 12px;
  --ff-heatmap-gap: 4px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
  font: 400 var(--fs-caption)/1.3 var(--font-sans);
  color: var(--text-secondary);
}

.ff-heatmap__scroll {
  display: grid;
  grid-template-columns: auto max-content;
  grid-template-areas: ". months" "weekdays grid";
  column-gap: var(--sp-2);
  row-gap: var(--sp-1);
  max-width: 100%;
  overflow-x: auto;
  padding: 3px;
}

.ff-heatmap__months,
.ff-heatmap__weekdays,
.ff-heatmap__grid,
.ff-heatmap__week {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-heatmap__months {
  grid-area: months;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--ff-heatmap-cell);
  column-gap: var(--ff-heatmap-gap);
}

.ff-heatmap__months > * {
  grid-column: span var(--ff-heatmap-span, 4);
  white-space: nowrap;
}

.ff-heatmap__weekdays {
  grid-area: weekdays;
  display: grid;
  grid-template-rows: repeat(7, var(--ff-heatmap-cell));
  row-gap: var(--ff-heatmap-gap);
  line-height: var(--ff-heatmap-cell);
}

.ff-heatmap__grid {
  grid-area: grid;
  display: flex;
  gap: var(--ff-heatmap-gap);
}

.ff-heatmap__week {
  display: flex;
  flex-direction: column;
  gap: var(--ff-heatmap-gap);
  height: calc(7 * var(--ff-heatmap-cell) + 6 * var(--ff-heatmap-gap));
}

/* The first week starts mid-week, so its days sit at the bottom. */
.ff-heatmap__week:first-child {
  justify-content: flex-end;
}

.ff-heatmap__cell {
  display: block;
  flex: none;
  box-sizing: border-box;
  width: var(--ff-heatmap-cell);
  height: var(--ff-heatmap-cell);
  border-radius: 2px;
  background: color-mix(in srgb, var(--status-success-fg) calc(var(--ff-heatmap-ratio, 0) * 100%), var(--border-selected));
}

.ff-heatmap__cell--empty {
  background: var(--bg-pressed);
}

.ff-heatmap__grid .ff-heatmap__cell:hover {
  box-shadow: 0 0 0 1px var(--text-primary);
}

.ff-heatmap__cell:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.ff-heatmap__status {
  min-height: 1.3em;
  margin: 0;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.ff-heatmap__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--ff-heatmap-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-heatmap__legend > li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: var(--sp-3);
}

/* Data calendar: a real table (store × day), status per cell as color plus value or "–". */
.ff-heatmap--matrix {
  border-collapse: separate;
  border-spacing: 3px;
  font: 500 var(--fs-micro)/1 var(--font-sans);
  color: var(--text-secondary);
}

.ff-heatmap--matrix th {
  padding: 0 2px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

.ff-heatmap--matrix th[scope="row"] {
  padding-right: var(--sp-3);
  font: 400 var(--fs-caption)/1.3 var(--font-sans);
  color: var(--text-primary);
  text-align: start;
}

/* :where() keeps this at class specificity, so the status modifiers below win. */
.ff-heatmap--matrix :where(.ff-heatmap__cell) {
  display: table-cell;
  width: 26px;
  min-width: 26px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-pressed);
  text-align: center;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.ff-heatmap__cell--complete {
  background: var(--status-success-bg);
  color: var(--status-success-fg);
}

.ff-heatmap__cell--partial {
  background: var(--status-warning-bg);
  color: var(--status-warning-fg);
}

.ff-heatmap__cell--poor {
  background: var(--status-error-bg);
  color: var(--status-error-fg);
}

.ff-heatmap__cell--closed {
  background: var(--bg-pressed);
  color: var(--text-muted);
}

/* src/components/kpi-card/kpi-card.css */
.ff-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-3) var(--sp-4);
}

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

.ff-kpi__label {
  font-size: var(--fs-control);
  color: var(--text-muted);
}

.ff-kpi__value {
  font-size: var(--fs-kpi);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.ff-kpi__trend {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--text-secondary);
}

.ff-kpi__trend--positive {
  color: var(--status-success-fg);
}

.ff-kpi__trend--negative {
  color: var(--status-error-fg);
}

.ff-kpi--critical {
  background: var(--bg-error-subtle);
  border-color: var(--status-error-border);
}

.ff-kpi--critical .ff-kpi__value {
  color: var(--status-error-fg);
}

.ff-kpi--critical .ff-pill {
  background: var(--status-error-bg-strong);
  color: var(--status-error-fg);
}

/* Comparison line under the value: deviation pill plus reference period. */
.ff-kpi__compare {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Selectable tile: a real <a> or <button aria-pressed>. */
.ff-kpi--selectable {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  font: inherit;
  text-align: start;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.ff-kpi--selectable:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.ff-kpi--selectable:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.ff-kpi--selectable:is([aria-pressed="true"], [aria-current]:not([aria-current="false"])) {
  background: var(--bg-selected);
  border-color: var(--border-selected);
  box-shadow: inset 0 0 0 1px var(--border-selected);
}

/* Count tile: a plain number of open items, colored at the value only. */
.ff-kpi--count .ff-kpi__value {
  font-size: 26px;
}

.ff-kpi__value--error {
  color: var(--status-error-fg);
}

.ff-kpi__value--warning {
  color: var(--status-warning-text);
}

/* Area card: several figures for one area (store, product group) in one card. */
.ff-kpi-fields {
  container: ff-kpi-fields / inline-size;
}

.ff-kpi-fields__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--sp-2);
  margin: 0;
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

.ff-kpi-fields__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}

.ff-kpi-fields__label {
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

.ff-kpi-fields__value {
  margin: 0;
  font-size: clamp(20px, 5cqi, 24px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.ff-kpi-fields__delta {
  margin: 0;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
}

/* Narrow: one row per field, label and deviation left, value right. */
@container ff-kpi-fields (width < 440px) {
  .ff-kpi-fields__list {
    grid-auto-flow: row;
    gap: 0;
    padding-block: var(--sp-1);
  }

  .ff-kpi-fields__field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label value" "delta value";
    align-items: center;
    column-gap: var(--sp-3);
    padding: var(--sp-2) 0;
    border-radius: 0;
    background: none;
  }

  .ff-kpi-fields__field + .ff-kpi-fields__field {
    border-top: 1px solid var(--border-row);
  }

  .ff-kpi-fields__label {
    grid-area: label;
  }

  .ff-kpi-fields__value {
    grid-area: value;
    font-size: var(--fs-section);
    text-align: end;
  }

  .ff-kpi-fields__delta {
    grid-area: delta;
  }
}

/* Very narrow: label, value and deviation stacked. */
@container ff-kpi-fields (width < 300px) {
  .ff-kpi-fields__field {
    display: flex;
  }

  .ff-kpi-fields__value {
    text-align: start;
  }
}

/* src/components/menu/menu.css */
/* Menu on a native [popover]. Position comes from <ff-menu> (src/elements/internal/anchor.ts). */
.ff-menu {
  --ff-menu-min-width: 200px;
  --ff-menu-max-width: 300px;
  --ff-menu-padding: 6px;
  --ff-menu-offset: var(--sp-1);
  box-sizing: border-box;
  inset: auto;
  width: max-content;
  min-width: var(--ff-menu-min-width);
  max-width: min(var(--ff-menu-max-width), 100vw - 2 * var(--sp-4));
  max-height: calc(100dvh - 2 * var(--sp-2));
  margin: 0;
  padding: var(--ff-menu-padding);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-popover);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-weight: 400;
  opacity: 0;
  transition:
    opacity var(--dur-fast) var(--ease-out),
    display var(--dur-fast) allow-discrete,
    overlay var(--dur-fast) allow-discrete;
}

.ff-menu:popover-open {
  opacity: 1;
  transition-duration: var(--dur-base);
}

@starting-style {
  .ff-menu:popover-open {
    opacity: 0;
  }
}

@supports not selector(:popover-open) {
  .ff-menu {
    z-index: var(--z-dropdown);
  }
}

.ff-menu__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--ff-menu-padding);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1.4;
}

.ff-menu__header > :not(.ff-avatar) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ff-menu__header strong {
  display: block;
  color: var(--text-primary);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-weight: 600;
}

.ff-menu__list,
.ff-menu__list [role="group"] {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-menu__group-label {
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 500;
}

.ff-menu__list > .ff-menu__group-label:first-child,
.ff-menu__list > [role="group"]:first-child > .ff-menu__group-label:first-child {
  padding-top: var(--sp-1);
}

.ff-menu__separator {
  height: 0;
  margin: var(--sp-1) 0;
  border: 0;
  border-top: 1px solid var(--border-default);
}

.ff-menu__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  box-sizing: border-box;
  width: 100%;
  min-height: var(--h-menu-item);
  margin: 0;
  padding: var(--sp-1) var(--sp-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: start;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.ff-menu__item > .ff-icon {
  color: var(--text-muted);
}

.ff-menu__item:is(:hover, :focus) {
  outline: none;
  background: var(--bg-hover);
}

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

.ff-menu__item:active {
  background: var(--bg-pressed);
}

.ff-menu__label {
  flex: 1;
  min-width: 0;
}

.ff-menu__meta {
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 400;
}

.ff-menu__item > .ff-menu__meta {
  margin-inline-start: auto;
  padding-inline-start: var(--sp-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ff-menu__label > .ff-menu__meta {
  display: block;
}

.ff-menu__item > .ff-menu__check {
  margin-inline-start: auto;
  color: var(--action-primary);
  visibility: hidden;
}

.ff-menu__item[aria-checked="true"] > .ff-menu__check {
  visibility: visible;
}

.ff-menu__item--danger,
.ff-menu__item--danger > .ff-icon {
  color: var(--status-error-fg);
}

.ff-menu__item--danger:is(:hover, :focus) {
  background: var(--status-error-bg);
}

.ff-menu__item--danger:focus-visible {
  outline-color: var(--status-error-focus);
}

.ff-menu__item--danger:active {
  background: var(--status-error-bg-strong);
}

/* Disabled wins over danger: a disabled delete entry is gray. Hover and focus keep the surface,
   because the entry stays reachable with the arrow keys. */
.ff-menu__item[aria-disabled="true"],
.ff-menu__item[aria-disabled="true"] > .ff-icon {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.ff-menu__item[aria-disabled="true"]:is(:hover, :focus, :active) {
  background: var(--bg-hover);
}

.ff-menu__item[aria-disabled="true"]:focus-visible {
  outline-color: var(--focus-ring);
}

@media (prefers-reduced-motion: reduce) {
  .ff-menu,
  .ff-menu__item {
    transition: none;
  }
}

@media (forced-colors: active) {
  .ff-menu__item:is(:hover, :focus) {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }

  .ff-menu__item:is(:hover, :focus) > .ff-icon,
  .ff-menu__item:is(:hover, :focus) .ff-menu__meta {
    color: HighlightText;
  }

  .ff-menu__item[aria-disabled="true"] {
    color: GrayText;
  }

  .ff-menu__item[aria-disabled="true"]:is(:hover, :focus) {
    background: Canvas;
    color: GrayText;
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }

  .ff-menu__item[aria-disabled="true"]:is(:hover, :focus) > .ff-icon {
    color: GrayText;
  }
}

/* src/components/modal/modal.css */
.ff-modal {
  --ff-modal-width: 560px;
  width: min(100% - 2 * var(--sp-4), var(--ff-modal-width));
  max-width: none;
  max-height: calc(100dvh - 2 * var(--sp-8));
  padding: 0;
  /* Invisible edge that forced-colors mode draws, where shadow and scrim disappear. */
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-modal);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.ff-modal[open] {
  display: flex;
  flex-direction: column;
}

.ff-modal::backdrop {
  background: var(--scrim-modal);
}

.ff-modal--s {
  --ff-modal-width: 400px;
}

.ff-modal--l {
  --ff-modal-width: 720px;
}

.ff-modal__header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-6);
  border-bottom: 1px solid var(--border-default);
}

.ff-modal__title {
  margin: 0;
  font-size: var(--fs-card-title);
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
}

.ff-modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-6);
  font-size: var(--fs-body);
  line-height: 1.5;
}

.ff-modal__description {
  margin: 0;
  color: var(--text-muted);
}

.ff-modal__footer {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border-default);
  background: var(--bg-subtle);
}

.ff-modal__meta {
  margin: 0;
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 400;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* With a meta line, meta and title stack on the left; header actions sit right, centered over both lines.
   Up to three actions get their own column; the gap comes from their margin so empty columns take no space. */
.ff-modal__header:has(> .ff-modal__meta) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  align-items: center;
  gap: 0;
}

.ff-modal__header > .ff-modal__meta {
  grid-column: 1;
  grid-row: 1;
}

.ff-modal__header:has(> .ff-modal__meta) > .ff-modal__title {
  grid-column: 1;
  grid-row: 2;
}

.ff-modal__header:has(> .ff-modal__meta) > :not(.ff-modal__meta, .ff-modal__title, .ff-steps) {
  grid-row: 1 / 3;
  margin-inline-start: var(--sp-3);
}

/* Step indicator of a wizard as the last row of the header. */
.ff-modal__header:has(> .ff-steps) {
  flex-wrap: wrap;
  padding-bottom: var(--sp-5);
}

.ff-modal__header > .ff-steps {
  grid-column: 1 / -1;
  flex-basis: 100%;
  margin-top: var(--sp-5);
}

/* Tabs right below the header: the tab line replaces the header line. */
.ff-modal__header:has(+ .ff-tabs) {
  border-bottom: 0;
}

.ff-modal__header + .ff-tabs {
  flex: none;
  padding-inline: var(--sp-5);
}

.ff-modal__footer-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-inline-end: auto;
}

/* The ghost button's text lines up with the content column; this also keeps a 440 px drawer footer on one line. */
.ff-modal__footer-start > .ff-btn--ghost:first-child {
  margin-inline-start: calc(-1 * var(--sp-4));
}

.ff-modal--drawer {
  --ff-modal-width: 440px;
  box-sizing: border-box;
  width: min(100%, var(--ff-modal-width));
  height: 100dvh;
  max-height: none;
  margin: 0;
  margin-inline-start: auto;
  inset-block: 0;
  border: 0;
  border-inline-start: 1px solid transparent;
  border-radius: 0;
  translate: 100% 0;
  transition:
    translate var(--dur-base) var(--ease-out),
    overlay var(--dur-base) allow-discrete,
    display var(--dur-base) allow-discrete;
}

.ff-modal--drawer.ff-modal--l {
  --ff-modal-width: 640px;
}

.ff-modal--drawer[open] {
  translate: 0;
}

@starting-style {
  .ff-modal--drawer[open] {
    translate: 100% 0;
  }
}

.ff-modal--drawer::backdrop {
  background: var(--scrim-drawer);
  opacity: 0;
  transition:
    opacity var(--dur-base) var(--ease-out),
    overlay var(--dur-base) allow-discrete,
    display var(--dur-base) allow-discrete;
}

.ff-modal--drawer[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .ff-modal--drawer[open]::backdrop {
    opacity: 0;
  }
}

@media (max-width: 767.98px) {
  .ff-modal--drawer,
  .ff-modal--drawer.ff-modal--l {
    --ff-modal-width: 100%;
  }

  .ff-modal--drawer .ff-modal__footer {
    padding-bottom: max(var(--sp-4), env(safe-area-inset-bottom));
  }
}

/* Drawer from the start edge (left in LTR), e.g. the main navigation below 1024 px. */
.ff-modal--drawer.ff-modal--start {
  --ff-modal-width: min(300px, 85vw);
  margin-inline: 0 auto;
  border-inline-start: 0;
  border-inline-end: 1px solid transparent;
  translate: -100% 0;
}

.ff-modal--drawer.ff-modal--start[open] {
  translate: 0;
}

@starting-style {
  .ff-modal--drawer.ff-modal--start[open] {
    translate: -100% 0;
  }
}

.ff-modal--confirm .ff-modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.ff-modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--status-error-bg);
  color: var(--status-error-fg);
}

:root.ff-scroll-lock {
  overflow: hidden;
}

/* src/components/nav-search/nav-search.css */
/* Navigation search in the topbar. Behavior comes from <ff-nav-search>; result rows reuse
   .ff-searchable-list__item, __group-label and __empty. */
ff-nav-search {
  display: block;
  min-width: 0;
}

.ff-nav-search__field {
  width: 100%;
}

.ff-nav-search__field .ff-input {
  width: 100%;
}

.ff-nav-search__field:has(.ff-nav-search__shortcut) .ff-input {
  padding-right: 64px;
}

.ff-nav-search__shortcut {
  position: absolute;
  right: var(--sp-2);
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font: 500 var(--fs-micro)/1 var(--font-sans);
  white-space: nowrap;
  pointer-events: none;
}

.ff-nav-search__field:has(.ff-input:not(:placeholder-shown)) .ff-nav-search__shortcut {
  display: none;
}

.ff-nav-search__trigger {
  display: none;
}

/* Result list: a manual popover under the field, positioned by <ff-nav-search>. */
.ff-nav-search__results {
  --ff-nav-search-offset: 6px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2px;
  inset: auto;
  min-width: 280px;
  max-width: calc(100vw - 2 * var(--sp-4));
  max-height: min(440px, 100dvh - 2 * var(--sp-8));
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-popover);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  opacity: 0;
  transition:
    opacity var(--dur-fast) var(--ease-out),
    display var(--dur-fast) allow-discrete,
    overlay var(--dur-fast) allow-discrete;
}

.ff-nav-search__results:not(:popover-open) {
  display: none;
}

.ff-nav-search__results:popover-open {
  opacity: 1;
}

@starting-style {
  .ff-nav-search__results:popover-open {
    opacity: 0;
  }
}

.ff-nav-search__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ff-nav-search__results .ff-searchable-list__item {
  min-height: 40px;
}

.ff-nav-search__results [hidden] {
  display: none;
}

.ff-nav-search__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  /* Wide windows: the dialog wrapper is invisible to layout, field and list sit in the topbar. */
  .ff-nav-search__dialog:not([open]) {
    display: contents;
  }
}

@media (max-width: 639.98px) {
  .ff-nav-search__trigger {
    display: inline-flex;
  }

  .ff-nav-search__dialog:not([open]) {
    display: none;
  }

  .ff-nav-search__shortcut {
    display: none;
  }
}

/* Narrow windows: field and results in a modal dialog at the top of the screen. */
.ff-nav-search__dialog[open] {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  box-sizing: border-box;
  width: calc(100vw - 2 * var(--sp-4));
  max-width: 560px;
  max-height: calc(100dvh - 2 * var(--sp-4));
  margin: var(--sp-4) auto auto;
  padding: var(--sp-3);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-modal);
  color: var(--text-primary);
}

.ff-nav-search__dialog::backdrop {
  background: var(--scrim-modal);
}

.ff-nav-search__dialog[open] .ff-nav-search__results {
  position: static;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  box-shadow: none;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .ff-nav-search__results {
    transition: none;
  }
}

@media (forced-colors: active) {
  .ff-nav-search__shortcut {
    border-color: CanvasText;
  }
}

/* src/components/nav/nav.css */
/* Main navigation on a dark gradient. Collapsing and the flyout come from <ff-nav> (src/elements/ff-nav.ts). */
.ff-nav {
  --ff-nav-width: 248px;
  --ff-nav-collapsed-width: 64px;
  --ff-nav-rail-width: 64px;
  --ff-nav-offset: var(--sp-2);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: var(--ff-nav-width);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--nav-gradient-start) 0%, var(--nav-gradient-end) 100%);
  color: var(--nav-fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.4;
  transition: width var(--dur-base) var(--ease-out);
}

.ff-nav :is(.ff-nav__brand, .ff-nav__toggle, .ff-nav__item, .ff-nav__subitem, .ff-nav__account, .ff-nav__rail-item):focus-visible {
  outline: 2px solid var(--focus-on-inverse);
  outline-offset: 2px;
}

.ff-nav__head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 14px var(--sp-4);
  border-bottom: 1px solid var(--nav-border);
}

.ff-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  color: var(--nav-fg-active);
  font-size: 17px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}

.ff-nav__brand > svg {
  flex: none;
  width: 22px;
  height: 22px;
}

.ff-nav__toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--nav-item-selected);
  color: var(--nav-fg-active);
  cursor: pointer;
}

.ff-nav__toggle > .ff-icon {
  transition: rotate var(--dur-base) var(--ease-out);
}

.ff-nav__toggle[aria-pressed="true"] > .ff-icon {
  rotate: 180deg;
}

.ff-nav__list,
.ff-nav__sub {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-nav__list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ff-nav__item,
.ff-nav__subitem {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--nav-fg);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.ff-nav__item:hover,
.ff-nav__subitem:hover {
  background: var(--nav-item-hover);
  color: var(--nav-fg-active);
}

.ff-nav__item[aria-current="page"],
.ff-nav__subitem[aria-current="page"] {
  background: var(--nav-item-selected);
  color: var(--nav-fg-active);
}

.ff-nav__icon {
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  padding: 2px;
}

.ff-nav__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff-nav__badge {
  flex: none;
  min-width: 20px;
  padding: 1px var(--sp-2);
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  background: var(--nav-item-selected);
  color: var(--nav-fg-active);
  font-size: var(--fs-micro);
  line-height: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Group: native <details>; the summary looks like an item with a chevron at the end. */
.ff-nav__group-summary {
  list-style: none;
}

.ff-nav__group-summary::-webkit-details-marker {
  display: none;
}

.ff-nav__group-summary::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-inline-end: var(--sp-1);
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  rotate: 45deg;
  translate: 0 -2px;
  transition: rotate var(--dur-base) var(--ease-out);
}

.ff-nav__group[open] > .ff-nav__group-summary::after {
  rotate: 225deg;
  translate: 0 2px;
}

/* Expanded: the flyout is a plain block inside the open group, its title is hidden. */
.ff-nav__flyout {
  position: static;
  display: block;
  inset: auto;
  width: auto;
  height: auto;
  margin: 0;
  padding: 2px 0 0;
  overflow: visible;
  border: 0;
  background: none;
  color: inherit;
}

.ff-nav__flyout-title {
  display: none;
}

.ff-nav__sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ff-nav__subitem {
  min-height: 32px;
  margin-inline-start: 32px;
  width: calc(100% - 32px);
  color: var(--nav-fg-subtle);
  font-size: var(--fs-control);
}

.ff-nav__footer {
  display: flex;
  flex: none;
  padding: var(--sp-2) 10px;
  border-top: 1px solid var(--nav-border);
}

.ff-nav__footer > * {
  flex: 1;
  min-width: 0;
}

/* Account switch in the footer (pattern docs/patterns/account-auswahl.md). */
.ff-nav__account {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  padding: var(--sp-1) 6px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--nav-fg-active);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.ff-nav__account:hover,
.ff-nav__account[aria-expanded="true"] {
  background: var(--nav-item-hover);
}

.ff-nav__account > .ff-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  font-size: var(--fs-control);
}

.ff-nav__account > .ff-nav__label {
  display: flex;
  flex-direction: column;
  font-size: var(--fs-control);
  line-height: 1.3;
  font-weight: 600;
}

.ff-nav__account > .ff-nav__label > small {
  overflow: hidden;
  color: var(--nav-fg);
  font-size: var(--fs-caption);
  font-weight: 400;
  text-overflow: ellipsis;
}

/* App rail: a 64 px column of apps on the left, the menu of the current app next to it. */
.ff-nav--rail {
  --ff-nav-width: calc(224px + var(--ff-nav-rail-width));
  display: grid;
  grid-template-columns: var(--ff-nav-rail-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.ff-nav--rail > .ff-nav__rail {
  grid-column: 1;
  grid-row: 1 / -1;
}

.ff-nav--rail > :not(.ff-nav__rail) {
  grid-column: 2;
}

.ff-nav__rail {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin: 0;
  padding: 10px var(--sp-1);
  list-style: none;
  border-inline-end: 1px solid var(--nav-border);
}

.ff-nav__rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-sizing: border-box;
  min-height: 56px;
  padding: var(--sp-1) 2px;
  border-radius: var(--radius-md);
  color: var(--nav-fg);
  font-size: var(--fs-micro);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.ff-nav__rail-item > .ff-icon {
  width: var(--size-icon-md);
  height: var(--size-icon-md);
}

.ff-nav__rail-item:hover {
  background: var(--nav-item-hover);
  color: var(--nav-fg-active);
}

.ff-nav__rail-item[aria-current="page"] {
  background: var(--nav-item-selected);
  color: var(--nav-fg-active);
}

/* Inside the start drawer below 1024 px the navigation fills the dialog. */
.ff-modal > .ff-nav,
.ff-modal > ff-nav > .ff-nav {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.ff-modal > ff-nav {
  display: contents;
}

/* Collapsed: icons only, labels stay in the accessibility tree. Only from 1024 px, below the nav sits in a drawer. */
@media (min-width: 1024px) {
  .ff-nav--collapsed {
    width: var(--ff-nav-collapsed-width);
  }

  .ff-nav--collapsed.ff-nav--rail {
    width: calc(var(--ff-nav-rail-width) + var(--ff-nav-collapsed-width));
    grid-template-columns: var(--ff-nav-rail-width) var(--ff-nav-collapsed-width);
  }

  .ff-nav--collapsed .ff-nav__head {
    flex-direction: column;
    padding-inline: 10px;
  }

  .ff-nav--collapsed :is(.ff-nav__item, .ff-nav__account) {
    justify-content: center;
    padding-inline: 0;
  }

  .ff-nav--collapsed :is(.ff-nav__item, .ff-nav__brand, .ff-nav__account) > .ff-nav__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .ff-nav--collapsed .ff-nav__group-summary::after {
    display: none;
  }

  .ff-nav--collapsed .ff-nav__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    padding: 0 var(--sp-1);
    line-height: 14px;
  }

  .ff-nav--collapsed .ff-nav__group:has(.ff-nav__subitem[aria-current="page"]) > .ff-nav__group-summary {
    background: var(--nav-item-selected);
    color: var(--nav-fg-active);
  }

  /* Collapsed: the flyout is a popover to the right of its group. */
  .ff-nav--collapsed .ff-nav__flyout:not(:popover-open) {
    display: none;
  }

  .ff-nav--collapsed .ff-nav__flyout:popover-open {
    position: fixed;
    box-sizing: border-box;
    width: 200px;
    padding: 14px;
    border: 1px solid var(--nav-border);
    border-radius: var(--radius-lg);
    background: var(--nav-gradient-start);
    box-shadow: var(--shadow-popover);
  }

  .ff-nav--collapsed .ff-nav__flyout-title {
    display: block;
    margin: 0 0 var(--sp-2);
    padding-inline: 10px;
    color: var(--nav-fg-active);
    font-size: var(--fs-control);
    font-weight: 600;
  }

  .ff-nav--collapsed .ff-nav__flyout .ff-nav__subitem {
    width: 100%;
    margin-inline-start: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ff-nav,
  .ff-nav__toggle > .ff-icon,
  .ff-nav__group-summary::after {
    transition: none;
  }
}

/* src/components/notice/notice.css */
.ff-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--fs-body);
  line-height: 1.5;
}

.ff-notice__text {
  flex: 1;
  min-width: 240px;
}

.ff-notice__text strong {
  font-weight: 600;
}

.ff-notice--warning {
  background: var(--status-warning-bg);
  border-color: var(--status-warning-border);
  color: var(--status-warning-text);
}

.ff-notice--warning .ff-btn--secondary {
  border-color: var(--status-warning-control);
}

.ff-notice--success {
  background: var(--status-success-bg);
  border-color: var(--chip-border-soft);
  color: var(--status-success-fg);
}

.ff-notice--info {
  background: var(--status-info-bg);
  border-color: transparent;
  color: var(--status-info-fg);
}

.ff-notice--error {
  background: var(--status-error-bg);
  border-color: var(--status-error-border);
  color: var(--status-error-fg);
}

.ff-notice a {
  color: inherit;
  font-size: var(--fs-control);
  font-weight: 500;
}

/* src/components/page-header/page-header.css */
/* The header adapts to its own width (container query), so it fits a full page as well as a narrow content area. */
.ff-page-header {
  --ff-page-header-gap: var(--sp-6);
  container: ff-page-header / inline-size;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
  margin: 0;
  padding: 0 0 var(--ff-page-header-gap);
  border-bottom: 1px solid var(--border-default);
  font-family: var(--font-sans);
}

.ff-page-header--plain {
  padding-bottom: 0;
  border-bottom: 0;
}

/* Tabs as the last child draw their own bottom line. */
.ff-page-header:has(> .ff-tabs) {
  padding-bottom: 0;
  border-bottom: 0;
}

/* row-gap already adds --sp-3, so the tabs end up --ff-page-header-gap below the title block. */
.ff-page-header > .ff-tabs {
  flex: 1 0 100%;
  box-sizing: border-box;
  margin-top: calc(var(--ff-page-header-gap) - var(--sp-3));
}

.ff-page-header__main {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}

.ff-page-header__meta,
.ff-page-header__subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ff-page-header__meta {
  font-size: var(--fs-caption);
}

.ff-page-header__subtitle {
  max-width: 72ch;
  font-size: var(--fs-control);
}

.ff-page-header__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.ff-page-header__title > .ff-page-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ff-page-header__title > :is(.ff-count, .ff-pill) {
  flex: none;
}

.ff-page-header__actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

@container ff-page-header (width < 640px) {
  .ff-page-header__actions {
    flex-basis: 100%;
  }
}

/* src/components/pill/pill.css */
.ff-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--h-pill);
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-page);
  color: var(--text-muted);
  font: 500 var(--fs-caption)/1 var(--font-sans);
  white-space: nowrap;
  box-sizing: border-box;
}

.ff-pill--success {
  background: var(--status-success-bg);
  color: var(--status-success-fg);
}

.ff-pill--info {
  background: var(--status-info-bg);
  color: var(--status-info-fg);
}

.ff-pill--warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-fg);
}

.ff-pill--error {
  background: var(--status-error-bg);
  color: var(--status-error-fg);
}

.ff-pill--inactive,
.ff-pill--outline {
  background: var(--bg-surface);
  color: var(--text-muted);
  box-shadow: inset 0 0 0 1px var(--border-control);
}

.ff-pill--up,
.ff-pill--down {
  font-variant-numeric: tabular-nums;
}

.ff-pill--up::before,
.ff-pill--down::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  background: currentColor;
}

.ff-pill--up::before {
  clip-path: polygon(50% 15%, 90% 85%, 10% 85%);
}

.ff-pill--down::before {
  clip-path: polygon(10% 15%, 90% 15%, 50% 85%);
}

.ff-pill--mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

button.ff-pill {
  border: 0;
  padding-right: var(--sp-2);
  cursor: pointer;
}

button.ff-pill:hover {
  filter: brightness(0.97);
}

/* src/components/popover/popover.css */
/* Non-modal dialog on a native [popover]. Position comes from <ff-popover> (src/elements/internal/anchor.ts). */
.ff-popover {
  --ff-popover-width: 420px;
  --ff-popover-offset: var(--sp-2);
  box-sizing: border-box;
  inset: auto;
  width: min(var(--ff-popover-width), 100vw - 2 * var(--sp-4));
  max-height: calc(100dvh - 2 * var(--sp-2));
  margin: 0;
  padding: 0;
  overflow: clip;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-popover);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-weight: 400;
  opacity: 0;
  transition:
    opacity var(--dur-fast) var(--ease-out),
    display var(--dur-fast) allow-discrete,
    overlay var(--dur-fast) allow-discrete;
}

.ff-popover:popover-open {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transition-duration: var(--dur-base);
}

@starting-style {
  .ff-popover:popover-open {
    opacity: 0;
  }
}

@supports not selector(:popover-open) {
  .ff-popover {
    z-index: var(--z-popover);
  }
}

.ff-popover__header {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-default);
}

.ff-popover__header > .ff-btn--icon {
  align-self: center;
  margin-block: calc(-1 * var(--sp-1));
}

.ff-popover__title {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--fs-card-title);
  line-height: 1.25;
  font-weight: 600;
}

.ff-popover__meta {
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1.4;
}

.ff-popover__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--sp-3);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ff-popover__body:only-child {
  padding: var(--sp-4);
}

.ff-popover__footer {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border-default);
  background: var(--bg-subtle);
}

.ff-popover__note {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0 auto 0 0;
  padding-inline-end: var(--sp-1);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1.4;
}

/* A <form> wrapping header, body and footer keeps the column layout. */
.ff-popover > form {
  display: contents;
}

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

/* src/components/searchable-list/searchable-list.css */
/* Search field above a list of checkboxes, radios, links or buttons. Behavior comes from <ff-searchable-list>. */
.ff-searchable-list {
  --ff-searchable-list-max-height: 256px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-height: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
}

.ff-searchable-list > .ff-search .ff-input {
  width: 100%;
}

.ff-searchable-list__list,
.ff-searchable-list__list :is(fieldset, [role="group"], ul) {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
}

.ff-searchable-list__list {
  max-height: var(--ff-searchable-list-max-height);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Embedded lists show their legend like a field label. */
.ff-searchable-list__list > legend:not(.ff-visually-hidden) {
  float: none;
  margin-bottom: var(--sp-1);
  padding: 0;
  color: var(--text-primary);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-weight: 500;
}

.ff-searchable-list__group-label {
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 500;
}

.ff-searchable-list__list > :first-child > .ff-searchable-list__group-label:first-child,
.ff-searchable-list__list > .ff-searchable-list__group-label:first-child {
  padding-top: var(--sp-1);
}

.ff-searchable-list__item,
.ff-searchable-list__all {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(var(--sp-2) + 2px);
  box-sizing: border-box;
  width: 100%;
  min-height: var(--h-menu-item);
  margin: 0;
  padding: var(--sp-1) var(--sp-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: start;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.ff-searchable-list__item[hidden],
.ff-searchable-list__all[hidden],
.ff-searchable-list__list [hidden] {
  display: none;
}

/* Radios have no class of their own and look like .ff-checkbox. */
.ff-searchable-list__item > input:is([type="checkbox"], [type="radio"]),
.ff-searchable-list__all > input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--action-primary);
  cursor: inherit;
}

.ff-searchable-list__item:hover,
.ff-searchable-list__all:hover,
.ff-searchable-list__item:is(a, button):focus,
.ff-searchable-list__item:has(> input:focus),
.ff-searchable-list__all:has(> input:focus) {
  background: var(--bg-hover);
}

/* Focus sits on the input inside the row; the row shows the ring. */
.ff-searchable-list__item > input:focus-visible,
.ff-searchable-list__all > input:focus-visible {
  outline: none;
}

.ff-searchable-list__item:is(a, button):focus {
  outline: none;
}

.ff-searchable-list__item:is(a, button):focus-visible,
.ff-searchable-list__item:has(> input:focus-visible),
.ff-searchable-list__all:has(> input:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.ff-searchable-list__item:active,
.ff-searchable-list__all:active {
  background: var(--bg-pressed);
}

.ff-searchable-list__label {
  flex: 1;
  min-width: 0;
}

.ff-searchable-list__meta {
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 400;
}

.ff-searchable-list__item > .ff-searchable-list__meta {
  margin-inline-start: auto;
  padding-inline-start: var(--sp-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ff-searchable-list__label > .ff-searchable-list__meta {
  display: block;
}

/* Line under "select all" and under the checked entries pinned to the top. */
.ff-searchable-list__all,
.ff-searchable-list__item[data-ff-pinned="last"] {
  margin-bottom: var(--sp-1);
}

.ff-searchable-list__all::after,
.ff-searchable-list__item[data-ff-pinned="last"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: calc(var(--sp-1) / -2 - 1px);
  left: 0;
  border-top: 1px solid var(--border-default);
  pointer-events: none;
}

.ff-searchable-list__all {
  order: -2;
}

.ff-searchable-list__item[data-ff-pinned] {
  order: -1;
}

/* aria-disabled entries stay reachable with the arrow keys, so hover and focus keep the surface. */
.ff-searchable-list__item:has(> [aria-disabled="true"]),
.ff-searchable-list__item[aria-disabled="true"] {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.ff-searchable-list__item:has(> [aria-disabled="true"]) .ff-searchable-list__meta {
  color: var(--text-secondary);
}

.ff-searchable-list__item:has(> [aria-disabled="true"]):active,
.ff-searchable-list__item[aria-disabled="true"]:active {
  background: var(--bg-hover);
}

.ff-searchable-list__empty {
  margin: 0;
  padding: var(--sp-3);
  color: var(--text-secondary);
  font-size: var(--fs-body);
  line-height: 1.5;
  text-align: start;
}

.ff-searchable-list__empty[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .ff-searchable-list__item,
  .ff-searchable-list__all {
    transition: none;
  }
}

@media (forced-colors: active) {
  .ff-searchable-list__item:is(:hover, :focus-within),
  .ff-searchable-list__all:is(:hover, :focus-within) {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }

  .ff-searchable-list__item:is(:hover, :focus-within) .ff-searchable-list__meta {
    color: HighlightText;
  }

  .ff-searchable-list__item:is(a, button):focus-visible,
  .ff-searchable-list__item:has(> input:focus-visible),
  .ff-searchable-list__all:has(> input:focus-visible) {
    outline-color: Highlight;
  }

  .ff-searchable-list__item:has(> [aria-disabled="true"]),
  .ff-searchable-list__item[aria-disabled="true"] {
    color: GrayText;
  }

  .ff-searchable-list__item:has(> [aria-disabled="true"]):is(:hover, :focus-within),
  .ff-searchable-list__item[aria-disabled="true"]:is(:hover, :focus-within) {
    background: Canvas;
    color: GrayText;
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }

  .ff-searchable-list__all::after,
  .ff-searchable-list__item[data-ff-pinned="last"]::after {
    border-top-color: CanvasText;
  }
}

/* src/components/segment/segment.css */
.ff-segment {
  display: inline-flex;
}

.ff-segment__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--h-chip);
  padding: 0 10px;
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: inset 0 0 0 1px var(--border-control);
  color: var(--text-primary);
  font: 400 var(--fs-body)/24px var(--font-sans);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.ff-segment__item + .ff-segment__item {
  margin-left: -1px;
}

.ff-segment__item:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.ff-segment__item:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.ff-segment__item:only-child {
  border-radius: var(--radius-md);
}

/* The radio stays focusable and keeps arrow-key navigation; the label shows its state. */
.ff-segment__item > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.ff-segment__item:where(:not(:has(> input:disabled))):hover {
  background: var(--bg-hover);
}

.ff-segment__item:where(:not(:has(> input:disabled))):active {
  background: var(--bg-pressed);
}

.ff-segment__item:is(:has(> input:checked), [aria-current="page"], [aria-current="true"]) {
  z-index: 1;
  background: var(--action-primary);
  box-shadow: inset 0 0 0 1px var(--action-primary);
  color: var(--text-on-action);
}

.ff-segment__item:is(:has(> input:checked), [aria-current="page"], [aria-current="true"]):where(:not(:has(> input:disabled))):hover {
  background: var(--action-primary-hover);
  box-shadow: inset 0 0 0 1px var(--action-primary-hover);
}

.ff-segment__item:is(:has(> input:checked), [aria-current="page"], [aria-current="true"]):where(:not(:has(> input:disabled))):active {
  background: var(--action-primary-pressed);
  box-shadow: inset 0 0 0 1px var(--action-primary-pressed);
}

.ff-segment__item:has(> input:disabled) {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.ff-segment__item:has(> input:checked:disabled) {
  background: var(--bg-pressed);
  box-shadow: inset 0 0 0 1px var(--border-control);
  color: var(--text-disabled);
}

.ff-segment__item:has(> input:focus-visible),
a.ff-segment__item:focus-visible {
  z-index: 2;
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.ff-segment--lg .ff-segment__item {
  height: var(--h-input);
}

.ff-segment--sm .ff-segment__item {
  height: var(--h-button-s);
  font-size: var(--fs-control);
}

/* Background and inset shadow disappear in forced-colors mode, so the selected item uses system highlight colors. */
@media (forced-colors: active) {
  .ff-segment__item:is(:has(> input:checked), [aria-current="page"], [aria-current="true"]) {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
}

/* src/components/side-panel/side-panel.css */
/* Non-modal panel to the right of the content. Visibility comes from <ff-side-panel open>. */
ff-side-panel {
  display: block;
  min-width: 0;
  min-height: 0;
}

ff-side-panel:not([open]) {
  display: none;
}

.ff-side-panel {
  --ff-side-panel-width: 420px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: var(--ff-side-panel-width);
  max-width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
}

.ff-side-panel__header {
  display: flex;
  align-items: center;
  gap: calc(var(--sp-2) + 2px);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border-default);
}

.ff-side-panel__heading {
  flex: 1;
  min-width: 0;
}

.ff-side-panel__title {
  margin: 0;
  color: var(--text-heading);
  font-size: var(--fs-card-title);
  line-height: 1.3;
  font-weight: 600;
}

.ff-side-panel__meta {
  margin: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ff-side-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--sp-4) var(--sp-5);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ff-side-panel__footer {
  flex: none;
  padding: var(--sp-3) var(--sp-4) var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border-default);
}

/* Below 1024 px the panel floats over the content at the right edge, like a drawer without backdrop. */
@media (max-width: 1023.98px) {
  .ff-side-panel {
    --ff-side-panel-width: 440px;
    position: fixed;
    top: var(--sp-2);
    right: var(--sp-2);
    bottom: var(--sp-2);
    z-index: var(--z-modal);
    width: min(var(--ff-side-panel-width), 100vw - 2 * var(--sp-2));
    height: auto;
    box-shadow: var(--shadow-modal);
  }
}

/* Chat content for the Arti panel (pattern docs/patterns/arti-panel.md). */
.ff-chat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.ff-chat__message--question {
  align-self: flex-end;
  max-width: 85%;
  padding: calc(var(--sp-2) + 2px) var(--sp-3);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-xs) var(--radius-lg);
  background: var(--bg-selected);
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.ff-chat__message--answer,
.ff-chat__busy {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--sp-2) + 2px);
}

.ff-chat__avatar {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.ff-chat__content {
  display: flex;
  flex-direction: column;
  gap: calc(var(--sp-2) + 2px);
  flex: 1;
  min-width: 0;
}

.ff-chat__content > p {
  margin: 0;
}

.ff-chat__source {
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1.4;
}

.ff-chat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.ff-chat__busy {
  align-items: center;
  color: var(--text-secondary);
}

/* Keyframes ff-spin and ff-pulse come from spinner.css. */
.ff-chat__busy > .ff-chat__avatar {
  margin-top: 0;
  animation: ff-spin 1.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.ff-chat__composer {
  position: relative;
  display: flex;
  align-items: flex-end;
}

.ff-chat__composer > .ff-input {
  height: auto;
  min-height: 40px;
  max-height: 160px;
  padding: 9px 48px 9px var(--sp-3);
  border-radius: calc(var(--radius-md) + 2px);
  line-height: 1.45;
  resize: none;
  field-sizing: content;
}

.ff-chat__send {
  position: absolute;
  right: var(--sp-1);
  bottom: var(--sp-1);
  border-color: transparent;
  color: var(--text-on-action);
}

.ff-chat__send:hover {
  background: var(--action-primary-hover);
}

@media (prefers-reduced-motion: reduce) {
  .ff-chat__busy > .ff-chat__avatar {
    animation: ff-pulse 1.2s ease-in-out infinite;
  }
}

/* src/components/skeleton/skeleton.css */
.ff-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  animation: ff-skeleton-pulse 2s ease-in-out infinite;
}

.ff-skeleton__line,
.ff-skeleton__block {
  display: block;
  flex: none;
  width: var(--ff-skeleton-width, 100%);
  max-width: 100%;
  height: var(--ff-skeleton-height, 12px);
  border-radius: var(--radius-xs);
  background: var(--bg-pressed);
}

.ff-skeleton__block {
  height: var(--ff-skeleton-height, 128px);
}

.ff-skeleton__bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: end;
  column-gap: var(--sp-2);
  flex: 1 1 auto;
  min-height: var(--ff-skeleton-height, 160px);
}

.ff-skeleton__bars:not(:first-child) {
  padding-top: var(--sp-2);
}

.ff-skeleton__bar {
  display: block;
  height: 55%;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  background: var(--bg-pressed);
}

/* Fixed height pattern of nine values, repeating from the tenth bar on. */
.ff-skeleton__bar:nth-child(9n + 2) {
  height: 40%;
}

.ff-skeleton__bar:nth-child(9n + 3) {
  height: 70%;
}

.ff-skeleton__bar:nth-child(9n + 4) {
  height: 85%;
}

.ff-skeleton__bar:nth-child(9n + 5) {
  height: 60%;
}

.ff-skeleton__bar:nth-child(9n + 6) {
  height: 50%;
}

.ff-skeleton__bar:nth-child(9n + 7) {
  height: 75%;
}

.ff-skeleton__bar:nth-child(9n + 8) {
  height: 45%;
}

.ff-skeleton__bar:nth-child(9n + 9) {
  height: 65%;
}

@keyframes ff-skeleton-pulse {
  50% {
    opacity: 0.5;
  }
}

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

@media (forced-colors: active) {
  .ff-skeleton__line,
  .ff-skeleton__block,
  .ff-skeleton__bar {
    forced-color-adjust: none;
    background: GrayText;
  }
}

/* src/components/sortable/sortable.css */
/* Reordering for table rows and lists. <ff-sortable> moves the items; this file styles the handle,
   the dragged item, the placeholder and the optional list layout. */
ff-sortable {
  display: block;
}

/* Handle: 32 px button with the drag icon. Resting color stays at --text-secondary (3:1 for
   operable icons, ADR 0005). */
.ff-sortable__handle {
  --ff-sortable-handle-size: 32px;
  display: inline-grid;
  place-items: center;
  flex: none;
  box-sizing: border-box;
  width: var(--ff-sortable-handle-size);
  height: var(--ff-sortable-handle-size);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

[data-ff-sort-item]:hover .ff-sortable__handle {
  color: var(--text-muted);
}

.ff-sortable__handle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

.ff-sortable__handle[aria-pressed="true"] {
  background: var(--status-success-bg);
  color: var(--status-success-fg);
  cursor: grabbing;
}

.ff-sortable__handle[aria-disabled="true"],
[data-ff-sort-item]:hover .ff-sortable__handle[aria-disabled="true"] {
  background: transparent;
  color: var(--text-disabled);
  cursor: not-allowed;
}

/* Handle column in a .ff-table: 40 px, narrower padding than data cells. */
.ff-table__table .ff-sortable__cell {
  width: 40px;
  padding-inline: var(--sp-1);
  text-align: center;
}

/* Item picked up by keyboard. */
[data-ff-grabbed] {
  outline: 1px solid var(--action-primary);
  outline-offset: -1px;
}

/* Item that follows the pointer. The element sets position, size and top. */
[data-ff-dragging] {
  z-index: var(--z-popover);
  box-sizing: border-box;
  margin: 0;
  border-radius: var(--radius-md);
  outline: 1px solid var(--action-primary);
  outline-offset: -1px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-popover);
  cursor: grabbing;
  pointer-events: none;
}

tr[data-ff-dragging] {
  display: table;
  table-layout: fixed;
}

tr[data-ff-dragging] > :is(td, th) {
  border-bottom: 0;
}

/* Placeholder at the drop position, inserted by the element. */
.ff-sortable__placeholder {
  box-sizing: border-box;
  height: var(--ff-sortable-placeholder-height, var(--h-table-row));
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-sortable__placeholder > td {
  height: var(--ff-sortable-placeholder-height, var(--h-table-row));
  padding: var(--sp-2);
}

.ff-sortable__placeholder-box {
  box-sizing: border-box;
  height: 100%;
  min-height: var(--sp-6);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
}

/* Optional list layout for cards and form rows (bakery nested fields). */
.ff-sortable__list {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-sortable__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  box-sizing: border-box;
  min-height: var(--h-table-row);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font: 400 var(--fs-body)/1.4 var(--font-sans);
}

.ff-sortable__label {
  flex: 1;
  min-width: 0;
}

.ff-sortable__moves {
  display: inline-flex;
  flex: none;
  gap: var(--sp-1);
}

/* src/components/spinner/spinner.css */
.ff-spinner {
  display: inline-block;
  flex: none;
  width: var(--ff-spinner-size, 64px);
  height: var(--ff-spinner-size, 64px);
  border: 2px solid transparent;
  border-left-color: var(--border-strong);
  border-radius: var(--radius-pill);
  box-sizing: border-box;
  vertical-align: middle;
  animation: ff-spin 1s linear infinite;
}

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

@keyframes ff-pulse {
  50% {
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ff-spinner {
    animation: ff-pulse 2s ease-in-out infinite;
  }
}

/* src/components/steps/steps.css */
/* The list adapts to its own width (container queries), so the same markup fits a wide wizard and a phone. */
.ff-steps {
  --ff-steps-marker-size: 28px;
  container: ff-steps / inline-size;
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-sans);
}

.ff-steps__item {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
}

/* Connecting line to the next step, centered on the marker. A border, so it stays in forced-colors mode. */
.ff-steps__item:not(:last-child)::after {
  content: "";
  flex: 1 0 var(--sp-4);
  height: 0;
  margin: calc((var(--ff-steps-marker-size) - 2px) / 2) var(--sp-2) 0;
  border-top: 2px solid var(--border-default);
}

.ff-steps__item--done:not(:last-child)::after {
  border-top-color: var(--action-primary);
}

.ff-steps__step {
  position: relative;
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
}

.ff-steps__marker {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--ff-steps-marker-size);
  height: var(--ff-steps-marker-size);
  margin-bottom: var(--sp-1);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.ff-steps__label {
  font-size: var(--fs-control);
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-secondary);
  overflow-wrap: break-word;
  max-width: 100%;
}

.ff-steps__description {
  font-size: var(--fs-caption);
  line-height: 1.4;
  font-weight: 400;
  color: var(--text-secondary);
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Done */
.ff-steps__item--done .ff-steps__marker {
  border-color: var(--action-primary);
  background: var(--action-primary);
  color: var(--text-on-action);
}

.ff-steps__item--done .ff-steps__label {
  color: var(--text-heading);
}

/* Current */
.ff-steps__item[aria-current="step"] .ff-steps__marker {
  border: 2px solid var(--action-primary);
  color: var(--status-success-fg);
  font-weight: 600;
}

.ff-steps__item[aria-current="step"] .ff-steps__label {
  font-weight: 600;
  color: var(--text-primary);
}

/* A done step as link or button jumps back to it. */
.ff-steps__step:is(a, button) {
  cursor: pointer;
}

.ff-steps__step:is(a, button):hover .ff-steps__marker {
  border-color: var(--action-primary-hover);
  background: var(--action-primary-hover);
}

.ff-steps__step:is(a, button):hover .ff-steps__label,
.ff-steps__step:is(a, button):active .ff-steps__label {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ff-steps__step:is(a, button):active .ff-steps__marker {
  border-color: var(--action-primary-pressed);
  background: var(--action-primary-pressed);
}

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

/* Narrow: descriptions, then labels stay for screen readers only (same as .ff-visually-hidden). */
@container ff-steps (width < 560px) {
  .ff-steps__description {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

@container ff-steps (width < 400px) {
  .ff-steps__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (forced-colors: active) {
  .ff-steps__item--done .ff-steps__marker {
    forced-color-adjust: none;
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
  }

  .ff-steps__item[aria-current="step"] .ff-steps__marker,
  .ff-steps__item--done:not(:last-child)::after {
    border-color: Highlight;
  }
}

/* src/components/switch/switch.css */
.ff-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--text-primary);
  font: 500 var(--fs-body)/1.5 var(--font-sans);
  cursor: pointer;
  user-select: none;
}

/* The checkbox stays focusable and keeps the space-key toggle; the track shows its state. */
.ff-switch > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.ff-switch__track {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--border-control);
  box-sizing: border-box;
  transition: background-color var(--dur-base) ease-in-out;
}

.ff-switch__track::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--text-on-action);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--bg-inverse) 10%, transparent), 0 1px 2px -1px color-mix(in srgb, var(--bg-inverse) 10%, transparent);
  pointer-events: none;
  transition: transform var(--dur-base) ease-in-out;
}

.ff-switch > input:checked + .ff-switch__track {
  background: var(--action-primary);
}

.ff-switch > input:checked + .ff-switch__track::before {
  transform: translateX(20px);
}

.ff-switch > input:disabled + .ff-switch__track {
  background: var(--bg-pressed);
}

.ff-switch > input:focus-visible + .ff-switch__track {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.ff-switch__label {
  margin-left: var(--sp-3);
  transition: color var(--dur-fast) var(--ease-out);
}

.ff-switch:hover .ff-switch__label {
  color: var(--action-primary);
}

.ff-switch:has(> input:disabled) {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.ff-switch:has(> input:disabled) .ff-switch__label {
  color: var(--text-disabled);
}

@media (prefers-reduced-motion: reduce) {
  .ff-switch__track,
  .ff-switch__track::before {
    transition: none;
  }
}

/* src/components/table/table.css */
/* Native <table> in a frame. Cells paint the row surface from --ff-table-row-bg, so sticky cells
   cover what scrolls beneath them and hover, selection and the sorted header only swap that variable. */
ff-table {
  display: block;
}

.ff-table {
  --ff-table-row-height: var(--h-table-row);
  --ff-table-cell-px: var(--sp-4);
  --ff-table-sticky-offset: 48px;
  --ff-table-row-bg: var(--bg-surface);
  container: ff-table / inline-size;
  position: relative;
  overflow: clip;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* Without a selection column the sticky first column starts at the left edge. */
.ff-table:not(:has(.ff-table__select)) {
  --ff-table-sticky-offset: 0px;
}

.ff-table--compact {
  --ff-table-row-height: auto;
  --ff-table-cell-px: var(--sp-3);
}

.ff-table--flush {
  border: 0;
  border-radius: 0;
}

.ff-table__scroll {
  overflow-x: auto;
}

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

/* Separate borders: Chrome and Safari drop the borders of collapsed sticky cells. */
.ff-table__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font: 400 var(--fs-body)/1.4 var(--font-sans);
  color: var(--text-primary);
}

.ff-table--compact .ff-table__table {
  font-size: var(--fs-control);
}

.ff-table__table tr {
  background: var(--ff-table-row-bg);
}

/* Every column is as narrow as its content, except the primary column that takes the free space. */
.ff-table__table :is(th, td) {
  box-sizing: border-box;
  width: 1%;
  height: var(--ff-table-row-height);
  padding: var(--sp-2) var(--ff-table-cell-px);
  border-bottom: 1px solid var(--border-row);
  background: var(--ff-table-row-bg);
  font-weight: 400;
  text-align: start;
  vertical-align: middle;
  white-space: nowrap;
}

.ff-table__table thead tr {
  --ff-table-row-bg: var(--bg-subtle);
}

.ff-table__table thead th {
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  font-weight: 500;
}

.ff-table__table tbody:last-child > tr:last-child > :is(th, td) {
  border-bottom: 0;
}

.ff-table__table .ff-table__primary {
  width: auto;
  white-space: normal;
}

.ff-table__table tbody .ff-table__primary a {
  color: var(--text-link);
  font-weight: 500;
  text-decoration: none;
}

.ff-table__table tbody .ff-table__primary a:hover {
  text-decoration: underline;
}

.ff-table__table .ff-table__num {
  text-align: end;
  font-variant-numeric: tabular-nums lining-nums;
}

.ff-table__secondary {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  font-weight: 400;
}

/* Skeleton rows: numbers sit at the end of their cell. */
.ff-table__num .ff-skeleton__line {
  margin-inline-start: auto;
}

/* Sorting */
.ff-table__sort {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.ff-table__sort .ff-icon {
  color: var(--text-muted);
}

.ff-table__sort:hover {
  color: var(--text-heading);
}

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

.ff-table__table th[aria-sort] {
  --ff-table-row-bg: var(--bg-inverse);
  color: var(--text-on-inverse);
}

.ff-table__table th[aria-sort] .ff-table__sort,
.ff-table__table th[aria-sort] .ff-table__sort .ff-icon {
  color: var(--text-on-inverse);
}

.ff-table__table th[aria-sort="ascending"] .ff-table__sort .ff-icon {
  rotate: 180deg;
}

.ff-table__table th[aria-sort] .ff-table__sort:focus-visible {
  outline-color: var(--focus-on-inverse);
}

/* Selection column: the label around the checkbox fills the whole cell as hit area. */
.ff-table__table .ff-table__select {
  position: sticky;
  left: 0;
  z-index: var(--z-sticky);
  width: 48px;
  min-width: 48px;
  padding: 0;
  text-align: center;
}

.ff-table__select > label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ff-table-row-height);
  cursor: pointer;
}

.ff-table__select .ff-checkbox {
  vertical-align: middle;
}

/* Sticky first data column, at most 40 % of the table wide, longer content ends with an ellipsis. */
.ff-table__table .ff-table__sticky {
  position: sticky;
  left: var(--ff-table-sticky-offset);
  z-index: var(--z-sticky);
  max-width: 40cqi;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff-table__sticky > * {
  display: block;
  max-width: 40cqi;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Row actions: sticky at the end, with a soft edge towards the scrolling cells. */
.ff-table__table .ff-table__actions {
  position: sticky;
  right: 0;
  z-index: var(--z-sticky);
  padding-inline: var(--sp-3);
  background: linear-gradient(to right, transparent, var(--ff-table-row-bg) 20%);
  text-align: end;
}

.ff-table__table th.ff-table__actions {
  background: linear-gradient(to right, transparent, var(--ff-table-row-bg) 40%);
}

/* font-size 0 removes the whitespace between the inline buttons, the margin sets the 4 px gap. */
.ff-table__table td.ff-table__actions {
  font-size: 0;
}

.ff-table__actions > * {
  display: inline-flex;
  vertical-align: middle;
}

.ff-table__actions > * + * {
  margin-inline-start: var(--sp-1);
}

.ff-table__table tbody tr:is(:hover, :focus-within) .ff-table__actions .ff-btn--ghost:not(:hover, :active, :disabled, [aria-expanded="true"], [aria-disabled="true"]) {
  border-color: var(--border-control);
  background: var(--bg-surface);
}

/* Row states. Group, empty and skeleton rows do not react to hover. */
.ff-table__table tbody tr:where(:not(.ff-table__group, [aria-hidden="true"], :has(> .ff-table__empty))):hover {
  --ff-table-row-bg: var(--bg-subtle);
}

/* The row whose record is open in a drawer. */
.ff-table__table tbody tr:has(a[aria-current="true"]) {
  --ff-table-row-bg: var(--bg-selected);
}

/* Selected rows keep their surface on hover (--text-secondary on --bg-selected-hover is below 4.5:1). */
.ff-table__table tbody tr:has(> .ff-table__select input:checked) {
  --ff-table-row-bg: var(--bg-selected);
}

.ff-table__table tbody tr:has(> .ff-table__select input:checked) > :is(th, td),
.ff-table__table tbody tr:has(+ tr > .ff-table__select input:checked) > :is(th, td),
.ff-table__table thead:has(+ tbody > tr:first-child > .ff-table__select input:checked) th {
  border-bottom-color: var(--border-selected);
}

/* Group row: "So, 23.08.2026 · 4 Bestellungen" */
.ff-table__table .ff-table__group > :is(th, td) {
  --ff-table-row-bg: var(--bg-subtle);
  height: auto;
  padding: var(--sp-2) var(--ff-table-cell-px);
  color: var(--text-secondary);
  font-size: var(--fs-control);
  font-weight: 400;
}

.ff-table__group strong {
  color: var(--text-heading);
  font-weight: 600;
}

/* Empty state or error notice across all columns. */
.ff-table__table .ff-table__empty {
  width: auto;
  height: auto;
  padding: var(--sp-5);
  text-align: start;
  white-space: normal;
}

/* Footer: "1–25 von 312" and paging. */
.ff-table__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border-row);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: var(--fs-control);
  font-variant-numeric: tabular-nums;
}

.ff-table__footer > * {
  margin: 0;
}

.ff-table__footer > nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-inline-start: auto;
}

.ff-table__footer .ff-btn[aria-current="page"] {
  border-color: var(--border-control);
  background: var(--bg-surface);
  color: var(--text-heading);
}

/* Optional columns and page numbers give way in narrow containers (drawer, half-width card, tablet). */
@container ff-table (width < 760px) {
  .ff-table__optional {
    display: none;
  }
}

@container ff-table (width < 640px) {
  .ff-table__footer > nav > :not(:first-child, :last-child) {
    display: none;
  }
}

@media (forced-colors: active) {
  .ff-table__table :is(.ff-table__select, .ff-table__sticky, .ff-table__actions) {
    background: Canvas;
  }

  .ff-table__table tbody tr:has(> .ff-table__select input:checked) {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }

  .ff-table__table tbody tr:has(> .ff-table__select input:checked) > :is(th, td) {
    border-bottom-color: Highlight;
  }

  .ff-table__table th[aria-sort] .ff-table__sort {
    text-decoration: underline;
  }
}

/* src/components/tabs/tabs.css */
/* The bottom line is an inset shadow so the 2px item underline can cover it inside the scroll container. */
.ff-tabs {
  display: flex;
  gap: var(--sp-8);
  padding: 0 var(--sp-4);
  box-shadow: inset 0 -1px 0 var(--border-row);
  overflow-x: auto;
}

.ff-tabs__item {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--sp-1);
  height: var(--h-button-m);
  margin: 0;
  padding: 0 var(--sp-1);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: 500 var(--fs-body)/1 var(--font-sans);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.ff-tabs__item:hover {
  border-bottom-color: var(--border-default);
  color: var(--text-primary);
}

.ff-tabs__item:is([aria-current="page"], [aria-current="true"], [aria-selected="true"]) {
  border-bottom-color: var(--action-primary);
  color: var(--text-primary);
  font-weight: 600;
}

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

.ff-tabs__item > .ff-icon {
  margin-left: calc(-1 * var(--sp-1));
}

.ff-tabs__item > .ff-count {
  margin-left: var(--sp-2);
}

.ff-tabs__item:is([aria-current="page"], [aria-current="true"], [aria-selected="true"]) > .ff-count:not(.ff-count--important) {
  background: var(--status-info-bg);
  color: var(--status-info-fg);
}

/* The inset shadow disappears in forced-colors mode; a border keeps the baseline visible. */
@media (forced-colors: active) {
  .ff-tabs {
    border-bottom: 1px solid CanvasText;
  }
}

/* src/components/toast/toast.css */
/* Stack of toasts: <ff-toaster popover="manual">, kept open as live region and landmark. */
ff-toaster {
  --ff-toast-width: 380px;
  --ff-toast-inset: var(--sp-6);
  --ff-toast-inset-bottom: var(--ff-toast-inset);
  box-sizing: border-box;
  position: fixed;
  inset: auto;
  inset-inline-end: var(--ff-toast-inset);
  inset-block-end: calc(var(--ff-toast-inset-bottom) + env(safe-area-inset-bottom, 0px));
  width: min(var(--ff-toast-width), 100% - 2 * var(--ff-toast-inset));
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font-sans);
  pointer-events: none;
}

ff-toaster:popover-open {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

@supports not selector(:popover-open) {
  ff-toaster {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    z-index: var(--z-toast);
  }
}

@media (max-width: 639.98px) {
  ff-toaster {
    --ff-toast-inset: var(--sp-4);
    inset-inline: var(--ff-toast-inset);
    width: auto;
  }
}

.ff-toast {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "icon title close"
    "icon text close"
    "icon action close";
  align-items: start;
  column-gap: var(--sp-3);
  row-gap: 0;
  width: 100%;
  min-width: 0;
  padding: var(--sp-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-popover);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.5;
  pointer-events: auto;
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

@starting-style {
  .ff-toast {
    opacity: 0;
    transform: translateY(var(--sp-2));
  }
}

.ff-toast[data-ff-leaving] {
  opacity: 0;
  transform: translateY(var(--sp-2));
  pointer-events: none;
  transition-duration: var(--dur-fast);
}

.ff-toast--success {
  background: var(--status-success-bg);
  border-color: var(--chip-border-soft);
  color: var(--status-success-fg);
}

.ff-toast--info {
  background: var(--status-info-bg);
  border-color: transparent;
  color: var(--status-info-fg);
}

.ff-toast--warning {
  background: var(--status-warning-bg);
  border-color: var(--status-warning-border);
  color: var(--status-warning-text);
}

.ff-toast--error {
  background: var(--status-error-bg);
  border-color: var(--status-error-border);
  color: var(--status-error-fg);
}

.ff-toast__icon {
  grid-area: icon;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--size-icon-button);
  height: var(--size-icon-button);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.ff-toast__title {
  grid-area: title;
  margin: 0;
  padding-block-start: calc((var(--size-icon-button) - var(--fs-body) * 1.5) / 2);
  color: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ff-toast__text {
  grid-area: text;
  margin: var(--sp-1) 0 0;
  color: inherit;
  font-size: var(--fs-control);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ff-toast__text a {
  color: inherit;
  font-weight: 500;
  text-decoration: underline;
}

/* Outline button in the status color. Two classes, so it wins over .ff-btn--secondary in any order. */
.ff-toast .ff-toast__action {
  grid-area: action;
  justify-self: start;
  margin-block-start: var(--sp-2);
  border-color: currentColor;
  background: transparent;
  color: inherit;
}

.ff-toast .ff-toast__close {
  grid-area: close;
  align-self: start;
  background: transparent;
  color: inherit;
}

.ff-toast .ff-toast__action:hover,
.ff-toast .ff-toast__close:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.ff-toast .ff-toast__action:active,
.ff-toast .ff-toast__close:active {
  background: color-mix(in srgb, currentColor 16%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .ff-toast {
    transition: opacity var(--dur-fast) var(--ease-out);
  }

  @starting-style {
    .ff-toast {
      transform: none;
    }
  }

  .ff-toast[data-ff-leaving] {
    transform: none;
  }
}

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

/* src/components/tooltip/tooltip.css */
/* Tooltip on a native [popover] (hint or manual). <ff-tooltip> positions it and sets data-side
   (top | bottom | left | right) plus --ff-tooltip-arrow-x / -y when it was shifted to stay in the window. */
.ff-tooltip {
  --ff-tooltip-max-width: 240px;
  --ff-tooltip-offset: var(--sp-2);
  --ff-tooltip-arrow: 8px;
  box-sizing: border-box;
  inset: auto;
  width: max-content;
  max-width: min(var(--ff-tooltip-max-width), 100vw - 2 * var(--sp-2));
  margin: 0;
  padding: 6px var(--sp-3);
  overflow: visible;
  border: 1px solid var(--border-inverse);
  border-radius: var(--radius-xs);
  background: var(--bg-inverse);
  color: var(--text-on-inverse);
  font-family: var(--font-sans);
  font-size: var(--fs-control);
  line-height: 1.4;
  font-weight: 400;
  text-align: start;
  white-space: normal;
  overflow-wrap: break-word;
  pointer-events: auto;
  cursor: default;
  opacity: 0;
  transition:
    opacity var(--dur-fast) var(--ease-out),
    display var(--dur-fast) allow-discrete,
    overlay var(--dur-fast) allow-discrete;
}

.ff-tooltip:popover-open {
  opacity: 1;
}

@starting-style {
  .ff-tooltip:popover-open {
    opacity: 0;
  }
}

@supports not selector(:popover-open) {
  .ff-tooltip {
    z-index: var(--z-tooltip);
  }
}

/* Arrow: a rotated square centered on the edge towards the trigger, outlined on its two outer edges. */
.ff-tooltip::before {
  content: "";
  position: absolute;
  box-sizing: border-box;
  width: var(--ff-tooltip-arrow);
  height: var(--ff-tooltip-arrow);
  border: 1px solid transparent;
  background: var(--bg-inverse);
  transform: rotate(45deg);
  left: calc(var(--ff-tooltip-arrow-x, 50%) - var(--ff-tooltip-arrow) / 2);
  bottom: calc(var(--ff-tooltip-arrow) / -2);
  border-right-color: var(--border-inverse);
  border-bottom-color: var(--border-inverse);
}

.ff-tooltip[data-side="bottom"]::before {
  top: calc(var(--ff-tooltip-arrow) / -2);
  bottom: auto;
  border-color: transparent;
  border-top-color: var(--border-inverse);
  border-left-color: var(--border-inverse);
}

.ff-tooltip:is([data-side="left"], [data-side="right"])::before {
  top: calc(var(--ff-tooltip-arrow-y, 50%) - var(--ff-tooltip-arrow) / 2);
  bottom: auto;
  border-color: transparent;
}

.ff-tooltip[data-side="left"]::before {
  left: auto;
  right: calc(var(--ff-tooltip-arrow) / -2);
  border-top-color: var(--border-inverse);
  border-right-color: var(--border-inverse);
}

.ff-tooltip[data-side="right"]::before {
  left: calc(var(--ff-tooltip-arrow) / -2);
  border-bottom-color: var(--border-inverse);
  border-left-color: var(--border-inverse);
}

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

/* src/components/topbar/topbar.css */
/* Bar above the content: menu button (below 1024 px), navigation search, actions and user menu. */
.ff-topbar {
  --ff-topbar-height: 56px;
  container: ff-topbar / inline-size;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  box-sizing: border-box;
  min-height: var(--ff-topbar-height);
  padding: 0 var(--sp-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
}

.ff-topbar__menu {
  flex: none;
  margin-inline-start: calc(var(--sp-2) * -1);
}

.ff-topbar__search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 420px;
}

.ff-topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-inline-start: auto;
}

/* Trigger of the user menu: .ff-btn.ff-btn--ghost with .ff-avatar, name and chevron. */
.ff-topbar__user {
  gap: var(--sp-2);
  max-width: 240px;
  padding: 0 var(--sp-2);
  color: var(--text-primary);
  font-weight: 400;
}

.ff-topbar__user > :not(.ff-avatar, .ff-icon) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ff-topbar__user > .ff-icon {
  color: var(--text-secondary);
}

@media (min-width: 1024px) {
  .ff-topbar__menu {
    display: none;
  }
}

@media (max-width: 639.98px) {
  .ff-topbar {
    padding: 0 var(--sp-3);
  }
}

/* The name stays readable for screen readers; the avatar alone marks the button. */
@container ff-topbar (width < 560px) {
  .ff-topbar__user > :not(.ff-avatar, .ff-icon) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
}
