/* =============================================================================
   KBM.Blazor.UI.MudBlazor: brand rules MudBlazor's theme cannot express.
   Load after MudBlazor.min.css and _content/KBM.Blazor.UI/css/kbm.css:
     <link href="_content/KBM.Blazor.UI.MudBlazor/css/kbm-mudblazor.css" rel="stylesheet" />
   Colors only via custom properties (no hex values): the light/dark palette comes from KbmTheme.
   ============================================================================= */

/* ---- Semantic roles of kbm.css follow the active MudBlazor palette (light/dark) ----
   :root:root wins over kbm.css' :root regardless of link order. */
:root:root {
  --kbm-text: var(--mud-palette-text-primary);
  --kbm-text-secondary: var(--mud-palette-text-secondary);
  --kbm-accent: var(--mud-palette-primary);
  --kbm-on-accent: var(--mud-palette-primary-text);
  --kbm-ground: var(--mud-palette-background);
  --kbm-panel: var(--mud-palette-background-gray);
  --kbm-line: var(--mud-palette-lines-default);
  /* --kbm-brand-surface stays KBM-Blau in both modes (app bar, table header) */
}

/* ---- Typography: what MudBlazor's Typography has no property for ---------------- */
.mud-typography-h6,
.mud-typography-caption {
  font-style: italic;
}

.mud-typography-h1,
.mud-typography-h2,
.mud-typography-overline {
  color: var(--mud-palette-primary);
}

.mud-typography-subtitle1,
.mud-typography-caption {
  color: var(--mud-palette-text-secondary);
}

/* On colored surfaces typography inherits the surface's text color */
:is(.mud-appbar, .mud-alert-filled, .mud-snackbar, .mud-tooltip, .mud-chip, .mud-button-root, .mud-table-head) .mud-typography {
  color: inherit;
}

/* ---- Alerts: no colored body text (Text/Outlined variants use *-darken as text in MudBlazor) ---- */
.mud-alert-text-primary, .mud-alert-outlined-primary,
.mud-alert-text-secondary, .mud-alert-outlined-secondary,
.mud-alert-text-tertiary, .mud-alert-outlined-tertiary,
.mud-alert-text-info, .mud-alert-outlined-info,
.mud-alert-text-success, .mud-alert-outlined-success,
.mud-alert-text-warning, .mud-alert-outlined-warning,
.mud-alert-text-error, .mud-alert-outlined-error,
.mud-alert-text-dark, .mud-alert-outlined-dark {
  color: var(--mud-palette-text-primary);
}

/* ---- Chips: square like every other surface ("Keine Ecken"). MudBlazor gives each chip size its own radius
   (12, 16, 20 px) instead of the theme's DefaultBorderRadius, so only the Label chips were square. */
.mud-chip.mud-chip,
.mud-chip.mud-chip.mud-chip-size-small,
.mud-chip.mud-chip.mud-chip-size-medium,
.mud-chip.mud-chip.mud-chip-size-large {
  border-radius: var(--kbm-radius);
}

/* Outlined and Text chips write their text in the chip's color. Signalorange, Stahlcyan and Alpengelb are never text
   colors (Alpengelb 1.9:1 on white), so the text stays the normal text color, as in alerts; the border and the
   hover keep the status color. A warning that must stand out is a filled chip (black on Alpengelb). */
:is(.mud-chip-outlined, .mud-chip-text):is(.mud-chip-color-secondary, .mud-chip-color-tertiary, .mud-chip-color-info, .mud-chip-color-warning) {
  color: var(--mud-palette-text-primary);
}

/* ---- Status colours as text --------------------------------------------------------
   Color.Warning, Info, Secondary or Tertiary on a MudText (or MudLink) wrote the text in Alpengelb (1.9:1 on white),
   Stahlcyan or Signalorange: none of them is a text colour. A warning text stays black on a light Alpengelb ground,
   like a filled warning chip, in light and dark mode; a block text is only as wide as its words. The other three
   write in the normal text colour, as in alerts and chips. An icon in Color.Warning is drawn in the text colour: its
   shape says "warning" (Alpengelb is below the 3:1 an icon needs). MudBlazor sets these classes with !important. */
