/* 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;
  --text-on-error: #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-success-border: #BDD5D6;
  --status-info-bg: #E3EEF6;
  --status-info-fg: #1D4E6E;
  --status-info-border: #BBCEDB;
  --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-revenue: #2F5B64;
  --chart-reference: var(--border-strong);
  --chart-waste: #C4604C;
  --chart-waste-rate: #B7791F;
  --chart-compare-revenue: #8FB3B7;
  --chart-compare-waste: #EDB9AD;
  --chart-series-1: var(--chart-revenue);
  --chart-series-2: var(--chart-waste);
  --chart-series-3: var(--chart-waste-rate);
  --chart-series-4: #4F7F3A;
  --chart-series-5: #7A5A9A;
  --chart-series-6: #2F7FA8;
  --chart-other: #8A9EA6;
  --icon-area: rgba(180,225,215,0.6);
  --scrim-modal: rgba(15,42,53,0.65);
  --scrim-drawer: rgba(15,42,53,0.3);
  --media-badge-bg: rgba(15,42,53,0.82);
  --media-badge-fg: #FFFFFF;
  --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-touch: 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-chip-sm: 28px;
  --h-input: 40px;
  --h-pill: 24px;
  --h-pill-sm: 20px;
  --h-menu-item: 36px;
  --h-table-row: 49px;
  --h-touch: 48px;
  --size-icon-button: 32px;
  --size-icon: 16px;
  --size-icon-md: 20px;
  --size-icon-lg: 24px;
  --size-icon-xl: 32px;
  --size-icon-2xl: 48px;
  --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;
  --text-on-error: #0E1F26;
  --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-success-border: #2E5959;
  --status-info-bg: #16314A;
  --status-info-fg: #9CC4E6;
  --status-info-border: #314E69;
  --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-revenue: #6FA7B0;
  --chart-reference: var(--border-strong);
  --chart-waste: #E8A090;
  --chart-waste-rate: #F2C878;
  --chart-compare-revenue: #4F7A80;
  --chart-compare-waste: #7A4A40;
  --chart-series-1: var(--chart-revenue);
  --chart-series-2: var(--chart-waste);
  --chart-series-3: var(--chart-waste-rate);
  --chart-series-4: #A3C98A;
  --chart-series-5: #C2A8E0;
  --chart-series-6: #86C4E6;
  --chart-other: #5E737B;
  --icon-area: rgba(180,225,215,0.16);
  --scrim-modal: rgba(0,0,0,0.72);
  --scrim-drawer: rgba(0,0,0,0.4);
  --media-badge-bg: rgba(0,0,0,0.78);
  --media-badge-fg: #FFFFFF;
  --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;
    --text-on-error: #0E1F26;
    --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-success-border: #2E5959;
    --status-info-bg: #16314A;
    --status-info-fg: #9CC4E6;
    --status-info-border: #314E69;
    --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-revenue: #6FA7B0;
    --chart-reference: var(--border-strong);
    --chart-waste: #E8A090;
    --chart-waste-rate: #F2C878;
    --chart-compare-revenue: #4F7A80;
    --chart-compare-waste: #7A4A40;
    --chart-series-1: var(--chart-revenue);
    --chart-series-2: var(--chart-waste);
    --chart-series-3: var(--chart-waste-rate);
    --chart-series-4: #A3C98A;
    --chart-series-5: #C2A8E0;
    --chart-series-6: #86C4E6;
    --chart-other: #5E737B;
    --icon-area: rgba(180,225,215,0.16);
    --scrim-modal: rgba(0,0,0,0.72);
    --scrim-drawer: rgba(0,0,0,0.4);
    --media-badge-bg: rgba(0,0,0,0.78);
    --media-badge-fg: #FFFFFF;
    --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;
}

/* Test comment */

:where(strong, b) {
  font-weight: 600;
}

: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/density.css */
/* Touch density (docs/decisions/0011-touch-dichte.md): .ff-touch on any ancestor raises all controls
   inside to --h-touch. Components read their heights from these tokens, so no modifiers are needed.
   The tokens on :root are unlayered and would win over this layered rule on <html> itself, so
   .ff-touch on <html> sets them on <body>, from where they inherit. */
.ff-touch,
:root.ff-touch > body {
  --h-button-m: var(--h-touch);
  --h-button-s: var(--h-touch);
  --h-input: var(--h-touch);
  --h-chip: var(--h-touch);
  --h-chip-sm: var(--h-touch);
  --h-menu-item: var(--h-touch);
  --size-icon-button: var(--h-touch);
}

/* src/foundations/icons.css */
/*
 * Icons from src/icons/, inline in <svg class="ff-icon" viewBox="0 0 24 24">. Color always comes from currentColor.
 * The body holds one group per drawing, classed with the sizes it serves:
 *   .ff-icon__s 16 px, .ff-icon__m 20 to 32 px, .ff-icon__l 48 px (drawn on 48 × 48, scaled by 0.5).
 * Stroke widths are screen pixels (non-scaling-stroke), so they hold for every drawing and grid.
 */
.ff-icon {
  width: var(--size-icon);
  height: var(--size-icon);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25px;
  stroke-linecap: butt;
  stroke-linejoin: round;
}

.ff-icon :is(path, circle, rect, line, polyline) {
  vector-effect: non-scaling-stroke;
}

.ff-icon > g {
  display: none;
}

.ff-icon:not(.ff-icon--md, .ff-icon--lg, .ff-icon--xl, .ff-icon--2xl) > .ff-icon__s,
.ff-icon:is(.ff-icon--md, .ff-icon--lg, .ff-icon--xl) > .ff-icon__m,
.ff-icon--2xl > .ff-icon__l {
  display: inline;
}

/* Area shapes in mint, only from 32 px on. */
.ff-icon__area {
  display: none;
  fill: var(--icon-area);
  stroke: none;
}

.ff-icon:is(.ff-icon--xl, .ff-icon--2xl) .ff-icon__area {
  display: inline;
}

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

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

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

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

/* 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;
}

/* Bulleted list with the native marker. */
.ff-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin: 0;
  padding-inline-start: var(--sp-5);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text-primary);
}

.ff-list > li::marker {
  color: var(--text-secondary);
}

/* Numbered instructions with the number in a circle. Needs role="list" on the <ol> (Safari). */
.ff-list--steps {
  --ff-list-marker-size: 24px;
  counter-reset: ff-step;
  gap: var(--sp-2);
  padding-inline-start: 0;
  list-style: none;
  line-height: 1.5;
}

.ff-list--steps > li {
  position: relative;
  min-height: var(--ff-list-marker-size);
  padding-inline-start: calc(var(--ff-list-marker-size) + var(--sp-3));
  /* First line centered on the circle. */
  padding-top: calc((var(--ff-list-marker-size) - 1.5em) / 2);
  box-sizing: border-box;
  counter-increment: ff-step;
}

.ff-list--steps > li::before {
  content: counter(ff-step);
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ff-list-marker-size);
  height: var(--ff-list-marker-size);
  border-radius: var(--radius-pill);
  background: var(--bg-page);
  color: var(--text-heading);
  font-size: var(--fs-caption);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
}

@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);
}

/* Parts of the head: icon of the section's kind, count after the title, aside (quota, "read only") before the chevron. */
.ff-accordion__icon {
  flex: none;
  color: var(--text-secondary);
}

.ff-accordion__head > .ff-count {
  flex: none;
  margin-left: calc(var(--sp-2) - var(--sp-3));
}

.ff-accordion__aside {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
  font: 400 var(--fs-caption)/1.4 var(--font-sans);
  color: var(--text-secondary);
  white-space: nowrap;
}

.ff-accordion__aside ~ .ff-accordion__chevron {
  margin-left: 0;
}

/*
 * Section with an action: the button sits next to <summary>, never inside it.
 * <details> spans the section grid and passes its columns on via subgrid, so <summary>
 * takes column 1 and the content (::details-content) runs below both columns.
 */
.ff-accordion-section {
  container: ff-accordion-section / inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: var(--sp-3);
}

.ff-accordion-section > .ff-accordion {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
}

.ff-accordion-section > .ff-accordion > .ff-accordion__head {
  grid-column: 1;
  grid-row: 1;
  /* The aside moves to a second line instead of running into the action. */
  flex-wrap: wrap;
  row-gap: var(--sp-1);
  padding-block: var(--sp-2);
}