.mud-typography.mud-warning-text {
  color: var(--kbm-schwarz) !important;
  background-color: var(--kbm-alpengelb-40);
  padding: 0 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.mud-typography.mud-warning-text:not(span, a) {
  width: fit-content;
  max-width: 100%;
}

.mud-typography:is(.mud-info-text, .mud-secondary-text, .mud-tertiary-text),
.mud-icon-root.mud-warning-text {
  color: var(--mud-palette-text-primary) !important;
}

/* ---- Form fields ------------------------------------------------------------------
   MudBlazor sizes the input line for Roboto (1.1876em). Open Sans' descenders (g, p, q, y) reach lower and get
   clipped, so the line gets 1.4375em; the vertical padding shrinks by the same 4 px to keep every field's height. */
.mud-input {
  line-height: 1.4375em;
}

.mud-input > input.mud-input-root,
div.mud-input-slot.mud-input-root {
  padding: 4px 0 5px;
}

.mud-input > input.mud-input-root.mud-input-root-margin-dense,
div.mud-input-slot.mud-input-root.mud-input-root-margin-dense {
  padding-top: 1px;
}

.mud-input > input.mud-input-root.mud-input-root-filled,
div.mud-input-slot.mud-input-root.mud-input-root-filled {
  padding: 25px 12px 8px;
}

.mud-input > input.mud-input-root.mud-input-root-filled.mud-input-root-margin-dense,
div.mud-input-slot.mud-input-root.mud-input-root-filled.mud-input-root-margin-dense {
  padding-top: 21px;
  padding-bottom: 4px;
}

.mud-input > input.mud-input-root.mud-input-root-filled.mud-input-root-hidden-label,
div.mud-input-slot.mud-input-root.mud-input-root-filled.mud-input-root-hidden-label {
  padding-top: 16px;
  padding-bottom: 17px;
}

.mud-input > input.mud-input-root.mud-input-root-filled.mud-input-root-hidden-label.mud-input-root-margin-dense,
div.mud-input-slot.mud-input-root.mud-input-root-filled.mud-input-root-hidden-label.mud-input-root-margin-dense {
  padding-top: 8px;
  padding-bottom: 9px;
}

.mud-input > input.mud-input-root-outlined,
div.mud-input-slot.mud-input-root-outlined {
  padding: 16.5px 14px;
}

.mud-input > input.mud-input-root-outlined.mud-input-root-margin-dense,
div.mud-input-slot.mud-input-root-outlined.mud-input-root-margin-dense {
  padding-top: 8.5px;
  padding-bottom: 8.5px;
}

/* Labels use the input's own type (Body1) instead of Subtitle1 (1.125rem in KBM). Shrunk to 75 % they then match the
   0.75rem legend that cuts the notch into the outlined border, so the label no longer runs into the border. */
.mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol {
  font-family: var(--mud-typography-body1-family);
  font-size: var(--mud-typography-body1-size);
  font-weight: var(--mud-typography-body1-weight);
  letter-spacing: var(--mud-typography-body1-letterspacing);
}

/* The label clips its text (overflow: hidden for the ellipsis), and MudBlazor's 1.15rem line is too low for Open Sans:
   descenders (g, p, q, y) were cut, most visibly in the small label on the field's border. It gets the input's
   1.4375em line; the negative margin moves the box up by half the extra height, so the text stays where it was. */
.mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol,
.mud-input-control > .mud-input-control-input-container > .mud-input-label-outlined.mud-input-label-inputcontrol {
  line-height: 1.4375em;
  margin-top: calc((1.15rem - 1.4375em) / 2);
}

/* An empty field's resting label ends with "…" before an end adornment (a date's calendar, a select's arrow, a time
   field's clock, a unit) instead of running under it and hiding the required "*": 14 px padding plus the 40 px of the
   adornment. A filled field's label sits small on the border and has the whole width. */
.mud-input.mud-input-outlined:not(.mud-shrink):not(:focus-within):has(> .mud-input-adornment-end) ~ label.mud-input-label-outlined {
  max-width: calc(100% - 14px - 40px);
}

/* The required label gets its "*" via ::after; the legend needs it too, or the notch is one character short */
.mud-input-control.mud-input-required .mud-input-outlined-border legend::after {
  content: "*";
}

/* ---- Navigation: Montserrat in the Button size (web type scale "Navigation / actions") ----
   MudNavLink inherits Body1 (1rem × 1.75 = 28 px line) and top-aligns its 24 px icon, so the text sat low.
   0.875rem × 1.75 gives a 24.5 px line, level with the icon. Weights stay MudBlazor's (400, active 500). */
.mud-nav-link {
  font-family: var(--mud-typography-button-family);
  font-size: var(--mud-typography-button-size);
  line-height: var(--mud-typography-button-lineheight);
}

.mud-nav-link .mud-nav-link-text {
  letter-spacing: var(--mud-typography-button-letterspacing);
}

/* MudTab: same style instead of MudBlazor's forced caps in the inherited Body1 font. Caps are reserved for the small
   tracked labels (overline, KPI label, table header). Weight stays MudBlazor's 500. */
.mud-tab {
  font-family: var(--mud-typography-button-family);
  font-size: var(--mud-typography-button-size);
  line-height: var(--mud-typography-button-lineheight);
  letter-spacing: var(--mud-typography-button-letterspacing);
  text-transform: var(--mud-typography-button-text-transform);
}

/* A tab with a count (BadgeData): the badge sits in the tab's flow, raised after the text, instead of floating
   over the tab's edge, which clips it. So "12" or "99+" grows the tab and shows whole. */
.mud-tab .mud-badge-root.mud-tab-badge {
  position: relative;
  display: inline-flex;
  align-self: flex-start;
  margin-top: -2px;
  margin-left: 4px;
}

.mud-tab .mud-tab-badge .mud-badge-wrapper {
  position: static;
  display: inline-flex;
  width: auto;
  height: auto;
}

.mud-tab .mud-tab-badge .mud-badge {
  position: static;
  inset: auto;
  transform: none;
}

/* ---- Tables: header row KBM-Blau with white Open Sans Bold caps (+0.15em) in both modes ---- */
.mud-table .mud-table-root .mud-table-head .mud-table-cell,
.mud-simple-table.mud-simple-table table thead th {
  background-color: var(--kbm-brand-surface);
  color: var(--kbm-on-brand-surface);
  font-family: var(--kbm-font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.mud-table-head :is(.mud-icon-button, .mud-table-sort-label, .mud-button-root) {
  color: inherit;
}

/* A table that scrolls sideways keeps its screen-reader-only headings (kbm-sr-only) inside it instead of widening the
   page. */
.mud-table-container {
  position: relative;
}

/* Tables on a phone. A stacked MudTable (Breakpoint="Breakpoint.Sm") with class kbm-stacked-cells puts its label on
   the left and every line of a cell under each other on the right, instead of side by side word by word. */
@media (max-width: 959.98px) {
  .kbm-stacked-cells.mud-table .mud-table-row .mud-table-cell {
    display: grid;
    grid-template-columns: minmax(6rem, 40%) minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
    text-align: right !important;
  }

  .kbm-stacked-cells.mud-table .mud-table-row .mud-table-cell::before {
    grid-column: 1;
    grid-row: 1 / span 20;
    padding: 0;
    text-align: left;
  }

  .kbm-stacked-cells.mud-table .mud-table-row .mud-table-cell > * {
    grid-column: 2;
    justify-self: end;
    min-width: 0;
  }

  .kbm-stacked-cells.mud-table .mud-table-row .mud-table-cell:not([data-label]),
  .kbm-stacked-cells.mud-table .mud-table-row .mud-table-cell[data-label=""] {
    display: flex;
    justify-content: flex-end;
  }
}

/* A plain table (MudSimpleTable) with class kbm-mobile-cards shows each row as a card of label and value lines below
   600 px (the mobile view); each td names its column in data-label. */
@media (max-width: 599.98px) {
  .kbm-mobile-cards.mud-simple-table table thead {
    display: none;
  }

  .kbm-mobile-cards.mud-simple-table :is(table, tbody, tr, td) {
    display: block;
    width: 100%;
  }

  .kbm-mobile-cards.mud-simple-table tr {
    padding: 6px 0;
    border-bottom: 1px solid var(--mud-palette-table-lines);
  }

  .kbm-mobile-cards.mud-simple-table table tbody tr td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 16px;
    border-bottom: none;
    text-align: right !important;
  }

  .kbm-mobile-cards td::before {
    content: attr(data-label);
    font-weight: 500;
    text-align: left;
  }
}

/* ---- Toggle groups: every option as wide as its own text with room on both sides, never squeezed against its frame
   or broken into two lines (MudBlazor gives every option the same share of the group's width). */
.mud-toggle-group.mud-toggle-group-horizontal {
  grid-template-columns: none !important;
  grid-auto-flow: column;
  grid-auto-columns: auto;
  width: fit-content;
  max-width: 100%;
}

.mud-toggle-group.mud-toggle-group-horizontal > .mud-toggle-item {
  padding-left: 12px;
  padding-right: 12px;
  white-space: nowrap;
}

/* ---- Form sections (KbmFormCard, KbmFormSection, KbmFormGrid, KbmFormField, KbmFormFact) ---------------------------
   One card per tab with sections, a thin line between them. The card is a container: from 960 px of card width the
   section titles sit in a column on the left, below that above their fields. The grid is a container of its own: four
   columns from 720 px, two from 480 px, one below (the mobile view). Every field keeps the slot of its "?" (24 px button
   and 2 px on each side), so the edges of all fields line up whether they have a tip or not. */
.kbm-form-card {
    container: kbm-form-card / inline-size;
}

.kbm-form-section {
    padding: 16px;
}

.kbm-form-section + .kbm-form-section {
    border-top: 1px solid var(--kbm-line);
}

/* A dialog's sections (KbmFormCard Outlined="false"): no frame, flush with the dialog's own padding. */
.kbm-form-card-plain > .kbm-form-section {
    padding-left: 0;
    padding-right: 0;
}

.kbm-form-card-plain > .kbm-form-section:first-child {
    padding-top: 0;
}

/* A one-column field (date, number, code) is narrow on a four-column grid: its end icon (calendar, unit) sits close to
   the value so a date such as 23.10.2026 shows whole. */
.kbm-form-field.kbm-form-span-1 .mud-input-adornment-end {
    margin-inline-start: 0;
}

.kbm-form-section-head {
    margin-bottom: 16px;
}

.kbm-form-section-title {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kbm-form-section-heading {
    color: var(--kbm-accent);
}

.kbm-form-section-text {
    color: var(--kbm-text-secondary);
    margin-top: 2px;
}

@container kbm-form-card (min-width: 960px) {
    .kbm-form-section {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 24px;
        padding: 24px;
    }

    .kbm-form-section-head {
        margin-bottom: 0;
        padding-top: 6px;
    }
}

.kbm-form-grid-host {
    container-type: inline-size;
}

.kbm-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@container (min-width: 480px) {
    .kbm-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kbm-form-grid > .kbm-form-span-2,
    .kbm-form-grid > .kbm-form-span-4 {
        grid-column: span 2;
    }
}

@container (min-width: 720px) {
    .kbm-form-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .kbm-form-grid > .kbm-form-span-4 {
        grid-column: span 4;
    }
}

.kbm-form-field {
    display: flex;
    align-items: flex-start;
    min-width: 0;
}

.kbm-form-field-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* Level with the middle of the input line, as .kbm-field-with-tip does; centred beside a switch, check box or button. */
.kbm-form-field-tip {
    flex: 0 0 28px;
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.kbm-form-field:has(> .kbm-form-field-input > .mud-switch, > .kbm-form-field-input > .mud-checkbox, > .kbm-form-field-input > .mud-button-root, > .kbm-form-field-input > .mud-tooltip-root > .mud-button-root) {
    align-items: center;
}

.kbm-form-field:has(> .kbm-form-field-input > .mud-switch, > .kbm-form-field-input > .mud-checkbox, > .kbm-form-field-input > .mud-button-root, > .kbm-form-field-input > .mud-tooltip-root > .mud-button-root) > .kbm-form-field-tip {
    margin-top: 0;
}

.kbm-form-fact {
    min-width: 0;
    overflow-wrap: anywhere;
}

.kbm-form-fact-label {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ---- KbmTabHeader: what the tab lists with its "?" on the left, the actions on the right, wrapping on a phone ------ */
.kbm-tab-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.kbm-tab-header-text,
.kbm-tab-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.kbm-tab-header-actions {
    gap: 8px;
}

/* ---- KbmActionBar: a row of action buttons (questions 541-546 of 23 Nov 2026) --------------------------------------
   From 600 px each button as wide as its label, wrapping where the row no longer fits. In the mobile view two columns
   of the same width: every item starts at half the line (flex-basis) and may not get narrower than its longest word
   (min-width: min-content), so a word too long for half the line pushes its button onto a line of its own, where it
   grows to the whole width, as does a button left alone at the end. Labels break between words onto a second line. */
.kbm-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.kbm-action-bar-end {
    justify-content: flex-end;
}

/* The word of an icon button stays hidden from 600 px, also inside a menu's activator (a "More" menu). */
.kbm-action-bar .kbm-action-word {
    display: none;
}

@media (max-width: 599.98px) {
    .kbm-action-bar {
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
    }

    .kbm-page-header > .kbm-action-bar {
        flex: 1 1 100%;
    }

    .kbm-action-bar > * {
        flex: 1 1 calc(50% - 4px);
        min-width: min-content;
        white-space: normal;
    }

    .kbm-action-bar > :only-child {
        flex: 0 0 auto;
    }

    /* An icon button and its word are the bar's only button: it keeps its width, as a single button does. */
    .kbm-action-bar > .kbm-icon-button:first-child + .kbm-action-word:last-child {
        flex: 0 0 auto;
    }

    /* The button fills its item, also inside the wrapper of a tooltip or a menu. */
    .kbm-action-bar > :is(.mud-tooltip-root, .mud-menu, .kbm-new-button) {
        display: flex;
    }

    .kbm-action-bar > :is(.mud-tooltip-root, .mud-menu, .kbm-new-button) > :is(.mud-button-root, .mud-menu-activator),
    .kbm-action-bar > .mud-menu > .mud-menu-activator > .mud-button-root {
        flex: 1 1 auto;
        width: 100%;
    }

    .kbm-action-bar .mud-button-root {
        height: auto;
        min-height: 36px;
        white-space: normal;
        overflow-wrap: normal;
        hyphens: manual;
    }

    /* Icon and text start at the left of every button, so the icons of a column line up and a text broken onto a
       second line stays next to its icon. */
    .kbm-action-bar .mud-button-root {
        justify-content: flex-start;
        padding-inline: 12px;
    }

    .kbm-action-bar .mud-button-root .mud-button-label {
        justify-content: flex-start;
        text-align: start;
        line-height: 1.2;
    }

    /* After the wrapper rules above, so the icon gives way to its word. */
    .kbm-action-bar > .kbm-icon-button {
        display: none;
    }

    .kbm-action-bar > .kbm-action-word {
        display: inline-flex;
    }

    /* A menu opened by an icon button (More actions) shows its word too, filling its cell. */
    .kbm-action-bar > .mud-menu > .mud-menu-activator > .kbm-icon-button {
        display: none;
    }

    .kbm-action-bar > .mud-menu > .mud-menu-activator > .kbm-action-word {
        display: inline-flex;
        flex: 1 1 auto;
        width: 100%;
    }

    /* A "?" after the buttons keeps its own small size beside the last button instead of taking a column. */
    .kbm-action-bar > .kbm-help-tip-root {
        flex: 0 0 auto;
        min-width: 0;
        align-self: center;
    }
}

/* ---- KbmWeekPicker: arrows around the week, "This week" after it; wraps on a phone, the arrows stay with the text --- */
.kbm-week-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.kbm-week-picker-text {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.kbm-week-picker-date {
    flex: 0 0 11rem;
    margin-top: 0;
}

/* ---- Lists ordered by hand (KbmSortableRows, KbmDragHandle, KbmMoveMenu): the handle drags with mouse or touch ----- */
.kbm-sortable-rows .kbm-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 28px;
    min-height: 36px;
    cursor: grab;
    color: var(--kbm-text-secondary);
    touch-action: none;
}

/* A form grid beside the handle takes the rest of the row (its host measures its own width, so it has none of its own). */
.kbm-sortable-rows .kbm-sortable-row > .kbm-form-grid-host,
.kbm-sortable-rows .kbm-sortable-row > .mud-grid {
    flex: 1 1 0;
    min-width: 0;
}

.kbm-sortable-rows .kbm-drag-handle:hover {
    color: var(--mud-palette-primary);
}

.kbm-sortable-rows .kbm-drag-handle-disabled {
    visibility: hidden;
}

.kbm-sortable-rows .kbm-sortable-ghost {
    background: var(--kbm-blau-15);
}

.kbm-sortable-rows .kbm-sortable-drag {
    opacity: 0.9 !important;
    background: var(--mud-palette-surface);
}

/* ---- KbmAddressTabs Wrap: from 960 px every tab shows, on a second line where needed, the open one underlined (the
   slider and the scroll arrows only work on one line). */
@media (min-width: 960px) {
    .kbm-address-tabs-wrap .mud-tabs-tabbar-wrapper {
        flex-wrap: wrap;
        width: 100%;
        transform: none !important;
    }

    .kbm-address-tabs-wrap .mud-tabs-scroll-button,
    .kbm-address-tabs-wrap .mud-tab-slider {
        display: none;
    }

    .kbm-address-tabs-wrap .mud-tab {
        min-height: 40px;
        border-bottom: 2px solid transparent;
    }

    .kbm-address-tabs-wrap .mud-tab.mud-tab-active {
        border-bottom-color: var(--mud-palette-primary);
    }
}

/* ---- Tabs on a touch screen (phone, tablet): the tab bar scrolls sideways with the finger, as people expect from
   their phone's own apps. MudBlazor moves the tabs only with its arrow buttons (a transform), which a swipe does not
   reach, so the bar becomes a native scroll area here and the arrows go. KBM.Blazor.UI.MudBlazor.lib.module.js
   scrolls the open tab into view when it changes. Vertical tabs keep MudBlazor's behaviour. */
@media (pointer: coarse) {
    .mud-tabs-tabbar:not(.mud-tabs-vertical) .mud-tabs-tabbar-content {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .mud-tabs-tabbar:not(.mud-tabs-vertical) .mud-tabs-tabbar-content::-webkit-scrollbar {
        display: none;
    }

    .mud-tabs-tabbar:not(.mud-tabs-vertical) .mud-tabs-tabbar-wrapper {
        transform: none !important;
    }

    .mud-tabs-tabbar:not(.mud-tabs-vertical) .mud-tabs-scroll-button {
        display: none;
    }
}

/* ---- KbmLayout ---------------------------------------------------------------------- */
/* Clear space ½ X (X = logo height, 32 px at the default 160 px width) */
.kbm-layout-home {
  display: flex;
  align-items: center;
  margin-inline: 16px;
}

/* With a drawer the logo heads the drawer: 16 px on all sides, left edge level with the nav link icons */
.kbm-layout-drawer-home {
  flex: none;
  align-self: flex-start;
  margin: 0;
  padding: 16px;
}

/* The title takes the room between the menu (or logo) and the app bar's buttons and is shortened with an ellipsis.
   Where that room is too narrow to show a word (a phone with several buttons, which left only "K…"), the title is
   hidden: the logo names the app. The outer span is the container whose width decides, the inner one the text. */
.kbm-layout-title {
  flex: 1 1 0;
  min-width: 0;
  container-type: inline-size;
  container-name: kbm-layout-title;
}

.kbm-layout-title-text {
  display: block;
  font-family: var(--kbm-font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@container kbm-layout-title (max-width: 6.5rem) {
  .kbm-layout-title-text {
    display: none;
  }
}

.kbm-layout-menu + .kbm-layout-title {
  margin-inline-start: 12px;
}

.kbm-layout-content {
  padding-block: 2rem;
}

/* The skip link sits above the app bar (z-index 1300) and shows only while the Tab key has put the focus on it */
.kbm-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1310;
  padding: 8px 16px;
  border: 2px solid var(--kbm-on-brand-surface);
  background-color: var(--kbm-brand-surface);
  color: var(--kbm-on-brand-surface);
  font-family: var(--mud-typography-button-family);
  font-size: var(--mud-typography-button-size);
  font-weight: 600;
  cursor: pointer;
  transform: translateY(-200%);
}

.kbm-skip-link:focus {
  transform: none;
}

/* The main landmark takes the focus from the skip link, which needs no frame: the next Tab goes on in the page */
.kbm-layout-main-landmark {
  display: block;
}

.kbm-layout-main-landmark:focus {
  outline: none;
}

/* Where the scrolling content starts below the window's top edge: the app bar's height while the whole page scrolls,
   0 where only the area under the app bar scrolls. Sticky parts of a page use it: top: calc(var(--kbm-layout-sticky-top) + 8px). */
.kbm-layout {
  --kbm-layout-sticky-top: var(--mud-appbar-height);
}

/* At computer width only the area under the app bar scrolls, so its scrollbar starts below the app bar (it ran up beside
   it, which the installed app shows plainly). The mobile view keeps scrolling the whole page, so a phone's browser bar
   still hides while scrolling. Screen only: a printout shows the whole page. */
@media screen and (min-width: 960px) {
  html:has(.kbm-layout-scroll-content) {
    height: 100%;
    overflow: hidden;
  }

  .kbm-layout.kbm-layout-scroll-content {
    --kbm-layout-sticky-top: 0px;
  }

  .kbm-layout-scroll-content .kbm-layout-main {
    box-sizing: border-box;
    height: calc(100dvh - var(--mud-appbar-height));
    margin-top: var(--mud-appbar-height);
    padding-top: 0;
    overflow-y: auto;
  }
}

/* A link to a heading in the content (e.g. a section of a guide) scrolls it to 16 px below the app bar */
.kbm-layout-main :is(h1, h2, h3, h4, h5, h6)[id] {
  scroll-margin-top: calc(var(--kbm-layout-sticky-top) + 16px);
}

/* ---- KbmIconButton ---------------------------------------------------------------- */
/* The span a long press listens on: no own box, and no long-press menu, link preview or text selection of the phone */
.kbm-icon-button-press {
  display: inline-flex;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ---- KbmLanguageSelector ----------------------------------------------------------- */
.kbm-language {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.kbm-language-current {
  color: var(--kbm-accent);
}

/* ---- KbmSettingsMenu: overline headings, a hairline between the sections ------------ */
.kbm-settings-list {
  min-width: 240px;
}

.kbm-settings-heading.mud-typography {
  display: block;
  padding: 8px 16px 2px;
}

.kbm-settings-heading.mud-typography:not(:first-child) {
  margin-top: 4px;
  border-top: 1px solid var(--kbm-line);
}

.kbm-settings-divider {
  margin-block: 4px;
}

.kbm-settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.kbm-settings-label {
  flex: 1 1 auto;
}

/* The on/off switch is drawn as an icon: the whole entry is the control (menuitemcheckbox) */
.kbm-settings-toggle.mud-icon-root {
  font-size: 2rem;
  margin-block: -6px;
}

/* The help boxes' row: the current choice below its label, smaller and grey (the choices open in place, like the languages) */
.kbm-settings-value {
  display: block;
  font-size: 0.8125rem;
  color: var(--mud-palette-text-secondary);
}

/* ---- Components -------------------------------------------------------------------- */
.kbm-info-box-icon {
  color: var(--kbm-accent);
}

/* ---- KbmPageHelp: a Hinweisbox whose header row opens and closes it ------------------ */
.kbm-page-help.kbm-info-box {
  padding: 0;
  margin-bottom: 1rem;
}

.kbm-page-help-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.kbm-page-help-header:focus-visible {
  outline: 2px solid var(--kbm-accent);
  outline-offset: -2px;
}

/* Montserrat like the title of a Hinweisbox, in the body size so the collapsed box stays one slim row */
.kbm-page-help-title {
  flex-grow: 1;
  font-family: var(--kbm-font-heading);
  font-weight: 600;
}

/* Aligned with the title, after the icon */
.kbm-page-help-body {
  padding: 0 12px 12px 40px;
}

.kbm-page-help-body ul {
  margin: 6px 0 0;
  font-size: 0.875rem;
  line-height: 1.43;
}

.kbm-page-help-body li + li {
  margin-top: 2px;
}

.kbm-page-help-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 0.875rem;
}

@media (max-width: 599.98px) {
  .kbm-page-help-body {
    padding-left: 12px;
  }
}

/* After the first visit: what happens next and "Got it", under a line at the foot of the box */
.kbm-page-help-first-visit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--kbm-line);
  font-size: 0.875rem;
}

/* "New": what a release changed, marked in the list and on the closed row */
.kbm-page-help-new-tag {
  display: inline-block;
  padding: 0 5px;
  margin-right: 2px;
  background: var(--kbm-accent);
  color: var(--kbm-on-accent);
  font-family: var(--kbm-font-heading);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* The "?" named in a text ("Only ?"): the same icon as the "?" buttons, on the line of the text */
.kbm-help-mark .mud-icon-root {
  vertical-align: -4px;
  margin-inline: 1px;
}

/* ---- KbmPageTitle / KbmPageHelpButton: the "?" of the page's help box after the title ---- */
.kbm-page-title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.kbm-page-help-button {
  position: relative;
  display: inline-flex;
  flex: none;
}

/* News of a release the user has not opened: a dot on the "?" */
.kbm-page-help-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--kbm-accent);
  box-shadow: 0 0 0 2px var(--mud-palette-surface);
  pointer-events: none;
}

/* "Show me" in the help box starts the page's tour; it lines up with the text above it */
.kbm-page-help-show-me {
  margin-top: 8px;
  margin-left: -5px;
}

/* ---- KbmTour --------------------------------------------------------------------------
   Above dialogs (1400), below snackbars (1500) and tooltips (1600). The highlight's wide shadow dims the page around
   the element (no gradient); the clear backdrop keeps the page from being clicked while the tour runs. */
.kbm-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1450;
}

.kbm-tour-backdrop-dim {
  background-color: var(--mud-palette-overlay-dark);
}

.kbm-tour-highlight {
  position: fixed;
  z-index: 1451;
  border: 2px solid var(--kbm-accent);
  border-radius: var(--kbm-radius);
  box-shadow: 0 0 0 200vmax var(--mud-palette-overlay-dark);
  pointer-events: none;
  transition: top 0.2s, left 0.2s, width 0.2s, height 0.2s;
}

.kbm-tour-card {
  position: fixed;
  z-index: 1452;
  width: min(360px, calc(100vw - 32px));
  padding: 12px 16px 12px;
  background-color: var(--mud-palette-surface);
  color: var(--kbm-text);
  border: 1px solid var(--kbm-line);
  border-radius: var(--kbm-radius);
  box-shadow: var(--mud-elevation-8);
}

.kbm-tour-card:focus-visible {
  outline: 2px solid var(--kbm-accent);
  outline-offset: 2px;
}

.kbm-tour-card-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Phone width: across the bottom of the window (at the top when the element is down there) */
.kbm-tour-card.kbm-tour-card-docked {
  top: auto;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  width: auto;
  transform: none;
}

.kbm-tour-card.kbm-tour-card-docked.kbm-tour-card-top {
  top: calc(8px + env(safe-area-inset-top, 0px));
  bottom: auto;
}

.kbm-tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-right: -8px;
}

.kbm-tour-progress {
  font-size: 0.75rem;
  color: var(--kbm-text-secondary);
}

.kbm-tour-title {
  font-family: var(--kbm-font-heading);
  font-weight: 600;
  color: var(--kbm-accent);
  margin-bottom: 4px;
}

.kbm-tour-text {
  font-size: 0.875rem;
  line-height: 1.43;
}

.kbm-tour-not-shown {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--kbm-text-secondary);
}

.kbm-tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .kbm-tour-highlight {
    transition: none;
  }
}

/* ---- KbmHelpTip ---------------------------------------------------------------------- */
.kbm-help-tip-root {
  vertical-align: middle;
}

.kbm-help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
  padding: 2px;
  border: none;
  background: none;
  color: inherit;
  cursor: help;
}

.kbm-help-tip:focus-visible {
  outline: 2px solid var(--kbm-accent);
}

/* MudBlazor sets "max-width: none" inline when it positions the popover, so the limit needs !important.
   KbmHelpTip measures the room where the tip opens and passes it as --kbm-help-tip-max-width. */
.kbm-help-tip-popover {
  max-width: min(var(--kbm-help-tip-max-width, 320px), calc(100vw - 32px)) !important;
  text-align: left;
  white-space: normal;
}

/* A field with a "?" after it: <div class="kbm-field-with-tip"><MudTextField … /><KbmHelpTip … /></div>.
   The "?" sits level with the middle of the input line, not in the middle of the field and its helper text: the
   label's notch 6.5px plus half the 43px outlined input minus half the 24px tip. A button, check box, switch or link is
   centred, also a button inside a MudTooltip (one that names why it is disabled). */
.kbm-field-with-tip {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}

.kbm-field-with-tip > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.kbm-field-with-tip > .kbm-help-tip-root {
  margin-top: 16px;
}

.kbm-field-with-tip:has(> .mud-button-root, > .mud-tooltip-root > .mud-button-root, > .mud-checkbox, > .mud-switch, > .mud-link) {
  align-items: center;
}

.kbm-field-with-tip:has(> .mud-button-root, > .mud-tooltip-root > .mud-button-root, > .mud-checkbox, > .mud-switch, > .mud-link) > .kbm-help-tip-root {
  margin-top: 0;
}