.ff-accordion-section > .ff-accordion::details-content {
  grid-column: 1 / -1;
  grid-row: 2;
}

.ff-accordion-section__action {
  position: relative;
  /* Above the details box, which spans the same cell. */
  z-index: 1;
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-items: center;
  gap: var(--sp-2);
  min-height: 52px;
}

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

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

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

@container ff-accordion-section (width < 480px) {
  /* Icon, title, count and chevron stay in the first line; the title wraps inside instead. */
  .ff-accordion-section .ff-accordion__title {
    min-width: 0;
    max-width: calc(100% - 96px);
  }

  .ff-accordion-section .ff-accordion__aside {
    flex-basis: 100%;
    flex-wrap: wrap;
    order: 10;
    margin-left: 0;
    white-space: normal;
  }

  .ff-accordion-section .ff-bar-quota {
    flex-wrap: wrap;
  }

  .ff-accordion-section .ff-bar-quota__text {
    white-space: normal;
  }

  .ff-accordion-section .ff-accordion__aside ~ .ff-accordion__chevron {
    margin-left: auto;
  }
}

/* Browsers without ::details-content: the action is laid over the end of the head instead. */
@supports not selector(::details-content) {
  .ff-accordion-section {
    position: relative;
    display: block;
  }

  .ff-accordion-section > .ff-accordion {
    display: block;
  }

  .ff-accordion-section__action {
    position: absolute;
    top: 0;
    right: 0;
  }

  .ff-card > .ff-accordion-section > .ff-accordion-section__action {
    right: var(--sp-4);
  }

  .ff-accordion-section > .ff-accordion > .ff-accordion__head {
    padding-inline-end: var(--ff-accordion-action-space, 180px);
  }
}

@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;
}

/* Tiles: few key values as small tiles, e.g. in a modal. Overrides the side-by-side layout of the container query. */
.ff-attribute-list--tiles {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
  gap: var(--sp-2);
}

.ff-attribute-list.ff-attribute-list--tiles .ff-attribute-list__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}

.ff-attribute-list--tiles .ff-attribute-list__label {
  font-weight: 400;
  line-height: 1.4;
}

.ff-attribute-list.ff-attribute-list--tiles .ff-attribute-list__value {
  font-size: var(--fs-card-title);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-heading);
  text-align: left;
  overflow-wrap: anywhere;
}

/* src/components/avatar/avatar.css */
.ff-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--ff-avatar-size, 24px);
  height: var(--ff-avatar-size, 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;
}

/* Stack of up to three avatars, followed by a label or a "+n" avatar. The first one lies on top. */
.ff-avatar-group {
  display: inline-flex;
  align-items: center;
}

.ff-avatar-group > .ff-avatar {
  position: relative;
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.ff-avatar-group > .ff-avatar + .ff-avatar {
  margin-left: -4px;
}

.ff-avatar-group > .ff-avatar:nth-child(1) {
  z-index: 3;
}

.ff-avatar-group > .ff-avatar:nth-child(2) {
  z-index: 2;
}

.ff-avatar-group > .ff-avatar:nth-child(3) {
  z-index: 1;
}

.ff-avatar--more {
  width: auto;
  min-width: var(--ff-avatar-size, 24px);
  padding-inline: var(--sp-1);
  background: var(--bg-pressed);
  color: var(--text-heading);
  font-size: var(--fs-micro);
}

.ff-avatar-group__label {
  margin-left: var(--sp-2);
  font: 400 var(--fs-caption)/1.4 var(--font-sans);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Square avatar for things (article image, product icon) instead of people. */
.ff-avatar--square {
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.ff-avatar--square > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ff-avatar--square > .ff-icon {
  width: max(var(--size-icon), 50%);
  height: max(var(--size-icon), 50%);
}

/* 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);
}

/* Quota: a short bar with its value as text, e.g. "210 von 2.000 Zeichen". */
.ff-bar-quota {
  --ff-bar-quota-width: 120px;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.ff-bar-quota > .ff-bar {
  flex: none;
  width: var(--ff-bar-quota-width);
}

.ff-bar-quota__text {
  font: 400 var(--fs-caption)/1.4 var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

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

/*
 * Target range: band (corridor), plan line and actual dot on one scale.
 * Values are unitless numbers 0–100; the scale is inset by half the dot so 0 and 100 are not clipped.
 */
.ff-bar--range {
  --ff-bar-inset: 6px;
  --ff-bar-track: calc(100% - 2 * var(--ff-bar-inset));
  position: relative;
  display: block;
  height: 20px;
  overflow: visible;
  border-radius: 0;
  background: none;
}

.ff-bar--range::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 9px;
  height: 2px;
  background: var(--border-row);
}

.ff-bar--range > * {
  position: absolute;
  box-sizing: border-box;
}

.ff-bar__band {
  top: 4px;
  left: calc(var(--ff-bar-inset) + var(--ff-bar-track) * var(--ff-bar-from) / 100);
  width: calc(var(--ff-bar-track) * (var(--ff-bar-to) - var(--ff-bar-from)) / 100);
  height: 12px;
  border: 1px solid var(--status-success-border);
  border-radius: var(--radius-xs);
  background: var(--status-success-bg);
}

.ff-bar__plan {
  top: 1px;
  left: calc(var(--ff-bar-inset) + var(--ff-bar-track) * var(--ff-bar-plan) / 100);
  width: 2px;
  height: 18px;
  margin-left: -1px;
  background: var(--chart-reference);
}

.ff-bar__actual {
  top: 4px;
  left: calc(var(--ff-bar-inset) + var(--ff-bar-track) * var(--ff-bar-actual) / 100);
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: var(--radius-pill);
  background: var(--ff-bar-actual-color, var(--text-heading));
  box-shadow: 0 0 0 2px var(--bg-surface);
}

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

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

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

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

  .ff-bar__plan,
  .ff-bar__actual {
    forced-color-adjust: none;
  }

  .ff-bar__plan {
    background: CanvasText;
  }

  .ff-bar__actual {
    background: Highlight;
  }
}

@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-error);
}

.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);
}

/* Destructive icon button, e.g. delete in a row: keeps the danger colors over the neutral icon defaults. */
.ff-btn--icon.ff-btn--danger {
  border-color: var(--status-error-border);
  color: var(--status-error-fg);
}

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

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

.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);
}

/* Touch density: labels read at arm's length, in the same size as the type in fields. */
.ff-touch .ff-btn {
  font-size: var(--fs-touch);
}

/* 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: flex-start;
  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);
}

/* Icon of the card's subject (area, topic). Top-aligned with the title line when a subtitle follows. */
.ff-card__icon {
  flex: none;
  width: var(--size-icon-md);
  height: var(--size-icon-md);
  color: var(--text-secondary);
}

.ff-card__icon:has(+ * .ff-card__subtitle) {
  align-self: flex-start;
}

.ff-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  /* Sticks to the bottom when the card is a flex column (card grid). */
  margin-top: auto;
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border-default);
}

.ff-card__footer > :is(.ff-btn, a, button):last-child {
  margin-left: auto;
}

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

/* Quiet card: a group inside a modal or another card, without a line below the head. */
.ff-card--subtle {
  background: var(--bg-subtle);
}

.ff-card--subtle > .ff-card__head {
  padding-bottom: 0;
  border-bottom: 0;
}

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

.ff-card--subtle > .ff-card__body:only-child {
  padding: var(--sp-4);
}

/* Grid of equal cards. Cards in a row share their height, footers line up. */
.ff-card-grid {
  --ff-card-grid-min: 320px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--ff-card-grid-min)), 1fr));
  gap: var(--sp-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-card-grid > li {
  display: flex;
  min-width: 0;
}

.ff-card-grid > li > .ff-card,
.ff-card-grid > .ff-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.ff-card-grid .ff-card__body:not(:last-child) {
  flex: 1;
}

/* 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;
}

/* Deprecated: use .ff-chart__reference. Removed in the next major version. */
.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;
}

/* Stacked bars: a 2px seam in the surface color between segments. */
.ff-chart__group--stacked .ff-chart__bar {
  stroke: var(--bg-surface);
  stroke-width: 2;
}

.ff-chart__line--cumulative {
  --ff-chart-color: var(--text-primary);
  stroke-width: 2;
}

.ff-chart__bubble {
  fill: var(--ff-chart-color, var(--chart-other));
  fill-opacity: 0.75;
  stroke: var(--bg-surface);
  stroke-width: 1.5;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.ff-chart__canvas:has(.ff-chart__bubble:hover) .ff-chart__bubble:not(:hover) {
  opacity: 0.35;
}

/* Annotations: neutral color, never a series color, so a target never reads as another figure.
   Layer order in the SVG, bottom to top: __band, __grid, __band-edge, data marks, __reference, __event,
   labels, __crosshair and __point. */
.ff-chart__reference {
  fill: none;
  stroke: var(--chart-reference);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.ff-chart__event {
  stroke: var(--text-secondary);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.ff-chart__event-marker {
  fill: var(--text-secondary);
}

.ff-chart__band {
  fill: var(--status-success-bg);
}

.ff-chart__band-edge {
  stroke: var(--status-success-border);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

/* Labels sit on top of data; the surface-colored halo keeps them readable. */
.ff-chart__reference-label,
.ff-chart__event-label,
.ff-chart__value {
  fill: var(--text-primary);
  font: 500 var(--fs-caption) var(--font-sans);
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: var(--bg-surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.ff-chart__quadrant-label {
  fill: var(--text-secondary);
  font: 400 var(--fs-caption) var(--font-sans);
}

/* Second axis: numbers stay --text-secondary (contrast), the axis line carries the series color. */
.ff-chart__axis--secondary {
  text-anchor: start;
}

.ff-chart__axis-line {
  stroke: var(--ff-chart-color, var(--border-strong));
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.ff-chart__axis-title {
  fill: var(--text-secondary);
  font: 500 var(--fs-caption) var(--font-sans);
}

.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);
}

.ff-chart__swatch--reference {
  width: 16px;
  height: 2px;
  border-radius: 0;
  background: repeating-linear-gradient(90deg, var(--chart-reference) 0 6px, transparent 6px 10px);
}

.ff-chart__swatch--band {
  background: var(--status-success-bg);
  box-shadow: inset 0 0 0 1px var(--status-success-border);
}

.ff-chart__legend-separator {
  align-self: center;
  width: 1px;
  height: 16px;
  background: var(--border-default);
}

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

/* 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;
}

.ff-chart__tooltip-row--total {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-default);
}

.ff-chart__tooltip-row--total .ff-chart__tooltip-label {
  font-weight: 500;
  color: var(--text-primary);
}

.ff-chart__tooltip-swatch--event {
  justify-self: center;
  width: 2px;
  border-radius: 0;
  background: var(--text-secondary);
}

/* Weather row: HTML below the x axis, one column per day, aligned with the plot area through
   --ff-chart-plot-start and --ff-chart-plot-end. */
.ff-chart__days {
  display: grid;
  grid-template-columns: repeat(var(--ff-chart-days, 7), minmax(0, 1fr));
  margin: calc(-1 * var(--sp-2)) 0 0;
  padding: 0 var(--ff-chart-plot-end, 0px) 0 var(--ff-chart-plot-start, 0px);
  list-style: none;
  font: 400 var(--fs-caption)/1.3 var(--font-sans);
  color: var(--text-secondary);
  text-align: center;
}

.ff-chart__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  min-width: 0;
}

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

.ff-chart__day-value {
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.ff-chart__day > .ff-pill {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Narrow: event labels and temperatures give way; the event marker stays. */
@container ff-chart (width < 480px) {
  .ff-chart__event-label,
  .ff-chart__day-value {
    display: none;
  }
}

/* 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,
.ff-chip--sm[aria-pressed="true"] {
  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):is(.ff-chip--active, .ff-chip--sm[aria-pressed="true"]):where(:not(:disabled, [aria-disabled="true"])):hover {
  background: var(--chip-hover);
}

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

/* Small chips for quick picks above a searchable list. */
.ff-chip--sm {
  --ff-chip-sm-padding-inline: 10px;
  gap: var(--sp-1);
  height: var(--h-chip-sm);
  padding: 0 var(--ff-chip-sm-padding-inline);
  font-size: var(--fs-control);
}

.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;
}

/* Touch density: labels in the same size as the type in fields, hit area of __remove 48 × 48 px. */
.ff-touch .ff-chip {
  font-size: var(--fs-touch);
}

.ff-touch .ff-chip__remove::after {
  inset: -12px;
}

/* src/components/choices/choices.css */
/* --ff-choices-item-min-height follows --h-input, so .ff-touch raises every item to the touch height. */
.ff-choices {
  --ff-choices-item-min-height: var(--h-input);
  --ff-choices-min-width: 200px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--ff-choices-min-width), 1fr));
  gap: var(--sp-2);
}

.ff-choices__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-height: var(--ff-choices-item-min-height);
  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);
}

/* Selected: tinted surface and teal border (ADR 0006, choice cards). */
.ff-choices__item:has(> input:checked) {
  border-color: var(--action-primary);
  background: var(--bg-selected);
}

.ff-choices__item:has(> input:checked):where(:not(:has(> input:disabled))):is(:hover, :active) {
  border-color: var(--action-primary);
  background: var(--bg-selected-hover);
}

.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);
}

/* List: one option per row, icon tile on the left, group labels in between. */
.ff-choices--list {
  --ff-choices-icon-size: 40px;
  --ff-choices-list-padding-block: 10px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.ff-choices--list > .ff-choices__item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px var(--sp-3);
  padding: var(--ff-choices-list-padding-block) var(--sp-3);
  border-color: transparent;
  background: transparent;
}

.ff-choices--list > .ff-choices__item:not(:has(> .ff-choices__icon)) {
  grid-template-columns: 1fr;
}

.ff-choices--list > .ff-choices__item:has(> .ff-choices__icon) > :is(.ff-choices__title, .ff-choices__description) {
  grid-column: 2;
}

.ff-choices--list > .ff-choices__item:where(:not(:has(> input:disabled))):hover {
  border-color: transparent;
  background: var(--bg-hover);
}

.ff-choices--list > .ff-choices__item:has(> input:checked) {
  border-color: var(--action-primary);
  background: var(--bg-selected);
}

.ff-choices--list > .ff-choices__item:has(> input:checked):where(:not(:has(> input:disabled))):is(:hover, :active) {
  border-color: var(--action-primary);
  background: var(--bg-selected-hover);
}

.ff-choices--list > .ff-choices__item:has(> input:not(:checked):disabled) {
  border-color: transparent;
}

.ff-choices--list > .ff-choices__item:has(> input:disabled) {
  background: var(--bg-subtle);
}

.ff-choices__icon {
  display: inline-flex;
  grid-row: 1 / span 2;
  align-items: center;
  justify-content: center;
  width: var(--ff-choices-icon-size);
  height: var(--ff-choices-icon-size);
  border-radius: var(--radius-md);
  background: var(--bg-selected);
  color: var(--status-success-fg);
}

/* The tile has the selected surface itself, so it turns white on a selected item to stay visible. */
.ff-choices__item:has(> input:checked) > .ff-choices__icon {
  background: var(--bg-surface);
}

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

.ff-choices__group-label {
  margin: var(--sp-5) 0 2px;
  padding: 0 var(--sp-1);
  color: var(--text-secondary);
  font: 500 var(--fs-caption)/1.5 var(--font-sans);
}

.ff-choices__group-label:first-child {
  margin-top: 0;
}

/* Grid: five to about eight cards with a short description, columns as many as fit. auto-fill keeps
   the column width when there are few cards, so a row of three doesn't stretch across a wide dialog. */
.ff-choices--grid {
  --ff-choices-min-width: 150px;
  --ff-choices-item-min-height: 88px;
  --ff-choices-icon-size: 32px;
  grid-template-columns: repeat(auto-fill, minmax(var(--ff-choices-min-width), 1fr));
}

.ff-touch .ff-choices--grid {
  --ff-choices-item-min-height: 96px;
}

.ff-choices--grid > .ff-choices__item > .ff-choices__icon {
  margin-bottom: var(--sp-1);
}

/* Compact: short values (quantities, amounts) without description, single-line like a control. */
.ff-choices--compact {
  --ff-choices-min-width: 104px;
  grid-template-columns: repeat(auto-fill, minmax(var(--ff-choices-min-width), 1fr));
}