/* ---- Touch targets on a phone or tablet -----------------------------------------------
   A finger needs about 44 px (WCAG 2.5.5, Apple 44 pt, Material 48 dp). With a mouse nothing changes.
   The "?" keeps its 24 px look and gets an invisible 44 px hit area around it, so a tap next to it opens the tip
   instead of the field beside it. A small KbmIconButton (30 px: Edit and Delete of a row) grows to 44 px with the same
   20 px icon, and two in a row keep a gap, so a tap meant for Edit never lands on Delete. A text button (no frame)
   gets 44 px of height; a small framed button the 36 px of a normal one. MudBlazor's buttons clip their ripple
   (overflow: hidden), so they grow instead of getting a hit area of their own. */
@media (pointer: coarse) {
  .kbm-help-tip {
    position: relative;
  }

  .kbm-help-tip::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
  }

  .kbm-icon-button .mud-icon-button.mud-icon-button-size-small {
    padding: 12px;
  }

  .kbm-icon-button + .kbm-icon-button {
    margin-inline-start: 4px;
  }

  .mud-button-root.mud-button-text {
    min-height: 44px;
  }

  .mud-button-root:is(.mud-button-outlined-size-small, .mud-button-filled-size-small) {
    min-height: 36px;
  }
}

/* ---- Overview tables (KbmOverviewTable): one toolbar line with the search, a chip per filter, + Filter and Columns.
   A header shows only its name; a sorted or filtered column gets a small mark. In the mobile view (< 600 px) the chips
   scroll sideways in their own line, the rows turn into cards and a filter opens as a sheet at the bottom. ---------- */