.ff-choices--compact > .ff-choices__item {
  align-items: center;
  justify-content: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  text-align: center;
}

.ff-choices--compact .ff-choices__title {
  font-variant-numeric: tabular-nums;
}

.ff-touch .ff-choices--compact .ff-choices__title {
  font-size: var(--fs-touch);
}

/* src/components/content-card/content-card.css */
/* Content card: a .ff-card that opens one piece of content (video, PDF, article).
   The title link stretches over the whole card via ::after, so the card itself is the click target. */
.ff-content-card {
  --ff-content-card-media-radius: calc(var(--radius-lg) - 1px);
  --ff-content-card-play-size: 48px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.ff-content-card:hover:has(.ff-content-card__link) {
  border-color: var(--border-strong);
}

/* The whole card shows the focus ring, the link itself does not. */
.ff-content-card:has(.ff-content-card__link:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Media: 16:9 still or placeholder. Top corners follow the inner edge of the card border. */
.ff-content-card__media {
  position: relative;
  flex: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--ff-content-card-media-radius) var(--ff-content-card-media-radius) 0 0;
  background: var(--bg-subtle);
}

.ff-content-card__media > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ff-content-card__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

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

/* Decorative play button on video stills. */
.ff-content-card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: var(--ff-content-card-play-size);
  height: var(--ff-content-card-play-size);
  margin: auto;
  border-radius: var(--radius-pill);
  background: var(--media-badge-bg);
  color: var(--media-badge-fg);
}

.ff-content-card__play > .ff-icon {
  width: var(--size-icon-lg);
  height: var(--size-icon-lg);
  /* The triangle looks off-center to the left without this. */
  translate: 1px 0;
}

/* Extent of the content: duration or page count. */
.ff-content-card__badge {
  position: absolute;
  right: var(--sp-2);
  bottom: var(--sp-2);
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-xs);
  background: var(--media-badge-bg);
  color: var(--media-badge-fg);
  font: 500 var(--fs-caption)/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ff-content-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

/* Follows the title in the source (heading navigation lands on the title), shown above it. */
.ff-content-card__eyebrow {
  order: -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  min-height: var(--h-pill-sm);
  margin: 0;
  font: 400 var(--fs-caption)/1.4 var(--font-sans);
  color: var(--text-secondary);
}

.ff-content-card__eyebrow > :has(time) {
  margin-left: auto;
}

/* No position here: the link's ::after must refer to the card, not be clipped by the line clamp. */
.ff-content-card__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--ff-content-card-title-lines, 2);
}

.ff-content-card__link {
  color: inherit;
  text-decoration: none;
}

.ff-content-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.ff-content-card__link:focus-visible {
  outline: none;
}

.ff-content-card:hover .ff-content-card__link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ff-content-card__text {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font: 400 var(--fs-control)/1.5 var(--font-sans);
  color: var(--text-secondary);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--ff-content-card-text-lines, 3);
}

.ff-content-card__action {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: var(--sp-1);
  margin-top: auto;
  padding-top: var(--sp-2);
  font: 500 var(--fs-control)/1.4 var(--font-sans);
  color: var(--text-link);
}

.ff-content-card__action > .ff-icon {
  width: var(--size-icon);
  height: var(--size-icon);
}

/* Horizontal: small image left, text right. Stacks below 320px card width.
   Selectors match .ff-card-grid > li > .ff-card so the row direction wins inside a card grid too. */
.ff-card.ff-content-card--horizontal,
.ff-card-grid > li > .ff-content-card--horizontal,
.ff-card-grid > .ff-content-card--horizontal {
  container: ff-content-card / inline-size;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3);
}

.ff-content-card--horizontal .ff-content-card__media {
  flex: 0 0 var(--ff-content-card-media-width, 128px);
  border-radius: var(--radius-md);
}

/* The small image has no room for the play button next to the badge. "Video" and the duration name the type. */
.ff-content-card--horizontal .ff-content-card__play {
  display: none;
}

.ff-content-card--horizontal .ff-content-card__badge {
  right: var(--sp-1);
  bottom: var(--sp-1);
}

.ff-content-card--horizontal .ff-content-card__body {
  flex: 1 1 0;
  padding: 0;
}

.ff-content-card--horizontal .ff-content-card__title {
  font-size: var(--fs-body);
}

.ff-content-card--horizontal .ff-content-card__text {
  -webkit-line-clamp: 2;
}

@container ff-content-card (width < 320px) {
  .ff-content-card--horizontal .ff-content-card__media,
  .ff-content-card--horizontal .ff-content-card__body {
    flex-basis: 100%;
  }

  .ff-content-card--horizontal .ff-content-card__play {
    display: grid;
  }

  .ff-content-card--horizontal .ff-content-card__text {
    -webkit-line-clamp: var(--ff-content-card-text-lines, 3);
  }
}

@media (forced-colors: active) {
  .ff-content-card__badge,
  .ff-content-card__play {
    outline: 1px solid CanvasText;
  }
}

/* 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-error);
}

/* 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 {
  --ff-checkbox-size: 16px;
  width: var(--ff-checkbox-size);
  height: var(--ff-checkbox-size);
  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;
}

/* Field as a trigger for <ff-menu> or <ff-popover>: looks like select.ff-input. */
button.ff-input {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  text-align: start;
  cursor: pointer;
}

button.ff-input > .ff-icon {
  flex: none;
  color: var(--text-secondary);
}

button.ff-input:disabled > .ff-icon {
  color: var(--text-disabled);
}

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

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

button.ff-input:disabled .ff-input__placeholder {
  color: var(--text-disabled);
}

/* While the overlay is open, the field shows its focus ring, also after a mouse click. */
button.ff-input[aria-expanded="true"] {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
  border-color: var(--focus-ring);
}

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

/* Input with a unit: the group looks like .ff-input, the input inside has no frame. */
.ff-input-group {
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--h-input);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-input-inset);
  box-sizing: border-box;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.ff-input-group > input {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 var(--sp-3);
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: 400 var(--fs-body) var(--font-sans);
  font-variant-numeric: tabular-nums;
  outline: none;
  box-sizing: border-box;
}

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

.ff-input-group > input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.ff-input-group > input::-webkit-inner-spin-button,
.ff-input-group > input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.ff-input-group > input:has(+ .ff-input-group__affix) {
  padding-inline-end: var(--sp-2);
}

.ff-input-group__affix {
  flex: none;
  padding-inline-end: var(--sp-3);
  color: var(--text-secondary);
  font: 400 var(--fs-body) var(--font-sans);
  white-space: nowrap;
  pointer-events: none;
}

.ff-input-group__affix:first-child {
  padding-inline: var(--sp-3) 0;
}

.ff-input-group__affix:first-child + input {
  padding-inline-start: var(--sp-2);
}

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

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

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

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

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

.ff-input-group:has(> input:disabled) > :is(input, .ff-input-group__affix) {
  color: var(--text-disabled);
  cursor: not-allowed;
}

/* Stepper: "−", number, unit, "+". Behavior comes from <ff-stepper>. */
.ff-input-group--stepper {
  --ff-stepper-min-width: 160px;
  min-width: var(--ff-stepper-min-width);
}

ff-stepper.ff-input-group {
  display: flex;
}

.ff-input-group--stepper > input {
  padding: 0 var(--sp-2);
  text-align: center;
}

.ff-input-group--stepper > .ff-input-group__affix {
  padding-inline: 0 var(--sp-3);
}

.ff-input-group__step {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--h-input);
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.ff-input-group__step:first-child {
  border-inline-end: 1px solid var(--border-default);
  border-radius: calc(var(--radius-md) - 1px) 0 0 calc(var(--radius-md) - 1px);
}

.ff-input-group__step:last-child {
  border-inline-start: 1px solid var(--border-default);
  border-radius: 0 calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0;
}

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

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

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

/* Several controls of one field in a row, e.g. stepper and unit select. They wrap on narrow screens. */
.ff-field__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.ff-field__controls > .ff-input-group {
  flex: 1 1 var(--ff-stepper-min-width, 160px);
  width: auto;
}

.ff-field__controls > .ff-input {
  flex: 0 1 auto;
  width: auto;
}

/* Label with a link on the right ("Was darf welche Rolle?"). */
.ff-field__label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-3);
}

.ff-field__label-row > a {
  font-size: var(--fs-caption);
  line-height: 1.4;
}

/* Section of a longer form. The rendered legend is no flex item, so its spacing comes from margin. */
.ff-fieldset {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ff-fieldset + .ff-fieldset {
  margin-top: var(--sp-8);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border-default);
}

.ff-fieldset__legend {
  margin: 0 0 var(--sp-4);
  padding: 0;
  color: var(--text-heading);
  font: 600 var(--fs-card-title)/1.25 var(--font-sans);
}

.ff-fieldset__legend:has(+ .ff-fieldset__description) {
  margin-bottom: var(--sp-1);
}

.ff-fieldset__description {
  margin: 0;
  color: var(--text-secondary);
  font: 400 var(--fs-control)/1.5 var(--font-sans);
}

/* Form with a help column. The container query only changes the children. */
.ff-form {
  --ff-form-aside-width: 320px;
  container: ff-form / inline-size;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--sp-6);
}

.ff-form__main,
.ff-form__aside {
  flex: 1 1 100%;
  min-width: 0;
}

@container ff-form (width >= 760px) {
  .ff-form__main {
    flex: 1 1 0;
  }

  .ff-form__aside {
    position: sticky;
    top: var(--sp-4);
    flex: 0 0 var(--ff-form-aside-width);
  }
}

/* Touch density: 16 px text keeps iOS Safari from zooming in on focus; larger hit areas. */
.ff-touch :is(.ff-input, .ff-input-group > input) {
  font-size: var(--fs-touch);
}

.ff-touch .ff-search__clear::after {
  inset: -12px;
}

.ff-touch .ff-checkbox {
  --ff-checkbox-size: 20px;
}

@media (prefers-reduced-motion: reduce) {
  .ff-input-group,
  .ff-input-group__step {
    transition: 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;
}

/* Label and segment of a setting stay together when the end wraps. */
.ff-filter-bar__setting {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.ff-filter-bar__label {
  color: var(--text-secondary);
  font: 400 var(--fs-caption)/1.4 var(--font-sans);
  white-space: nowrap;
}

.ff-filter-bar__end .ff-switch {
  min-height: var(--h-chip);
}

@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;
}

/* Larger matrix cells for values like "11,6 %": rating matrix and hourly grid. */
.ff-heatmap--lg {
  font-size: var(--fs-caption);
}

.ff-heatmap--lg :where(.ff-heatmap__cell) {
  width: auto;
  min-width: 44px;
  height: 34px;
  padding: 0 var(--sp-1);
}

/* The row header stays visible while the matrix scrolls sideways. */
.ff-heatmap--matrix th[scope="row"] {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.ff-heatmap--matrix tbody tr:hover th[scope="row"] {
  background: var(--bg-hover);
}

/* Status (data calendar) and rating (rating matrix) share colors but keep their own names,
   because the meaning differs. */
.ff-heatmap__cell--complete,
.ff-heatmap__cell--ok {
  background: var(--status-success-bg);
  color: var(--status-success-fg);
}

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

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

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

/* Color depth: stops at half of --action-primary so --text-primary keeps 4.5:1 in light and dark. */
.ff-heatmap__cell--depth {
  background: color-mix(in srgb, var(--action-primary) calc(var(--ff-heatmap-ratio, 0) * var(--ff-heatmap-depth, 50%)), var(--bg-selected));
  color: var(--text-primary);
}

.ff-heatmap__cell--total {
  box-shadow: inset 0 0 0 1px var(--border-control);
  font-weight: 600;
}

/* Text column at the row end, e.g. "ab 13:00 · 7,0 h ausverkauft". */
.ff-heatmap__aside {
  padding-inline-start: var(--sp-3);
  font: 400 var(--fs-caption)/1.3 var(--font-sans);
  color: var(--text-secondary);
  text-align: start;
  white-space: nowrap;
}

.ff-heatmap__aside > strong {
  display: block;
  font-weight: 500;
  color: var(--status-error-fg);
}

/* Legend square; the color comes from a cell modifier on the same element. */
.ff-heatmap__swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-xs);
}

/* 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__description,
.ff-menu__label > .ff-menu__meta {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font: 400 var(--fs-caption)/1.4 var(--font-sans);
}

/* Items with a second line align to the top; meta and check sit level with the first line. */
.ff-menu__item:has(.ff-menu__description, .ff-menu__label > .ff-menu__meta) {
  align-items: flex-start;
  padding-block: var(--sp-2);
}

.ff-menu__item:has(.ff-menu__description, .ff-menu__label > .ff-menu__meta) > :is(.ff-menu__meta, .ff-menu__check, .ff-icon) {
  margin-top: 1px;
}

.ff-menu__item[aria-disabled="true"] .ff-menu__description {
  color: var(--text-secondary);
}

/* Footer action: sticks to the bottom when the menu scrolls, the line spans the full width. */
.ff-menu__footer {
  position: sticky;
  bottom: calc(-1 * var(--ff-menu-padding));
  margin: var(--sp-1) calc(-1 * var(--ff-menu-padding)) calc(-1 * var(--ff-menu-padding));
  padding: var(--sp-1) var(--ff-menu-padding) var(--ff-menu-padding);
  border-top: 1px solid var(--border-default);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--bg-surface);
}

.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,
  .ff-menu__item:is(:hover, :focus) .ff-menu__description {
    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:is(.ff-notice--warning, .ff-notice--success, .ff-notice--info, .ff-notice--error) .ff-btn--secondary {
  border-color: currentColor;
  background: transparent;
  color: inherit;
}

.ff-notice:is(.ff-notice--warning, .ff-notice--success, .ff-notice--info, .ff-notice--error) .ff-btn--secondary:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.ff-notice:is(.ff-notice--warning, .ff-notice--success, .ff-notice--info, .ff-notice--error) .ff-btn--secondary:active {
  background: color-mix(in srgb, currentColor 16%, transparent);
}

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

.ff-notice--info {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  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);
}

/* Back link above the title on detail pages. */
.ff-page-header__back {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: var(--sp-1);
  min-height: 24px;
  border-radius: var(--radius-xs);
  color: var(--text-link);
  font-size: var(--fs-control);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}

.ff-page-header__back:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

/* Optical alignment of the chevron with the title. */
.ff-page-header__back > .ff-icon {
  flex: none;
  margin-inline-start: -2px;
}

.ff-page-header__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-page-header__title + .ff-page-header__pills {
  margin-top: var(--sp-1);
}

/* With a back link the title block grows upwards; the actions stay level with the title and pills. */
.ff-page-header:has(.ff-page-header__back) {
  align-items: flex-end;
}

@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);
}

/* Small: for dense lines next to caption text, e.g. the content card's category line. */
.ff-pill--sm {
  gap: var(--sp-1);
  height: var(--h-pill-sm);
  padding: 0 6px;
}

.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;
}

/* Status as a dot before plain text, e.g. priority in a table column. After the color variants, so it wins. */
.ff-pill.ff-pill--dot {
  height: auto;
  padding: 0;
  gap: 6px;
  background: none;
  box-shadow: none;
  color: var(--text-primary);
  font-size: inherit;
  line-height: inherit;
}

.ff-pill--dot::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--ff-pill-dot, var(--border-strong));
}

.ff-pill--dot.ff-pill--success {
  --ff-pill-dot: var(--status-success-fg);
}

.ff-pill--dot.ff-pill--info {
  --ff-pill-dot: var(--status-info-fg);
}

.ff-pill--dot.ff-pill--warning {
  --ff-pill-dot: var(--status-warning-fg);
}

.ff-pill--dot.ff-pill--error {
  --ff-pill-dot: var(--status-error-fg);
}

@media (forced-colors: active) {
  .ff-pill--dot::before {
    forced-color-adjust: none;
    background: CanvasText;
  }
}

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;
}

/* Views: header, body and footer sit inside a view; <ff-popover> shows one at a time. */
.ff-popover__view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
}

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

.ff-popover__header:has(> .ff-popover__back) {
  align-items: center;
  justify-content: flex-start;
  gap: var(--sp-1);
}

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

/* Entries that open another view: meta, then a chevron on the right. */
.ff-popover__view [data-ff-view] > .ff-icon:last-child {
  flex: none;
  margin-inline-start: var(--sp-2);
  color: var(--text-secondary);
}