.kbm-overview-toolbar,
.kbm-overview-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 12px;
}

.kbm-overview-search {
    flex: 0 1 320px;
    min-width: 200px;
}

.kbm-overview-chips {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.kbm-overview-chip-anchor,
.kbm-overview-head-anchor {
    position: relative;
}

/* A filter looks like a small dropdown: its name, when set ": value" in bold on a light primary ground, and a chevron,
   or a × that clears it. Same height as the search field. */
.kbm-overview-chip {
    display: inline-flex;
    align-items: stretch;
    height: 40px;
    border: 1px solid var(--mud-palette-lines-inputs);
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}

.kbm-overview-chip:hover {
    border-color: var(--mud-palette-text-primary);
}

.kbm-overview-chip.set {
    background: color-mix(in srgb, var(--mud-palette-primary) 14%, var(--mud-palette-surface));
    border-color: transparent;
}

.kbm-overview-chip.add {
    border-style: dashed;
}

.kbm-overview-chip.open {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.kbm-overview-chip-open,
.kbm-overview-chip-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
}

.kbm-overview-chip-open {
    padding: 0 8px 0 12px;
}

.kbm-overview-chip.add .kbm-overview-chip-open {
    padding-left: 8px;
}

.kbm-overview-chip.set .kbm-overview-chip-open {
    padding-right: 2px;
}

.kbm-overview-chip-open .mud-icon-root,
.kbm-overview-chip-clear .mud-icon-root {
    color: var(--mud-palette-text-secondary);
}

.kbm-overview-chip.set .mud-icon-root,
.kbm-overview-chip.add .mud-icon-root {
    color: var(--mud-palette-primary);
}

.kbm-overview-chip-clear {
    padding: 0 8px 0 4px;
}

.kbm-overview-chip-text b {
    font-weight: 600;
}

.kbm-overview-chip-open:focus-visible,
.kbm-overview-chip-clear:focus-visible,
.kbm-overview-head:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.kbm-overview-columns-button {
    margin-left: auto;
}

/* A header: its name as a button (menu or sort), no icon until the column is sorted or filtered, so no column gets
   wider for a mark it does not show. */
.kbm-overview-head {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: inherit;
    cursor: pointer;
}

.kbm-overview-head:hover {
    text-decoration: underline;
}

.kbm-overview-head .kbm-overview-mark {
    font-size: 1rem;
}

.kbm-overview-popover {
    min-width: 280px;
    max-width: 360px;
}

.kbm-overview-popover:has(.kbm-overview-date) {
    width: 340px;
}

.kbm-overview-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px 12px;
}

.kbm-overview-panel-head {
    padding: 6px 4px 0;
    font-family: var(--kbm-font-heading);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mud-palette-primary);
}

.kbm-overview-panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.kbm-overview-divider {
    margin: 4px -12px;
    border: 0;
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* Sort A to Z / Z to A and the ready date ranges: a list of options, the picked one ticked. */
.kbm-overview-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 6px 12px 6px 8px;
    border: 0;
    background: none;
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
}

.kbm-overview-option:hover,
.kbm-overview-option:focus-visible {
    background: var(--mud-palette-action-default-hover);
    outline: none;
}

.kbm-overview-option.selected {
    background: color-mix(in srgb, var(--mud-palette-primary) 14%, var(--mud-palette-surface));
    font-weight: 600;
}

.kbm-overview-option-check {
    display: inline-flex;
    width: 20px;
    flex-shrink: 0;
    color: var(--mud-palette-primary);
}

.kbm-overview-option-days {
    margin-left: 4px;
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.kbm-overview-filter {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* A choice filter: its ticks scroll inside the menu; above 8 values a search field sits over them. */
.kbm-overview-choices {
    display: flex;
    flex-direction: column;
    max-height: 280px;
    overflow-y: auto;
}

.kbm-overview-hint {
    padding: 4px;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.kbm-overview-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kbm-overview-custom-dates {
    display: flex;
    gap: 8px;
}

.kbm-overview-custom-dates > *,
.kbm-overview-custom-dates .mud-input-control,
.kbm-overview-custom-dates .mud-input {
    flex: 1 1 0;
    min-width: 0;
}

.kbm-overview-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1301;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--mud-palette-surface);
    border-top: 2px solid var(--mud-palette-primary);
    box-shadow: var(--mud-elevation-8);
}

.kbm-overview-sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px 0 16px;
}