/* 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;
}

fieldset.ff-segment {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.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);
}

/* Touch density: labels in the same size as the type in fields, in every size. */
.ff-touch .ff-segment__item {
  font-size: var(--fs-touch);
}

/* Multiple selection: separate items with a gap, each with its own radius. */
.ff-segment--multi {
  --ff-segment-item-min-width: var(--h-chip);
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.ff-segment--multi.ff-segment--sm {
  --ff-segment-item-min-width: var(--h-button-s);
}

.ff-segment--multi.ff-segment--lg {
  --ff-segment-item-min-width: var(--h-input);
}

.ff-segment--multi > .ff-segment__item {
  min-width: var(--ff-segment-item-min-width);
  margin-left: 0;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-md);
}

.ff-segment__item:is(:has(> input:checked), [aria-current="page"], [aria-current="true"]) > .ff-count:not(.ff-count--important) {
  background: var(--bg-surface);
  color: var(--action-primary);
}

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

/* 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;
  }

  .ff-segment__item:is(:has(> input:checked), [aria-current="page"], [aria-current="true"]) > .ff-count {
    forced-color-adjust: none;
    background: HighlightText;
    color: Highlight;
  }
}

/* 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;
}

/* With a rail, the closed element stays visible and shows the rail instead of the panel. */
ff-side-panel:not([open]):has(> .ff-side-panel__rail) {
  display: block;
}

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

.ff-side-panel__rail {
  --ff-side-panel-rail-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  box-sizing: border-box;
  width: var(--ff-side-panel-rail-width);
  height: 100%;
  margin: 0;
  padding: var(--sp-4) var(--sp-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  text-align: center;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

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

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

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

.ff-side-panel__rail > .ff-icon {
  color: var(--text-heading);
}

.ff-side-panel__rail-count {
  color: var(--text-heading);
  font-size: var(--fs-section);
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.ff-side-panel__rail-label {
  font-size: var(--fs-micro);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Chevron at the end of the rail: says that the rail opens a panel. */
.ff-side-panel__rail > .ff-side-panel__rail-chevron {
  margin-top: auto;
  color: var(--text-secondary);
}

.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);
  }

  /* The rail becomes a bar: icon, count and label in one row, as wide as its place in the layout. */
  .ff-side-panel__rail {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--sp-2);
    width: 100%;
    height: auto;
    min-height: var(--h-input);
    padding: var(--sp-2) var(--sp-4);
  }

  .ff-side-panel__rail-count {
    font-size: var(--fs-card-title);
  }

  .ff-side-panel__rail-label {
    font-size: var(--fs-body);
  }

  .ff-side-panel__rail > .ff-side-panel__rail-chevron {
    margin-top: 0;
    margin-left: auto;
  }
}

/* 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-side-panel__rail {
    transition: none;
  }

  .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(--ff-skeleton-gap, var(--sp-2));
}

/* Every part pulses on its own, so nested wrappers do not multiply the opacity and parts work without a wrapper. */
.ff-skeleton__line,
.ff-skeleton__block,
.ff-skeleton__bars,
.ff-skeleton__control,
.ff-skeleton__pill,
.ff-skeleton__square {
  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);
}

/* Text lines: one line box of the font, the bar takes the middle 60 %. The vertical radius
   includes the padding, so the visible bar keeps --radius-xs. */
.ff-skeleton__line--text,
.ff-skeleton__line--caption,
.ff-skeleton__line--body,
.ff-skeleton__line--card-title,
.ff-skeleton__line--kpi {
  box-sizing: border-box;
  height: 1lh;
  padding-block: 0.2lh;
  border-radius: var(--radius-xs) / calc(var(--radius-xs) + 0.2lh);
  background-clip: content-box;
}

/* Line heights match ff.lineHeight of the font size in tokens/scale.json. */
.ff-skeleton__line--caption {
  font-size: var(--fs-caption);
  line-height: 1.4;
}

.ff-skeleton__line--body {
  font-size: var(--fs-body);
  line-height: 1.5;
}

.ff-skeleton__line--card-title {
  font-size: var(--fs-card-title);
  line-height: 1.25;
}

.ff-skeleton__line--kpi {
  font-size: var(--fs-kpi);
  line-height: 1.1;
}

.ff-skeleton__control,
.ff-skeleton__pill,
.ff-skeleton__square {
  display: block;
  flex: none;
  max-width: 100%;
  background: var(--bg-pressed);
}

/* Heights come from the control tokens, so .ff-touch raises them like real controls. */
.ff-skeleton__control {
  width: var(--ff-skeleton-width, 100%);
  height: var(--h-input);
  border-radius: var(--radius-md);
}

.ff-skeleton__control--sm {
  height: var(--h-button-s);
}

.ff-skeleton__pill {
  width: var(--ff-skeleton-width, 64px);
  height: var(--h-pill);
  border-radius: var(--radius-pill);
}

.ff-skeleton__square {
  width: var(--ff-skeleton-size, 24px);
  height: var(--ff-skeleton-size, 24px);
  border-radius: var(--radius-sm);
}

.ff-skeleton__square--round {
  border-radius: var(--radius-pill);
}

/* Parts side by side. Lines and nested wrappers give up space, squares and pills keep their size. */
.ff-skeleton__row {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--ff-skeleton-gap, var(--sp-3));
}

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

.ff-skeleton__row > :is(.ff-skeleton__square, .ff-skeleton__pill) {
  flex: none;
}

.ff-skeleton__row > .ff-skeleton {
  flex: 1 1 0;
}

.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__line,
  .ff-skeleton__block,
  .ff-skeleton__bars,
  .ff-skeleton__control,
  .ff-skeleton__pill,
  .ff-skeleton__square {
    animation: none;
  }
}

@media (forced-colors: active) {
  .ff-skeleton__line,
  .ff-skeleton__block,
  .ff-skeleton__bar,
  .ff-skeleton__control,
  .ff-skeleton__pill,
  .ff-skeleton__square {
    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);
}

/* Final state on detail pages: the last step is done and current. Keeps the filled circle and a readable check. */
.ff-steps__item--done[aria-current="step"] .ff-steps__marker {
  border-width: 1px;
  color: var(--text-on-action);
}

/* 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);
}

/* Label with a description below. */
.ff-switch__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin-left: var(--sp-3);
}

.ff-switch__text > .ff-switch__label {
  margin-left: 0;
}

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

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

/* Switch on the right, text on the left. The DOM order input → track → text stays. */
.ff-switch--end {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  width: 100%;
}

.ff-switch--end > :is(.ff-switch__text, .ff-switch__label) {
  flex: 1;
  margin-left: 0;
}

/* 14 px × 1.5 = 21 px first line next to a 24 px track. */
.ff-switch--end > .ff-switch__track {
  margin-top: -1px;
}

/* Settings list: one switch per row, rows divided by lines. */
.ff-switch-list {
  --ff-switch-list-inset: var(--sp-5);
  --ff-switch-list-padding-block: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-switch-list__item {
  padding: var(--ff-switch-list-padding-block) var(--ff-switch-list-inset);
  transition: background-color var(--dur-fast) var(--ease-out);
}

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

.ff-switch-list__item:not(.ff-switch-list__item--main):has(input:not(:disabled)):hover {
  background: var(--bg-subtle);
}

.ff-switch-list__item--main {
  padding-block: var(--sp-4);
  background: var(--bg-subtle);
}

.ff-switch-list__item--main .ff-switch__label {
  color: var(--text-heading);
  font: 600 var(--fs-card-title)/1.25 var(--font-sans);
}

.ff-switch-list__item--main .ff-switch__description {
  font-size: var(--fs-control);
}

@media (prefers-reduced-motion: reduce) {
  .ff-switch-list__item,
  .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);
  --ff-table-rowspan-width: 160px;
  --ff-table-media-size: 40px;
  /* Layers inside the scroll area: sticky columns, sticky group rows (and their sticky cells), head and foot. */
  --ff-table-z-col: 1;
  --ff-table-z-group: 2;
  --ff-table-z-group-col: 3;
  --ff-table-z-head: 4;
  --ff-table-z-corner: 5;
  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-media-size: 32px;
}

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