.kbm-overview-summary {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-surface));
    font-weight: 600;
}

.kbm-overview-table .kbm-overview-row-actions {
    text-align: right;
    white-space: nowrap;
}

.kbm-overview-table .kbm-overview-check {
    width: 48px;
    padding-right: 0;
}

.kbm-overview-table .mud-table-foot .kbm-overview-total {
    font-weight: 600;
    border-top: 2px solid var(--mud-palette-lines-default);
}

/* One line per currency. */
.kbm-overview-total-lines span {
    display: block;
    white-space: nowrap;
}

/* Virtualize: the rows scroll inside the table, under a header that stays. */
.kbm-overview-virtual .mud-table-container {
    max-height: 70vh;
    overflow-y: auto;
}

.kbm-overview-virtual thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.kbm-overview-placeholder {
    height: 37px;
    background: var(--mud-palette-background-gray);
}

.kbm-overview-pager {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

/* MudPagination draws round page buttons; the brand has no rounded corners. */
.kbm-overview-pager .mud-pagination-item .mud-button-root {
    border-radius: 0;
}

/* Mobile view cards: the title and its amount, then the other columns on one line. */
.kbm-overview-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kbm-overview-cards .kbm-overview-placeholder {
    height: 64px;
    margin-bottom: 8px;
}

.kbm-overview-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

/* A card with a RowHref opens its row wherever it is tapped: a link over the whole card, under the card's own links,
   buttons and tick boxes. */
.kbm-overview-card.linked {
    position: relative;
    cursor: pointer;
}

.kbm-overview-card-link {
    position: absolute;
    inset: 0;
    z-index: 0;
}

button.kbm-overview-card-link {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

/* A row with RowClick opens a dialog wherever it is clicked. */
.kbm-overview-table .kbm-overview-row-click {
    cursor: pointer;
}

/* Rows grouped with GroupBy: a heading row in the table, a heading over the cards in the mobile view. */
.kbm-overview-table .kbm-overview-group,
.kbm-overview-group-head {
    font-family: var(--kbm-font-heading);
    font-weight: 600;
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 6%, var(--mud-palette-surface));
}

.kbm-overview-group-head {
    padding: 6px 12px;
    margin-top: 8px;
}

.kbm-overview-card.linked :is(a:not(.kbm-overview-card-link), button:not(.kbm-overview-card-link), input, label, .mud-checkbox) {
    position: relative;
    z-index: 1;
}

.kbm-overview-card.linked:active {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-surface));
}