.ff-table__scroll {
  /* Own stacking context: cell layers never compete with sticky page bars or overlays. */
  isolation: isolate;
  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 :is(.ff-table__primary, .ff-table__sticky[rowspan]) a {
  color: var(--text-link);
  font-weight: 500;
  text-decoration: none;
}

.ff-table__table tbody :is(.ff-table__primary, .ff-table__sticky[rowspan]) 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(--ff-table-z-col);
  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(--ff-table-z-col);
  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(--ff-table-z-col);
  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". The row carries the surface too, so the fading
   edge of __actions blends into it. */
.ff-table__table :is(.ff-table__group, .ff-table__total) {
  --ff-table-row-bg: var(--bg-subtle);
}

.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;
}

/* Expandable group row: the toggle wraps title and count, sums sit in the number columns. */
.ff-table__table .ff-table__group > th:has(> .ff-table__toggle) {
  padding-block: 0;
  padding-inline: var(--sp-2);
}

.ff-table__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  box-sizing: border-box;
  min-height: 40px;
  margin: 0;
  padding: 0 var(--sp-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.ff-table__toggle .ff-icon {
  color: var(--text-muted);
  transition: rotate var(--dur-fast) var(--ease-out);
}

.ff-table__toggle[aria-expanded="true"] .ff-icon {
  rotate: 90deg;
}

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

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

.ff-table__table .ff-table__group > .ff-table__num {
  color: var(--text-heading);
  font-size: var(--fs-body);
  font-weight: 600;
}

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

.ff-table__table .ff-table__group > .ff-table__actions {
  padding-inline: var(--sp-3);
}

.ff-table__table .ff-table__group > td.ff-table__actions > * + * {
  margin-inline-start: var(--sp-2);
}

/* Collapsed: only the group row stays. The last visible row of the table has no line. */
.ff-table__table tbody:has(> .ff-table__group .ff-table__toggle[aria-expanded="false"]) > tr:not(.ff-table__group) {
  display: none;
}

.ff-table__table tbody:is(:last-child, :has(+ tfoot)):has(> .ff-table__group .ff-table__toggle[aria-expanded="false"]) > .ff-table__group > :is(th, td) {
  border-bottom: 0;
}

/* Column groups in the head: "Vergleich", "Ziel", "Abweichung" above their columns. */
.ff-table__table thead th[scope="colgroup"] {
  height: auto;
  padding: var(--sp-2) var(--ff-table-cell-px);
  color: var(--text-heading);
  text-align: center;
}

.ff-table__table thead th[rowspan] {
  vertical-align: bottom;
}

.ff-table__table .ff-table__divider {
  border-inline-start: 1px solid var(--border-row);
}

/* Total row in <tfoot>, or as the last row of <thead>. */
.ff-table__table .ff-table__total > :is(th, td) {
  --ff-table-row-bg: var(--bg-subtle);
  color: var(--text-heading);
  font-size: var(--fs-body);
  font-weight: 600;
}

.ff-table--compact .ff-table__table .ff-table__total > :is(th, td) {
  font-size: var(--fs-control);
}

.ff-table__table tfoot .ff-table__total > :is(th, td) {
  border-top: 1px solid var(--border-control);
  border-bottom: 0;
}

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

.ff-table__table thead .ff-table__total > :is(th, td) {
  border-bottom-color: var(--border-control);
}

/* Highlighted column ("Jetzt", "Ziel") and cell (largest share of a row). The surface sits on the
   cell, so row hover and selection leave it unchanged. */
.ff-table__table .ff-table__highlight {
  --ff-table-row-bg: var(--bg-selected);
  box-shadow: inset 1px 0 0 var(--border-selected), inset -1px 0 0 var(--border-selected);
}

.ff-table__table :is(.ff-table__group, .ff-table__total) > .ff-table__highlight {
  --ff-table-row-bg: var(--bg-selected-hover);
  color: var(--text-heading);
}

.ff-table__table tbody tr:not(.ff-table__group) > .ff-table__highlight--subtle {
  --ff-table-row-bg: var(--bg-subtle);
}

.ff-table__table .ff-table__peak {
  --ff-table-row-bg: var(--bg-selected);
  box-shadow: inset 2px 0 0 var(--action-primary);
  color: var(--text-heading);
  font-weight: 600;
}

/* Sticky group cell with rowspan (store over its metric rows); the metric column next to it sticks too. */
.ff-table__table tbody .ff-table__sticky[rowspan] {
  --ff-table-row-bg: var(--bg-surface);
  width: var(--ff-table-rowspan-width);
  min-width: var(--ff-table-rowspan-width);
  max-width: var(--ff-table-rowspan-width);
  padding-block: var(--sp-3);
  vertical-align: top;
  white-space: normal;
}

.ff-table__table tbody .ff-table__sticky[rowspan] > * {
  max-width: none;
  white-space: normal;
}

.ff-table__table tbody .ff-table__sticky[rowspan] .ff-table__secondary {
  margin-top: var(--sp-1);
}

.ff-table__table tbody:has(> tr > .ff-table__sticky[rowspan]) .ff-table__sticky:not([rowspan]),
.ff-table:has(tbody .ff-table__sticky[rowspan]) thead .ff-table__sticky ~ .ff-table__sticky {
  left: calc(var(--ff-table-sticky-offset) + var(--ff-table-rowspan-width));
  max-width: max(120px, calc(40cqi - var(--ff-table-rowspan-width)));
}

.ff-table__table tbody:has(> tr > [rowspan]) > tr:not(:last-child) > :not([rowspan]) {
  border-bottom-color: var(--border-default);
}

/* Image before the name in the primary column: an .ff-avatar--square (picture or image icon) at table size. */
.ff-table__with-media {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.ff-table__with-media > :last-child {
  min-width: 0;
}

.ff-table__with-media > .ff-avatar--square {
  --ff-avatar-size: var(--ff-table-media-size);
  border-radius: var(--radius-md);
}

/* Scroll area with a height: head, group rows and the total in <tfoot> stick inside it. */
.ff-table__scroll--y {
  container: ff-table-scroll / scroll-state;
  overflow: auto;
  max-height: var(--ff-table-max-height, 70vh);
  scroll-padding-block: var(--ff-table-head-h, var(--h-table-row)) var(--ff-table-foot-h, 0px);
}

.ff-table__scroll--y thead {
  position: sticky;
  top: 0;
  z-index: var(--ff-table-z-head);
}

.ff-table__scroll--y tfoot {
  position: sticky;
  bottom: 0;
  z-index: var(--ff-table-z-head);
}

.ff-table__scroll--y thead :is(.ff-table__select, .ff-table__sticky, .ff-table__actions) {
  z-index: var(--ff-table-z-corner);
}

.ff-table__scroll--y .ff-table__group > :is(th, td) {
  position: sticky;
  top: var(--ff-table-head-h, var(--h-table-row));
  z-index: var(--ff-table-z-group);
}

.ff-table__scroll--y .ff-table__group > :is(.ff-table__select, .ff-table__sticky, .ff-table__actions) {
  z-index: var(--ff-table-z-group-col);
}

/* Shadow under the head only while rows are hidden beneath it (Chromium); elsewhere the line remains. */
@container ff-table-scroll (scroll-state(scrollable: top)) {
  .ff-table__table thead {
    box-shadow: var(--shadow-sticky);
  }
}

/* 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);
}

/* Legend, explanation and "Alle anzeigen" in the footer. Legend and explanation take a line each. */
.ff-table__legend,
.ff-table__note {
  flex-basis: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-caption);
}

.ff-table__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
}

.ff-table__legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.ff-table__swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-xs);
  background: var(--ff-table-swatch, var(--bg-pressed));
}

.ff-table__swatch--highlight {
  background: var(--bg-selected);
  box-shadow: inset 0 0 0 1px var(--border-selected);
}

.ff-table__swatch--subtle {
  background: var(--bg-surface);
  box-shadow: inset 0 0 0 1px var(--border-default);
}

.ff-table__note {
  line-height: 1.6;
}

.ff-table__note > div {
  display: inline;
}

.ff-table__note > div + div::before {
  content: "·";
  margin-inline: var(--sp-2);
}

.ff-table__note dt {
  display: inline;
  color: var(--text-muted);
  font-weight: 600;
}

.ff-table__note dd {
  display: inline;
  margin: 0;
}

.ff-table__more {
  margin-inline-start: auto;
  border-radius: var(--radius-xs);
  color: var(--text-link);
  font-weight: 500;
  text-decoration: none;
}

.ff-table__more:hover {
  text-decoration: underline;
}

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

/* 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;
  }

  .ff-table__table .ff-table__highlight {
    border-inline: 1px solid CanvasText;
  }

  .ff-table__table .ff-table__peak {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}

/* 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/tile/tile.css */
/* Tile: the whole <a> or <button> is one large target with image, title and one line of meta. */
.ff-tile {
  --ff-tile-media-size: 72px;
  --ff-tile-min-height: calc(var(--ff-tile-media-size) + 2 * var(--sp-3));
  --ff-tile-title-lines: 2;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  box-sizing: border-box;
  width: 100%;
  min-height: var(--ff-tile-min-height);
  margin: 0;
  padding: var(--sp-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.ff-tile:where(:not(:disabled)):hover {
  border-color: var(--border-strong);
}

.ff-tile:where(:not(:disabled)):active {
  background: var(--bg-pressed);
}

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

/* Selected: tinted surface and teal border, the same look as selected choice cards (ADR 0006). */
.ff-tile:is([aria-pressed="true"], [aria-current]:not([aria-current="false"])) {
  border-color: var(--action-primary);
  background: var(--bg-selected);
}

.ff-tile:is([aria-pressed="true"], [aria-current]:not([aria-current="false"])):where(:not(:disabled)):is(:hover, :active) {
  border-color: var(--action-primary);
  background: var(--bg-selected-hover);
}

.ff-tile:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.ff-tile__media {
  display: block;
  flex: none;
  width: var(--ff-tile-media-size);
  height: var(--ff-tile-media-size);
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}

.ff-tile__media > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ff-tile__media--placeholder {
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

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

/* The placeholder box has the selected surface itself, so it turns white on a selected tile to stay visible. */
.ff-tile:is([aria-pressed="true"], [aria-current]:not([aria-current="false"])) > .ff-tile__media--placeholder {
  background: var(--bg-surface);
}

.ff-tile:disabled > .ff-tile__media {
  opacity: 0.5;
}

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

.ff-tile__title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-heading);
  font: 600 var(--fs-card-title)/1.3 var(--font-sans);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--ff-tile-title-lines);
}

.ff-tile__meta {
  overflow: hidden;
  color: var(--text-secondary);
  font: 400 var(--fs-caption)/1.45 var(--font-sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff-touch .ff-tile__meta {
  font-size: var(--fs-body);
}

.ff-tile:disabled :is(.ff-tile__title, .ff-tile__meta) {
  color: var(--text-disabled);
}

/* Compact: the name only, single-line like a control. */
.ff-tile--compact {
  justify-content: center;
  width: auto;
  min-height: var(--h-input);
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--radius-md);
  color: var(--text-heading);
  font: 500 var(--fs-body)/1.4 var(--font-sans);
  text-align: center;
  white-space: nowrap;
}

.ff-touch .ff-tile--compact {
  font-size: var(--fs-touch);
}

.ff-tile--compact:disabled {
  color: var(--text-disabled);
}

/* Stacked: brand square at the top, name centered below. The square stays at the top so squares line up in a row. */
.ff-tile--stacked {
  --ff-tile-media-size: 72px;
  --ff-tile-min-height: calc(var(--ff-tile-media-size) + 2 * var(--sp-4) + var(--sp-3) + 1.3 * var(--fs-card-title));
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--sp-4);
  text-align: center;
}

.ff-touch .ff-tile--stacked {
  --ff-tile-media-size: 88px;
}

.ff-tile--stacked > .ff-tile__body {
  align-items: center;
  width: 100%;
}

/* Optional count line below the name, one line, cut with "…" inside the tile. */
.ff-tile--stacked .ff-tile__meta {
  max-width: 100%;
}

/* Teal name as in the reference. --text-link keeps 4.5:1 on every tile surface, --action-primary does not. */
.ff-tile--stacked .ff-tile__title {
  color: var(--text-link);
}

/* Brand square: a fixed group icon on teal. It is not a placeholder, so it keeps its fill on a selected tile. */
.ff-tile__media--brand {
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg);
  background: var(--action-primary);
  color: var(--text-on-action);
}

.ff-tile__media--brand > .ff-icon {
  width: var(--size-icon-2xl);
  height: var(--size-icon-2xl);
}

/* Grid: columns by container width, every tile as tall as the tallest one. */
.ff-tile-grid {
  --ff-tile-grid-min: 240px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--ff-tile-grid-min)), 1fr));
  grid-auto-rows: 1fr;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
  container: ff-tile-grid / inline-size;
}

.ff-tile-grid > li {
  display: flex;
  min-width: 0;
}

.ff-tile-grid > li > .ff-tile {
  flex: 1;
  min-width: 0;
}

/* Below 400 px the media shrinks, so the title keeps enough width on a phone. */
@container ff-tile-grid (width < 400px) {
  .ff-tile {
    --ff-tile-media-size: 56px;
  }

  /* Two classes, so it beats the stacked default and the touch size above. The icon stays 48 px. */
  .ff-tile-grid .ff-tile--stacked {
    --ff-tile-media-size: 64px;
  }
}

/* Row: compact tiles in one line that scrolls sideways. The padding keeps focus rings inside the scroll area. */
.ff-tile-row {
  display: flex;
  gap: var(--sp-2);
  margin: 0;
  padding: var(--sp-1);
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x proximity;
}

.ff-tile-row > li,
.ff-tile-row > .ff-tile {
  display: flex;
  flex: none;
  scroll-snap-align: start;
}

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

@media (forced-colors: active) {
  .ff-tile:is([aria-pressed="true"], [aria-current]:not([aria-current="false"])) {
    border: 2px solid Highlight;
  }
}

/* src/components/timeline/timeline.css */
/* Vertical list of events, newest first. Markers sit on a line that connects them. */
.ff-timeline {
  --ff-timeline-marker-size: 28px;
  --ff-timeline-gap: var(--sp-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-sans);
}

.ff-timeline--compact {
  --ff-timeline-marker-size: 24px;
  --ff-timeline-gap: var(--sp-3);
}

.ff-timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: var(--ff-timeline-marker-size) minmax(0, 1fr);
  column-gap: var(--sp-3);
  padding-bottom: var(--ff-timeline-gap);
}

.ff-timeline__item:last-child {
  padding-bottom: 0;
}

/* Line from below this marker to the next marker. A border, so it stays in forced-colors mode. */
.ff-timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: var(--ff-timeline-marker-size);
  bottom: 0;
  left: calc(var(--ff-timeline-marker-size) / 2 - 1px);
  border-left: 2px solid var(--border-default);
}

.ff-timeline__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--ff-timeline-marker-size);
  height: var(--ff-timeline-marker-size);
  border-radius: var(--radius-pill);
  background: var(--ff-timeline-marker-bg, var(--bg-page));
  color: var(--ff-timeline-marker-fg, var(--text-muted));
}

.ff-timeline__item--success {
  --ff-timeline-marker-bg: var(--status-success-bg);
  --ff-timeline-marker-fg: var(--status-success-fg);
}

.ff-timeline__item--warning {
  --ff-timeline-marker-bg: var(--status-warning-bg);
  --ff-timeline-marker-fg: var(--status-warning-fg);
}

.ff-timeline__item--error {
  --ff-timeline-marker-bg: var(--status-error-bg);
  --ff-timeline-marker-fg: var(--status-error-fg);
}

.ff-timeline__item--info {
  --ff-timeline-marker-bg: var(--status-info-bg);
  --ff-timeline-marker-fg: var(--status-info-fg);
}

.ff-timeline__content {
  min-width: 0;
  /* First text line centered on the marker. */
  padding-top: calc((var(--ff-timeline-marker-size) - 1.5 * var(--fs-body)) / 2);
}

.ff-timeline__text {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

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

/* Loading: skeleton entries in the same grid, without the line. */
.ff-timeline[aria-busy="true"] .ff-timeline__item::before {
  display: none;
}

@media (forced-colors: active) {
  .ff-timeline__marker {
    border: 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(--status-success-border);
  color: var(--status-success-fg);
}

.ff-toast--info {
  background: var(--status-info-bg);
  border-color: var(--status-info-border);
  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;
  }
}
}