.kbm-overview-card.selected {
    border-color: var(--mud-palette-primary);
}

.kbm-overview-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.kbm-overview-card-head:has(.kbm-overview-card-check) {
    justify-content: flex-start;
}

.kbm-overview-card-head:has(.kbm-overview-card-check) .kbm-overview-card-main {
    flex: 1;
}

.kbm-overview-card-check {
    margin: -6px 0 -6px -8px;
    align-self: center;
}

.kbm-overview-card-main {
    min-width: 0;
    font-weight: 600;
}

.kbm-overview-card-amount {
    font-weight: 700;
    white-space: nowrap;
}

.kbm-overview-card-meta {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.kbm-overview-card-meta > span:empty {
    display: none;
}

.kbm-overview-card-meta > span:not(:empty) ~ span:not(:empty)::before {
    content: " · ";
}

/* A cell of several lines runs on in the card's one meta line. */
.kbm-overview-card-meta > span * {
    display: inline;
}

/* Cards that name their values (LabelledCards): the column's name before each value, two to a line. */
.kbm-overview-cards.labelled .kbm-overview-card-amount::before {
    content: attr(data-label) " ";
    font-weight: 400;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.kbm-overview-cards.labelled .kbm-overview-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
    margin-top: 2px;
}

.kbm-overview-cards.labelled .kbm-overview-card-meta > span:not(:empty) {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    white-space: nowrap;
}

.kbm-overview-cards.labelled .kbm-overview-card-meta > span:not(:empty)::before,
.kbm-overview-cards.labelled .kbm-overview-card-meta > span:not(:empty) ~ span:not(:empty)::before {
    content: attr(data-label);
}

.kbm-overview-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 2px;
}

@media (max-width: 599.98px) {
    /* Search and Columns share the first line; the chips get the second and scroll sideways. */
    .kbm-overview-search {
        flex: 1 1 0;
        min-width: 0;
    }

    .kbm-overview-columns-button {
        order: 1;
    }

    .kbm-overview-chips {
        order: 2;
        flex: 1 1 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .kbm-overview-chips .kbm-overview-chip-anchor {
        flex-shrink: 0;
    }

    .kbm-overview-sheet .kbm-overview-panel {
        padding: 8px 16px 16px;
    }

    .kbm-overview-sheet .kbm-overview-choices {
        max-height: none;
    }
}

/* ---- Columns dialog of KbmOverviewTable: the fixed columns with a lock, then the movable ones, dragged by their
   handle (KbmSortableRows). -------------------------------------------------------------------------------------- */
.kbm-columns-fixed-row,
.kbm-columns-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.kbm-columns-fixed-row {
    padding-left: 12px;
    color: var(--mud-palette-text-secondary);
}

.kbm-columns-row:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
}

/* Clear of the checkbox, whose invisible input MudBlazor pulls to the left over its neighbour. */
.kbm-columns-row .kbm-drag-handle {
    position: relative;
    z-index: 2;
    margin-inline-end: 4px;
}

.kbm-columns-hint {
    margin-top: 8px;
    color: var(--mud-palette-text-secondary);
}

.kbm-columns-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.kbm-columns-actions-more,
.kbm-columns-actions-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kbm-columns-actions-main {
    margin-left: auto;
}
