/*
 * Colors, fonts and the brand patterns come from KBM.Blazor.UI (kbm.css, kbm-mudblazor.css and KbmTheme). Use the
 * MudBlazor palette (var(--mud-palette-…)) or the KBM tokens (var(--kbm-…)) here, never own colors, and keep the
 * corners square ("keine Ecken").
 */

/* Shown until the app has loaded, before MudBlazor's palette exists, so only the KBM tokens are used. */
.app-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 100vh;
}

.app-loading-title {
    font-family: var(--kbm-font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--kbm-blau);
}

/* "Signing in …" while the page goes to the identity provider (start.js). */
.app-loading-status {
    font-family: var(--kbm-font-body);
    font-size: 0.875rem;
    color: var(--kbm-blau);
}

/* A square bar that runs from left to right while the app loads. */
.app-loading-bar {
    position: relative;
    width: 200px;
    height: 4px;
    overflow: hidden;
    background: var(--kbm-blau-15);
}

.app-loading-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: var(--kbm-blau);
    animation: app-loading 1.2s ease-in-out infinite;
}

@keyframes app-loading {
    to {
        left: 100%;
    }
}

/* A warning (Warnhinweis): black text on Alpengelb. */
#blazor-error-ui {
    background: var(--kbm-alpengelb);
    color: var(--kbm-schwarz);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* FocusOnNavigate (App.razor) focuses the page title after navigation; no focus frame for that. */
h1:focus {
    outline: none;
}

/* The way back above a title (KbmBackLink) keeps a small gap to the title below it. */
.kbm-back-link {
    margin-bottom: 8px;
}

/* The eye that hides amounts (AmountsButton) stays on the right when a long title pushes it onto its own line. */
.kbm-page-header > .amounts-toggle {
    margin-left: auto;
}

/* Portal tiles and the cards of the Administration overview: the whole tile is the link. */
.portal-tile {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.portal-tile-paper {
    height: 100%;
    border-top: 2px solid var(--mud-palette-primary);
    transition: box-shadow 0.15s ease-in-out;
}

.portal-tile:hover .portal-tile-paper,
.portal-tile:focus-visible .portal-tile-paper {
    box-shadow: var(--mud-elevation-4);
}

.portal-tile:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.portal-tile-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* The cards of the start page and the Cockpit (RUL-PLT-32): title and period left, Open right; a hidden card shows ••••
   until tapped (RUL-PLT-33). */
.card-board {
    margin-bottom: 24px;
}

.card-board-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 8px;
    margin-bottom: 4px;
}

.card-frame {
    height: 100%;
    border-top: 2px solid var(--mud-palette-primary);
}

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

.card-frame-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    min-width: 0;
}

.card-frame-title h2 {
    overflow-wrap: anywhere;
}

.card-frame-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.card-frame-open {
    white-space: nowrap;
}

/* The Cockpit's cards (SCR-CP-1): a big figure with its label, small figure rows and tables that fit the phone. */
.cockpit-figure {
    font-size: 1.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.cockpit-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px 16px;
    margin-bottom: 8px;
}

.cockpit-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.cockpit-table th,
.cockpit-table td {
    padding: 4px 6px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    text-align: right;
    white-space: nowrap;
}

.cockpit-table th:first-child,
.cockpit-table td:first-child {
    min-width: 7rem;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    padding-left: 0;
}

.cockpit-table th {
    font-weight: 600;
}

.cockpit-table tr.cockpit-row-sum td {
    font-weight: 600;
}

.cockpit-scroll {
    overflow-x: auto;
}

.cockpit-period {
    max-width: 16rem;
}

.treuhand-year {
    min-width: min(17rem, 100%);
    max-width: min(22rem, 100%);
}

.cockpit-chart {
    max-height: 260px;
}

/* Margin per business line (SCR-CP-2): a line below another is indented. */
.margin-level-1 {
    padding-left: 16px;
}

.card-frame-hidden {
    display: flex;
    align-items: baseline;
    gap: 12px;
    width: 100%;
    padding: 8px 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.card-frame-hidden:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.card-frame-dots {
    font-size: 1.5rem;
    letter-spacing: 0.15em;
}

.card-lines {
    list-style: none;
    margin: 0;
    padding: 0;
}

.card-lines li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.card-lines li:last-child {
    border-bottom: 0;
}

.card-count {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.card-lines .card-line-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Customize cards (SCR-PLT-9): period and Show directly under the card's name. */
.cards-row {
    align-items: flex-start;
    padding: 4px 8px;
}

.cards-row .drag-handle {
    margin-top: 4px;
}

.cards-row-main {
    flex: 1 1 auto;
    min-width: 0;
}

.cards-row-settings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 0 0 8px 8px;
}

.cards-row-period {
    max-width: 220px;
}

/* The portal's groups (SCR-PLT-1): compact tiles with a short text of at most two lines, cut with "…" when it is longer
   (a phone shows no tooltip). */
.portal-group + .portal-group {
    margin-top: 24px;
}

.portal-group-title {
    margin-bottom: 8px;
}

.portal-tile-head-compact {
    margin-bottom: 4px;
}

.portal-tile-text {
    color: var(--mud-palette-text-secondary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* A switch next to a "?" tip, level with the outlined fields of the same row. */
.settings-switch {
    align-items: center;
    min-height: 40px;
}

/* The company's logo on the settings page: shown whole in a box as wide as a letterhead's logo, the buttons beside it
   (below it on a phone). */
.settings-logo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.settings-logo-picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 240px;
    max-width: 100%;
    height: 96px;
    padding: 8px;
    border: 1px solid var(--mud-palette-lines-default);
}

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

/* Send the PDF (RUL-SR-13): a long address wraps in mobile view instead of widening the dialog. */
.send-pdf-recipient .mud-typography,
.parts-pdf-sent {
    overflow-wrap: anywhere;
}

/* Send the PDF: each PDF the e-mail carries is a row with a PDF icon, lined up with the recipients' checkboxes below. */
.send-pdf-part {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0 4px 12px;
    overflow-wrap: anywhere;
}

.settings-logo-picture .file-thumb {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

/* Number ranges on the company settings page: the actions stay on one line. */
.number-range-actions {
    white-space: nowrap;
    text-align: right;
}

/* Below the md breakpoint the table shows each range as a card (Breakpoint.Sm): both buttons together on the right. */
@media (max-width: 960px) {
    .number-ranges .mud-table-cell.number-range-actions {
        justify-content: flex-end;
        gap: 8px;
    }

    .number-ranges .mud-table-cell.number-range-actions::before {
        display: none;
    }
}

/* History tab (RUL-PLT-6): one block per entry, newest first. */
.history-entry {
    padding: 12px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.history-entry-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
}

.history-changes {
    margin: 8px 0 0 0;
    overflow-wrap: anywhere;
}

/* E-mail log (RUL-PLT-18): a row opens the whole e-mail; the dialog lists its fields and keeps the text's lines. */
.mail-log .mail-log-row {
    cursor: pointer;
}

.mail-fields {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 16px;
    margin: 0;
}

.mail-fields dt {
    color: var(--mud-palette-text-secondary);
}

.mail-fields dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* Values of a record shown as label and value side by side, e.g. the cards of a project's Overview tab. */
.overview-values {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 16px;
    margin: 0;
}

.overview-values dt {
    color: var(--mud-palette-text-secondary);
}

.overview-values dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.mail-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 12px;
    border: 1px solid var(--mud-palette-lines-default);
}

@media (max-width: 599.98px) {
    .mail-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .mail-fields dd {
        margin-bottom: 8px;
    }
}

/* Help page (RUL-PLT-39): the search box and the guide menu on the left (sticky, scrolling on its own when it is
   longer than the window), the guide on the right. */
.help-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.help-side {
    position: sticky;
    top: calc(var(--kbm-layout-sticky-top, 64px) + 16px);
    max-height: calc(100dvh - var(--mud-appbar-height) - 32px);
    overflow-y: auto;
    padding-right: 8px;
    border-right: 1px solid var(--mud-palette-lines-default);
}

.help-search {
    margin-bottom: 12px;
}

/* The guide menu (HelpGuideMenu): a group per module that opens and closes, the guides as links, the shown guide
   marked with the bar of the side menu and its sections under it. */
.help-guide-menu {
    display: flex;
    flex-direction: column;
}

.help-guide-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Level with the guides' text, which sits behind the 3 px bar of the shown guide. */
    padding: 6px 8px 6px 11px;
    border: 0;
    background: none;
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.help-guide-group:hover,
.help-guide-link:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.help-guide-group-state {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--mud-palette-text-secondary);
    font-weight: 400;
}

.help-guide-group-guides {
    display: flex;
    flex-direction: column;
}

.help-guide-link {
    padding: 5px 8px 5px 20px;
    border-left: 3px solid transparent;
    color: var(--mud-palette-primary);
    text-decoration: none;
}

.help-guide-link.standalone {
    padding-left: 8px;
}

.help-guide-link.current {
    border-left-color: var(--mud-palette-primary);
    background-color: var(--mud-palette-background-gray);
    color: var(--mud-palette-text-primary);
    font-weight: 600;
}

.help-guide-section {
    padding: 3px 8px 3px 32px;
    font-size: 0.875rem;
    color: var(--mud-palette-primary);
    text-decoration: none;
}

.help-guide-section.standalone {
    padding-left: 20px;
}

.help-guide-section:hover {
    text-decoration: underline;
}

/* The guide picker and the contents above the guide: only on narrow screens and in the mobile view. */
.help-guide-picker,
.help-guide-contents-toggle,
.help-guide-contents {
    display: none;
}

.help-guide-heading {
    margin-bottom: 12px;
}

/* The list of guides in the picker's dialog: rows with lines between them, easy to tap. */
.help-guides-dialog .help-guide-group,
.help-guides-dialog .help-guide-link {
    padding-top: 10px;
    padding-bottom: 10px;
}

.help-guides-dialog .help-guide-menu > * {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* A long word or address breaks only where it would overflow, so table columns keep their words whole. */
.help-guide {
    max-width: 860px;
    overflow-wrap: break-word;
}

/* A section a link jumps to stays clear of the app bar. */
.help-guide h2,
.help-guide h3 {
    scroll-margin-top: calc(var(--kbm-layout-sticky-top, 64px) + 16px);
}

/* A picture of the app in a guide (living pictures): as wide as the text at most, framed like a screen; the mobile
   view's picture is a phone's width. */
.help-guide picture img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 8px 0 16px;
    border: 1px solid var(--mud-palette-lines-default);
}

@media (max-width: 599.98px) {
    .help-guide picture img {
        max-width: min(100%, 360px);
    }
}

/* A wide table scrolls on its own instead of widening the page. */
.help-guide table {
    display: block;
    overflow-x: auto;
}

/* Narrow windows and the mobile view: one column; the guide menu becomes the picker above the guide, which opens the
   list of guides in a dialog, and the contents fold open under it. */
@media (max-width: 900px) {
    .help-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .help-side {
        position: static;
        max-height: none;
        overflow: visible;
        padding-right: 0;
        border-right: 0;
    }

    .help-guide-nav,
    .help-guide-heading {
        display: none;
    }

    .help-guide-picker {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 8px;
        padding: 6px 12px;
        border: 1px solid var(--mud-palette-lines-inputs);
        background: none;
        color: var(--mud-palette-text-primary);
        font: inherit;
        text-align: left;
        cursor: pointer;
    }

    .help-guide-picker-caption {
        display: block;
        font-size: 0.75rem;
        color: var(--mud-palette-text-secondary);
    }

    .help-guide-picker-title {
        display: block;
        font-size: 1rem;
    }

    .help-guide-contents-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 8px;
        padding: 8px 0;
        border: 0;
        border-top: 1px solid var(--mud-palette-lines-default);
        border-bottom: 1px solid var(--mud-palette-lines-default);
        background: none;
        color: var(--mud-palette-primary);
        font: inherit;
        text-align: left;
        cursor: pointer;
    }

    .help-guide-contents {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 16px;
    }
}

/* Help search (RUL-PLT-39): the hits of Search the help on the Help page, one block each. */
.help-search-hit {
    margin-bottom: 12px;
    max-width: 860px;
}

/* The quick search (Ctrl+K): a heading per source, then one row per hit with its icon, title and a line of text. */
.quick-search-results {
    margin-top: 8px;
    max-height: min(60vh, 560px);
    overflow-y: auto;
}

/* In the mobile view the dialog fills the screen: the hits use its whole height instead of a box with empty space below. */
.mud-dialog-fullscreen .quick-search-results {
    max-height: none;
}

.quick-search-group {
    display: block;
    margin: 12px 0 4px;
}

.quick-search-hit {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 6px 8px;
    color: inherit;
    text-decoration: none;
}

.quick-search-hit > .mud-icon-root {
    margin-top: 2px;
    flex: none;
}

/* Hover and the picked hit tint the surface with the primary colour, so the texts keep their contrast in light and
   dark mode (a fixed light blue left white text unreadable in dark mode); the picked one also has a bar on its left. */
a.quick-search-hit:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-surface));
}

.quick-search-hit.active {
    background: color-mix(in srgb, var(--mud-palette-primary) 14%, var(--mud-palette-surface));
    box-shadow: inset 3px 0 0 var(--mud-palette-primary);
}

.quick-search-title {
    font-weight: 600;
}

/* A line of text, cut after two lines; a tip shows whole, it is the answer. */
.quick-search-line {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
}

.quick-search-line.quick-search-full {
    display: block;
}

/* File store (RUL-PLT-14). The file input of FileUploader: invisible but not display:none, so phones open its chooser. */
.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

/* FileUploader on desktop: the card files are dragged over (its dialog or paper), outlined and labelled by files.js. */
.file-drop-active {
    position: relative;
    outline: 2px dashed var(--mud-palette-primary);
    outline-offset: -2px;
}

.file-drop-active::after {
    content: attr(data-drop-label);
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
    font-family: var(--kbm-font-heading);
    font-size: 1.125rem;
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-surface) 90%, transparent);
    pointer-events: none;
}

/* A stored file's picture or type icon in a square (FileThumbnail); images are never framed or rounded (brand). */
.file-thumb {
    display: block;
    flex: none;
    object-fit: cover;
    background: var(--kbm-panel);
}

.file-thumb-contain {
    object-fit: contain;
}

/* As wide as its place, and square: the tiles of a photo grid. */
.file-thumb-fluid {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

.file-thumb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* FileUploader: one row per chosen file with its progress or why it was refused. */
.file-uploads {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.file-upload-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin-bottom: 4px;
}

.file-upload-name {
    overflow-wrap: anywhere;
}

.file-upload-state {
    margin-left: auto;
}

/* FilePreviewDialog: the whole image, as large as the dialog and the window allow. */
.file-preview {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    margin: 0 auto;
    object-fit: contain;
}

/* The restore check on the company settings page: an id and a hash break anywhere rather than widen the page. */
.file-problem-id {
    overflow-wrap: anywhere;
    min-width: 0;
}

/* Article documents (RUL-MD-36). Photos: a grid of square tiles, each a button that opens the document. */
.article-documents-section + .article-documents-section {
    margin-top: 24px;
}

.article-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.article-photo {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.article-photo:focus-visible,
.article-header-photo:focus-visible,
.article-list-photo:focus-visible {
    outline: 2px solid var(--kbm-accent);
    outline-offset: 2px;
}

/* The mobile view's article cards keep to text: the photo column leaves no gap on the meta line. */
.kbm-overview-card-meta > span:has(> .article-list-photo) {
    display: none;
}

/* The star of the main photo: brand surface with its text colour, square like everything else. */
.article-photo-main {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    padding: 4px;
    background: var(--kbm-brand-surface);
    color: var(--kbm-on-brand-surface);
}

.article-photo-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.875rem;
}

/* Photos of an open point (RUL-PRJ-7). In its dialog: square tiles that open large, each with a cross that removes it.
   In the list: a row of small tiles under the title, the last one "+n" when there are more. */
.open-point-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.open-point-photo {
    position: relative;
    min-width: 0;
}

.open-point-photo-open,
.open-point-thumb {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.open-point-photo-open {
    width: 100%;
}

.open-point-photo-open:focus-visible,
.open-point-thumb:focus-visible {
    outline: 2px solid var(--kbm-accent);
    outline-offset: 2px;
}

.open-point-photo-remove {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--mud-palette-surface);
}

.open-point-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 4px;
}

.open-point-thumbs-more {
    width: 48px;
    height: 48px;
    border: 1px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-primary);
    font-weight: 600;
}

/* AttachedFilesField: the files and photos of a record in a form (534 A), square tiles with the name below and a cross
   that removes one. */
.attached-files-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.attached-file {
    position: relative;
    min-width: 0;
}

.attached-file-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.attached-file-open:focus-visible {
    outline: 2px solid var(--kbm-accent);
    outline-offset: 2px;
}

.attached-file-name {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.attached-file-remove {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--mud-palette-surface);
}

/* The paper clip with a count next to an activity's subject (534 A). */
.file-count {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
    vertical-align: middle;
}

/* Related articles, browse view (RUL-MD-35, RUL-MD-41): a shelf of article cards per kind, like a shop; in the mobile
   view a shelf scrolls sideways with two cards in sight. */
.relation-shelf {
    margin-bottom: 24px;
}

.relation-shelf-title {
    margin: 0 0 8px;
    font-family: var(--kbm-font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--mud-palette-primary);
}

.relation-shelf-count {
    margin-left: 4px;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
}

.relation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.relation-cards-small {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.relation-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    color: inherit;
    text-decoration: none;
}

.relation-card:hover {
    border-color: var(--mud-palette-primary);
}

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

.relation-card-photo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    margin-bottom: 6px;
    background: var(--kbm-panel);
    overflow: hidden;
}

.relation-card-photo img,
.relation-card-photo .file-thumb {
    width: 100%;
    height: 100%;
}

.relation-card-icon.mud-icon-root {
    width: 40%;
    height: 40%;
    color: var(--mud-palette-text-secondary);
}

.relation-card-badge {
    position: absolute;
    top: 0;
    left: 0;
    padding: 2px 6px;
    font-size: 0.75rem;
    background: var(--kbm-brand-surface);
    color: var(--kbm-on-brand-surface);
}

.relation-card-inactive .relation-card-photo > img {
    opacity: 0.5;
}

.relation-card-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
    color: var(--mud-palette-primary);
}

.relation-card-number,
.relation-card-fact,
.relation-card-replaced,
.relation-card-differs,
.relation-card-note {
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.relation-card-fact {
    color: var(--mud-palette-text-primary);
}

@media (max-width: 599.98px) {
    .relation-cards {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 4px;
    }

    .relation-card {
        flex: 0 0 calc(50% - 6px);
        scroll-snap-align: start;
    }
}

/* A plant photo taken before its component changed (RUL-MD-58): "Before change (date)" over the picture's top edge. */
.plant-photo-mark {
    position: absolute;
    top: 0;
    left: 0;
    padding: 2px 6px;
    background: var(--mud-palette-warning);
    color: var(--mud-palette-warning-text);
    font-size: 0.75rem;
}

.plant-photo-mark.plant-photo-mark-inline {
    position: static;
}

/* A plant's Structure tab (SCR-MD-20): a toolbar, the tree and, from 600 px, the panel of the chosen component beside it
   (below it up to 960 px). Rows fold with a chevron, are dragged by their handle (plant-structure.js marks the row under
   the pointer with data-drop) and indent by their depth along a line. */
.plant-structure-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.plant-structure-search {
    flex: 0 1 280px;
    min-width: 200px;
}

.plant-structure-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.plant-structure-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 12px;
    margin-bottom: 8px;
    background: var(--mud-palette-background-gray);
}

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

@media (min-width: 960px) {
    .plant-structure {
        grid-template-columns: minmax(0, 1fr) 380px;
        align-items: start;
    }

    .plant-structure-hint {
        grid-column: 1;
    }
}

.plant-structure-tree {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.plant-structure-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 52px;
    padding-right: 4px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.plant-structure-row.plant-structure-selected {
    background: var(--mud-palette-primary-hover);
}

.plant-structure-row[data-drop="before"] {
    box-shadow: inset 0 3px 0 var(--mud-palette-info);
}

.plant-structure-row[data-drop="after"] {
    box-shadow: inset 0 -3px 0 var(--mud-palette-info);
}

.plant-structure-row[data-drop="inside"] {
    box-shadow: inset 0 0 0 2px var(--mud-palette-info);
    background: var(--mud-palette-info-hover);
}

.plant-structure-row.plant-structure-dragged {
    opacity: 0.4;
}

.plant-structure-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    align-self: stretch;
    flex-shrink: 0;
    cursor: grab;
    color: var(--mud-palette-text-secondary);
    touch-action: none;
}

.plant-structure-handle:hover {
    color: var(--mud-palette-primary);
}

.plant-structure-indent {
    flex-shrink: 0;
    align-self: stretch;
}

.plant-structure-indent.plant-structure-indented {
    border-right: 1px solid var(--mud-palette-lines-default);
    margin-right: 4px;
}

.plant-structure-chevron .mud-icon-root {
    transition: transform 0.15s;
}

.plant-structure-chevron.plant-structure-open .mud-icon-root {
    transform: rotate(90deg);
}

.plant-structure-leaf {
    width: 34px;
    flex-shrink: 0;
}

.plant-structure-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 6px 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.plant-structure-name:focus-visible {
    outline: 2px solid var(--kbm-accent);
    outline-offset: 2px;
}

.plant-structure-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
}

.plant-structure-code {
    font-family: var(--kbm-font-heading);
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.plant-structure-label {
    font-weight: 600;
}

.plant-structure-token,
.plant-structure-machine {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.plant-structure-count {
    padding: 0 6px;
    font-size: 0.75rem;
    background: var(--mud-palette-background-gray);
    color: var(--mud-palette-text-secondary);
}

.plant-structure-uses {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.plant-structure-parts {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0 6px;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.plant-structure-side {
    padding: 16px;
    background: var(--mud-palette-background-gray);
}

.plant-component-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plant-component-head {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.plant-component-title {
    display: flex;
    flex-wrap: wrap;
    column-gap: 8px;
    margin-top: 2px;
    font-family: var(--kbm-font-heading);
    font-size: 1.125rem;
    font-weight: 600;
}

.plant-component-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}

.plant-component-photos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.plant-component-part {
    padding: 4px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.plant-component-actions .mud-button-root {
    justify-content: flex-start;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    min-height: 48px;
}

/* The mobile view: a narrower indent; the handle stays (a finger drags it) and the sheet moves rows too. */
@media (max-width: 599.98px) {
    .plant-structure-search {
        flex: 1 1 100%;
    }

    .plant-structure-toolbar-actions {
        margin-left: 0;
    }
}

.article-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

.article-video video,
.article-document-video {
    display: block;
    width: 100%;
    max-height: 60vh;
    background: var(--kbm-schwarz);
}

.article-video-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Plant documents (SCR-DOC-1): a row per document with its picture or type icon, text and actions, and its versions
   below when opened. */
.plant-documents-section + .plant-documents-section {
    margin-top: 24px;
}

.plant-document {
    padding: 8px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.plant-document-row,
.plant-document-version {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.plant-document-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.plant-document-notes {
    white-space: pre-line;
}

.plant-document-actions {
    display: inline-flex;
    flex: none;
    align-items: center;
}

.plant-document-versions-toggle {
    margin-left: 40px;
}

.plant-document-versions {
    margin: 4px 0 0 52px;
}

.plant-document-version {
    padding: 6px 0;
}

.plant-document-version + .plant-document-version {
    border-top: 1px dashed var(--mud-palette-lines-default);
}

/* "Current" beside the newest version: brand surface with its text colour, square like everything else. */
.plant-document-current {
    padding: 0 6px;
    background: var(--kbm-brand-surface);
    color: var(--kbm-on-brand-surface);
    font-size: 0.75rem;
    line-height: 1.5rem;
}

/* A copy of a library master (RUL-DOC-6): where it came from, "Newer master V4" in the warning colour with "Take V4"
   beside it, and a waiting proposal; a version's source line. */
.document-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
}

.document-newer,
.document-proposed,
.library-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 0.75rem;
    line-height: 1.25rem;
}

.document-newer {
    background: var(--mud-palette-warning);
    color: var(--mud-palette-warning-text);
}

.document-proposed {
    border: 1px solid var(--mud-palette-lines-default);
}

/* The library (SCR-DOC-2), an overview table: the title cell keeps room for the title and its versions and has no
   line of its own (the row has one); tags as small square labels, open proposals as a link-button; proposals in the
   document dialog. */
.library-document {
    min-width: 240px;
    padding: 0;
    border-bottom: none;
}

.library-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.library-tag {
    background: var(--kbm-brand-surface);
    color: var(--kbm-on-brand-surface);
}

.library-tag-remove {
    margin-left: 4px;
    padding: 0 2px;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.library-proposals {
    margin-left: -8px;
}

.library-proposal {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
    padding: 8px 0;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.library-proposal-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* "Use a master": one button per master, its title and facts on two lines. */
.use-master-list {
    display: flex;
    flex-direction: column;
}

.use-master-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px;
    border: none;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: none;
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.use-master-option:hover:not(:disabled),
.use-master-option:focus-visible {
    background: var(--mud-palette-action-default-hover);
}

.use-master-option:disabled {
    cursor: default;
    color: var(--mud-palette-text-disabled);
}

.use-master-facts {
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
}

/* The document search (SCR-DOC-3): a row per hit with the icon of where it is. */
.document-hit {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.document-hit + .document-hit {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.document-hit-icon {
    flex: none;
    margin-top: 2px;
}

@media (max-width: 599.98px) {
    .plant-document-versions-toggle {
        margin-left: 0;
    }

    .plant-document-versions {
        margin-left: 0;
    }

    .library-proposal-actions {
        margin-left: 0;
    }
}

/* The main photo next to the article's name and in the first column of the list. */
.article-header-photo,
.article-list-photo {
    display: block;
    flex: none;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.article-document-facts {
    overflow-wrap: anywhere;
}

.article-document-uses li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
}

/* A caption with its "?" over a group of values, such as a filter's values in an overview table. */
.field-caption {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 26px;
}

/* A signature on a form (SignatureField, SCR-PLT-8): "Tap to sign" in a white box like paper, the signature small after
   Done. The drawing itself is given in the full-screen signing view below. */
.signature-field-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 480px;
    height: 96px;
    background: white;
    color: black;
    border: 1px dashed var(--mud-palette-lines-inputs);
    font: inherit;
    cursor: pointer;
}

.signature-field-empty:disabled {
    cursor: default;
    opacity: 0.6;
}

.signature-field-empty:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.signature-field-preview {
    display: block;
    width: 240px;
    max-width: 100%;
    aspect-ratio: 3 / 1;
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
}

/* The signing view (SigningView, SCR-PLT-8): one line on top, the pad fills the rest of the screen, the buttons at the
   bottom. dvh keeps the bottom bar above a phone's address bar. The pad is white like paper in both themes, so the
   black strokes read in the PDF; the finger draws instead of scrolling the page. */
.mud-dialog.signing-view {
    height: 100dvh;
}

.signing-view .signing-view-content {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding: 0;
    overflow: hidden;
}

.signing-view-head,
.signing-view-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    flex: 0 0 auto;
}

.signing-view-line {
    display: flex;
    flex-wrap: wrap;
    column-gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.signing-view-subject {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.signing-view-signer {
    font-weight: 600;
}

.signing-view-pad {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 12px;
}

.signing-view-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: white;
    border: 1px solid var(--mud-palette-lines-inputs);
    touch-action: none;
    cursor: crosshair;
}

.signing-view-turn {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border: 1px solid var(--mud-palette-lines-default);
    pointer-events: none;
}

.signing-view-hint {
    flex: 1 1 auto;
    min-width: 0;
}

/* A stored signature (RUL-SR-18) as drawn: white like paper in both themes. */
.stored-signature {
    display: block;
    max-width: 320px;
    width: 100%;
    background: white;
    border: 1px solid var(--mud-palette-lines-default);
}

/* The summary before signing (SCR-SR-3, SCR-SR-4): labels on the left of the report's facts, photos as thumbnails. */
.signing-facts th {
    width: 1%;
    white-space: nowrap;
    text-align: left;
    font-weight: 500;
}

/* The day's tables fit a 360 px phone: narrower cell padding there; a table still too wide scrolls on its own. */
.signing-table .mud-table-container {
    overflow-x: auto;
}

@media (max-width: 599.98px) {
    .signing-table th,
    .signing-table td {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .signing-table th {
        letter-spacing: normal !important;
        font-size: 0.75rem !important;
        hyphens: auto;
    }

    /* A dialog that shows the summary (Release without signature) takes the whole width in mobile view, so its tables
       fit as they do on the Sign page. */
    .mud-dialog:has(.signing-summary) {
        margin: 8px;
        width: calc(100% - 16px);
        max-width: calc(100% - 16px);
    }

    .mud-dialog:has(.signing-summary) .mud-dialog-content {
        padding-left: 8px;
        padding-right: 8px;
    }
}

.signing-photo {
    margin: 0;
    width: 160px;
}

.signing-photo img {
    display: block;
    width: 160px;
    height: 120px;
    object-fit: cover;
}

/* A report's photo the phone can't show (offline, or waiting to be sent, RUL-SR-14): a box with an icon in its place. */
.report-photo-offline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-text-secondary);
    vertical-align: middle;
}

.signing-photo .report-photo-offline {
    width: 160px;
    height: 120px;
}

/* The positions of a document (PositionsEditor, RUL-PLT-23): a group's positions indented, the totals right-aligned. */
.positions-table .positions-in-group {
    padding-left: 24px;
}

.positions-table .positions-number input {
    text-align: right;
}

/* The columns keep their widths and the text takes the rest; below 960 px the rows stack. */
@media (min-width: 960px) {
    .positions-table table {
        table-layout: fixed;
    }

    .positions-table.mud-table .mud-table-row .mud-table-cell {
        padding-left: 4px;
        padding-right: 4px;
        vertical-align: top;
    }

    /* Rows align at the top, so a longer description or the account line below it leaves the fields beside it at the
       height of its first line; plain values (number, amount, handle, menu) sit at the middle of that line. */
    .positions-table.mud-table .mud-table-row .mud-table-cell:not(:has(.mud-input-control)) {
        padding-top: 22px;
    }

    .positions-table.mud-table .mud-table-row .mud-table-cell:has(.mud-menu) {
        padding-top: 18px;
    }

    .positions-table.mud-table .mud-table-row .mud-table-cell.positions-handle-cell {
        padding-top: 16px !important;
    }
}

/* Positions 2: the drag handle (in the mobile view a bar across the top of each stacked row, so only the bar drags and
   the rest of the row scrolls), the row being dragged (positions-editor.js), the formatting toolbar and a formatted text
   shown like its field. */
.positions-table .positions-handle-cell {
    width: 28px;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

@media (max-width: 959.98px) {
    .positions-table.mud-table .mud-table-row .mud-table-cell.positions-handle-cell {
        display: flex;
        justify-content: center;
        width: auto;
        padding: 0 !important;
    }

    .positions-table .positions-handle-cell .drag-handle {
        width: 100%;
        min-height: 36px;
    }

    .positions-table .positions-handle-cell .drag-handle .mud-icon-root {
        transform: rotate(90deg);
    }

    /* Every label of a stacked position is as wide as the longest one, so all fields start at the same edge and run
       to the right edge. */
    .positions-table.mud-table .mud-table-row .mud-table-cell:not(.positions-handle-cell)::before {
        flex: 0 0 7.5rem;
        overflow-wrap: anywhere;
    }

    .positions-table.mud-table .mud-table-row .mud-table-cell:not(.positions-handle-cell) > .mud-input-control,
    .positions-table.mud-table .mud-table-row .mud-table-cell:not(.positions-handle-cell) > div {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.positions-table .drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-height: 32px;
    cursor: grab;
    touch-action: none;
    color: var(--mud-palette-text-secondary);
}

.positions-table .drag-handle:hover {
    color: var(--mud-palette-primary);
}

.positions-table .sortable-ghost {
    opacity: 0.35;
}

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

.positions-format-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 2px;
}

.positions-format-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}

.positions-format-button:hover {
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-primary);
}

/* The same type and spacing as the outlined dense field it stands for. */
.positions-text {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.positions-formatted {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 8.5px 14px;
    font-size: 18px;
    line-height: 1.4375;
    text-align: left;
    overflow-wrap: anywhere;
    white-space: normal;
}

.positions-formatted-editable {
    border: 1px solid var(--mud-palette-lines-inputs);
    cursor: text;
}

.positions-formatted-editable:hover {
    border-color: var(--mud-palette-text-primary);
}

.positions-formatted-editable:focus {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.positions-formatted-error {
    border-color: var(--mud-palette-error);
}

.positions-formatted ul {
    margin: 0;
    padding-left: 20px;
}

.positions-formatted strong {
    font-weight: 600;
}

/* A position of a group that shows only its total: its amount counts but is not printed. */
.positions-table .positions-price-hidden {
    color: var(--mud-palette-text-secondary);
    font-style: italic;
}

.positions-group-title input {
    font-weight: 600;
}

.positions-totals {
    margin-left: auto;
    max-width: 420px;
}

.positions-total-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    font-variant-numeric: tabular-nums;
}

.positions-grand-total {
    border-top: 2px solid var(--kbm-blau);
    font-weight: 600;
}

/* An offer's options (RUL-SAL-8): their sum below the total, which doesn't hold it. */
.positions-options-total {
    color: var(--mud-palette-text-secondary);
}

.positions-option {
    margin-top: 4px;
}

/* A position's text with its caption and Option chip below it, one column also in the mobile view. */
.positions-text-cell {
    flex: 1 1 auto;
    min-width: 0;
}

/* A position's account and business line (RUL-PLT-30) below its text, side by side while they fit. */
.positions-accounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.positions-accounts > * {
    flex: 1 1 180px;
    min-width: 0;
}

/* The same as one grey line (answer 128 A); a click opens the two pickers. */
.positions-accounts-line {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
    max-width: 100%;
    overflow-wrap: anywhere;
}

button.positions-accounts-line:hover span,
button.positions-accounts-line:focus-visible span {
    text-decoration: underline;
}

/* The notices under the bell (NoticesMenu, RUL-PLT-24): wrapped lines in a menu no wider than a phone, unread in bold. */
.notices-menu {
    width: min(380px, calc(100vw - 32px));
}

.notices-menu .notice .notice-text {
    white-space: normal;
}

.notices-menu .notice-unread .notice-text {
    font-weight: 600;
}

.notices-menu .notice-dot {
    width: 10px;
    flex: 0 0 10px;
    color: var(--mud-palette-primary);
    font-size: 10px;
    line-height: 20px;
}

/* The report board (SCR-SR-7): a column per step side by side, scrolling sideways inside the board on narrow screens;
   on a phone the columns stack. A card waiting long for release gets a yellow edge. */
.report-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(200px, 1fr));
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

@media (max-width: 599.98px) {
    .report-board {
        grid-template-columns: 1fr;
        overflow-x: visible;
    }
}

.report-board-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.report-board-column-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px solid var(--mud-palette-primary);
    padding-bottom: 4px;
}

.report-board-card {
    border: 1px solid var(--mud-palette-lines-default);
    padding: 8px 12px;
}

.report-board-card-long {
    border-left: 4px solid var(--kbm-alpengelb);
}

/* A cell with several lines (a number and its kind, several plants): one block, so on a phone, where the rows of a
   table stack, the lines stay under each other next to the label instead of widening the row. */
@media (max-width: 959.98px) {
    .mud-table-cell .cell-lines {
        text-align: right;
    }
}

/* The bar below the app bar that offers a new version of the app (UpdateNotice, RUL-PLT-17). */
.update-notice-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

/* The Excel menu of an overview table: an icon, the entry and how many columns and rows it holds. */
.overview-export-entry {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.overview-export-detail {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.overview-export-menu .mud-menu-item {
    min-width: 260px;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* A cell of several lines (cell-lines, MudText) runs on in a mobile view card's one meta line. */
.kbm-overview-card-meta .cell-lines > * + *::before {
    content: " · ";
}

/* Customize cards (CardsDialog, SCR-PLT-9): the rows, dragged by their handle, and the dialog's buttons. */
.columns-fixed-row,
.columns-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

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

.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. */
.columns-row .drag-handle {
    position: relative;
    z-index: 2;
    padding: 8px 4px;
    margin-inline-end: 12px;
    display: inline-flex;
    cursor: grab;
    touch-action: none;
    color: var(--mud-palette-text-secondary);
}

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

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

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

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

/* A chip with a long text (the ERP connection's state with the company name) wraps in the mobile view. */
.mud-chip.chip-wrap {
    height: auto;
    min-height: 24px;
    max-width: 100%;
}

.mud-chip.chip-wrap .mud-chip-content {
    white-space: normal;
    word-break: break-word;
    padding-block: 2px;
}

/* "+2" after a project's main plant in the project list. */
.project-more-plants {
    margin-left: 4px;
    white-space: nowrap;
}

/* A stocktake's lines (SCR-IN-9): the article on the left, its count field a fixed width on the right, also on a phone;
   the search keeps a readable width on desktop. */
.stocktake-line .stocktake-count {
    flex: 0 0 150px;
    max-width: 150px;
}

/* A scan list's quantity (take material, load vehicle, Kanban cards) stays on one line beside its article. */
.scan-list-line .scan-list-quantity {
    flex: 0 0 auto;
    white-space: nowrap;
}

.stocktake-line .cell-lines {
    flex: 1 1 160px;
    min-width: 0;
}

.stocktake-search {
    flex: 1 1 240px;
    max-width: 420px;
}

/* A caption with its "?" next to the article's stock figures keeps the line height of the captions without one. */
.stock-figure-caption {
    height: 1.25rem;
    overflow: visible;
}

/* The supplier bill (SCR-PUR-7): its PDF stays in view beside the lines on desktop while the page scrolls; a scan shows
   as a picture the width of the column. No border radius (brand). */
@media (min-width: 960px) {
    .bill-pdf {
        position: sticky;
        top: calc(var(--kbm-layout-sticky-top, 64px) + 8px);
    }
}

.bill-pdf-frame {
    display: block;
    width: 100%;
    height: 75vh;
    border: 1px solid var(--mud-palette-lines-default);
}

.bill-pdf-image {
    display: block;
    max-width: 100%;
    height: auto;
}

.bill-line .cell-lines {
    flex: 1 1 200px;
    min-width: 0;
}

/* The facts of the system status page (SCR-GL-1): a label column and its value, also in the mobile view. */
.status-facts th {
    text-align: left;
    font-weight: 500;
    width: 40%;
    vertical-align: top;
}

.status-facts td,
.status-table td.text-break,
.status-facts td.text-break {
    overflow-wrap: anywhere;
}

/* The value field of a measured check (RUL-SR-19), next to its result buttons. */
.sr-check-value {
    max-width: 9rem;
}

/* Sales plan (SCR-CRM-6): the month of today stands out; every row opens the list behind its actual; amounts never wrap. */
.plan-current-month {
    cursor: pointer;
    background: var(--mud-palette-action-default-hover);
}

.plan-current-month td {
    font-weight: 600;
}

.plan-table td {
    white-space: nowrap;
}

/* Sales week (SCR-CRM-10): a day's heading in the subtitle size, its entries as rows of icon, text and end (time,
   amount, done or late); a done follow-up or task is greyed. For and Another person keep a field's width. */
.sales-week-heading {
    font-size: 1.125rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.sales-week-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
}

.sales-week-row > .mud-icon-root {
    margin-top: 2px;
    flex: none;
}

.sales-week-row > .cell-lines {
    flex: 1 1 0;
    min-width: 0;
}

.sales-week-end {
    flex: none;
    white-space: nowrap;
    text-align: right;
}

.sales-week-end:empty {
    display: none;
}

.sales-week-done .cell-lines > :first-child {
    text-decoration: line-through;
    opacity: 0.7;
}

.sales-week-for {
    width: 16rem;
    max-width: 100%;
}

@media (max-width: 599.98px) {
    .sales-week-for {
        width: 100%;
    }

    .sales-week-row {
        flex-wrap: wrap;
    }

    .sales-week-end {
        width: 100%;
        padding-left: 32px;
        text-align: left;
    }
}

/* Sales overview (SCR-CRM-8): a chart is as high as its drawing and legend, with room to the line below it. */
.overview-chart {
    margin-bottom: 16px;
}

/* Retrofit Check, Positions tab of a check (267 A, 270 A): the plant structure as one tree like Master data's Structure
   tab. A module is a band on Papier with its code in a filled box, a component a row with its code in a framed box,
   positions below them; rows indent by their depth along guide lines (24 px, 12 px in the mobile view), fold with a
   chevron and are dragged by their handle (check-tree.js marks the row under the pointer with data-drop). Priorities
   show in their colour: 1 Fehlerrot, 2 Alpengelb, 3 Blau-70, none framed in grey. */
.check-tree-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 12px;
    margin-bottom: 12px;
}

.check-tree-filter {
    min-width: 150px;
}

.check-tree-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.check-tree-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    margin: 4px 0 8px;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.check-tree-warnings {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.check-tree-summary-end {
    display: inline-flex;
    margin-left: auto;
}

.check-tree {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.check-tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 48px;
    padding-right: 4px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.check-tree-module {
    min-height: 52px;
    background: var(--mud-palette-background-gray);
}

.check-tree-row[data-drop="before"] {
    box-shadow: inset 0 3px 0 var(--mud-palette-info);
}

.check-tree-row[data-drop="after"] {
    box-shadow: inset 0 -3px 0 var(--mud-palette-info);
}

.check-tree-row[data-drop="inside"] {
    box-shadow: inset 0 0 0 2px var(--mud-palette-info);
    background: var(--mud-palette-info-hover);
}

.check-tree-row.check-tree-dragged {
    opacity: 0.4;
}

.check-tree-handle,
.check-tree-handle-room {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    align-self: stretch;
    flex-shrink: 0;
}

.check-tree-handle {
    cursor: grab;
    color: var(--mud-palette-text-secondary);
    touch-action: none;
}

.check-tree-handle:hover {
    color: var(--mud-palette-primary);
}

.check-tree-level {
    flex: 0 0 24px;
    align-self: stretch;
    background: linear-gradient(var(--mud-palette-lines-default), var(--mud-palette-lines-default)) no-repeat 11px 0 / 1px 100%;
}

.check-tree-mobile .check-tree-level {
    flex-basis: 12px;
    background-position: 5px 0;
}

.check-tree-chevron .mud-icon-root {
    transition: transform 0.15s;
}

.check-tree-group .check-tree-chevron.check-tree-open .mud-icon-root,
.check-tree-position .check-tree-chevron.check-tree-unfolded .mud-icon-root {
    transform: rotate(90deg);
}

.check-tree-position .check-tree-chevron.check-tree-unfolded .mud-icon-root {
    transform: rotate(180deg);
}

.check-tree-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 16px;
    padding: 6px 0;
}

.check-tree-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
    min-width: 0;
}

.check-tree-code {
    padding: 0 6px;
    border: 1px solid var(--mud-palette-primary);
    font-family: var(--kbm-font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.check-tree-module .check-tree-code {
    padding: 0 7px;
    font-size: 1.125rem;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.check-tree-label {
    font-family: var(--kbm-font-heading);
    font-weight: 600;
}

.check-tree-module .check-tree-label {
    font-size: 1.25rem;
    font-weight: 700;
}

.check-tree-token,
.check-tree-count,
.check-tree-meta {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.check-tree-link {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0 8px 8px;
    color: inherit;
    text-decoration: none;
}

.check-tree-link:focus-visible {
    outline: 2px solid var(--kbm-accent);
    outline-offset: 2px;
}

.check-tree-line {
    display: flex;
    flex-wrap: wrap;
    column-gap: 12px;
}

.check-tree-position-code {
    min-width: 76px;
    font-family: var(--kbm-font-heading);
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.check-tree-position-title {
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* In the mobile view the code stands above the title on every row, so short and long titles look alike. */
.check-tree-mobile .check-tree-position-code {
    flex-basis: 100%;
}

.check-tree-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    flex-shrink: 0;
}

.check-tree-mobile .check-tree-chips {
    flex-shrink: 1;
}

.check-tree-prio,
.check-tree-done {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 8px;
    font-family: var(--kbm-font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.check-tree-prio-1 {
    background: var(--kbm-fehlerrot);
    color: var(--kbm-weiss);
}

.check-tree-prio-2 {
    background: var(--kbm-alpengelb);
    color: var(--kbm-schwarz);
}

.check-tree-prio-3 {
    background: var(--kbm-blau-70);
    color: var(--kbm-weiss);
}

.check-tree-prio-none {
    border: 1px solid var(--kbm-titan);
    color: var(--mud-palette-text-secondary);
}

.check-tree-done {
    border: 1px solid var(--mud-palette-success);
    color: var(--mud-palette-success);
}

.check-tree-photos {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 44px;
    font-size: 0.875rem;
}

.check-tree-hidden {
    visibility: hidden;
}

.check-tree-warning {
    display: inline-flex;
    justify-content: center;
    width: 24px;
    flex-shrink: 0;
}

.check-tree-price {
    flex: 0 0 110px;
    text-align: right;
    font-family: var(--kbm-font-heading);
    font-weight: 600;
}

.check-tree-detail-row {
    align-items: stretch;
}

.check-tree-detail {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 12px 8px;
    padding: 12px 16px;
    background: var(--mud-palette-background-gray);
}

.check-tree-mobile .check-tree-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    margin-left: 4px;
}

.check-tree-detail-label {
    margin-bottom: 4px;
    font-family: var(--kbm-font-heading);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.check-tree-detail-text {
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-line;
}

.check-tree-detail-end {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.check-tree-photo {
    width: 88px;
}

.check-tree-mobile .check-tree-photo {
    width: 72px;
}

.check-tree-spacer {
    flex: 1;
}

.check-tree-open-link {
    padding: 12px 0;
    font-family: var(--kbm-font-heading);
    font-weight: 600;
}

.check-tree-empty-text {
    padding: 10px 0 10px 40px;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.check-tree-mobile .check-tree-empty-text {
    padding-left: 32px;
}

/* The overview of a check (CHK-16) and other lists of the tree: a code in a box next to a name. */
.check-code-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
}

/* The Overview of a check (CHK-16): every position as a card, fully open: head with code, title, chips and the two
   buttons, the three texts side by side (stacked in the mobile view), then the calculation lines in fixed columns
   (kind, line, quantity, sales; in the mobile view the quantity goes below the line), group rows, the total and the
   warnings. */
.check-overview-position {
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

.check-overview-mobile .check-overview-position {
    padding: 10px 12px;
}

.check-overview-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.check-overview-name {
    display: flex;
    flex: 1 1 260px;
    flex-wrap: wrap;
    column-gap: 12px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.check-overview-name:hover .check-tree-position-title {
    text-decoration: underline;
}

.check-overview-mobile .check-overview-name .check-tree-position-code {
    flex-basis: 100%;
}

.check-overview-actions {
    display: flex;
    margin-left: auto;
}

.check-overview-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 4px;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.check-overview-texts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 24px;
    margin-top: 10px;
}

.check-overview-mobile .check-overview-texts {
    grid-template-columns: minmax(0, 1fr);
}

.check-overview-calc {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.check-overview-line {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 150px 140px;
    column-gap: 12px;
    align-items: start;
    padding: 5px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    font-size: 0.875rem;
}

.check-overview-mobile .check-overview-line {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    column-gap: 8px;
}

.check-overview-mobile .check-overview-quantity {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
}

.check-overview-mobile .check-overview-amount {
    grid-column: 3;
    grid-row: 1;
}

.check-overview-grouped .check-overview-text {
    padding-left: 16px;
}

.check-overview-group {
    font-weight: 600;
    background: var(--mud-palette-background-gray);
}

.check-overview-total {
    font-weight: 700;
    border-bottom: none;
}

.check-overview-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.check-overview-meta,
.check-overview-reserve {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
}

.check-overview-quantity {
    text-align: right;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

.check-overview-amount {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.check-overview-line-warning {
    margin-right: 4px;
    vertical-align: text-bottom;
    color: var(--mud-palette-warning);
}

.check-overview-empty {
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.check-overview-warning {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.875rem;
}

.check-overview-warning .mud-icon-root {
    color: var(--mud-palette-warning);
}

/* Back from a position (CHK-10): the position shown last is marked for a moment. */
.check-returned {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
    transition: outline-color 0.6s;
}

/* Retrofit Check, Calculation of a position (SCR-RC-3): one row per line in fixed columns (handle, kind, line, quantity,
   reserve, cost, sales, menu; without prices the two amounts go), group bands with their own background, the open line's
   fields in a panel below its row, a sheet over the page in the mobile view and the totals bar sticking to the bottom.
   calculation-editor.js drags rows and groups by their handles. */
.calc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.calc-toolbar-end {
    margin-left: auto;
}

.calc-editor {
    border: 1px solid var(--kbm-line);
}

.calc-grid {
    display: grid;
    grid-template-columns: 24px 24px minmax(0, 1fr) 88px 168px 112px 112px 40px;
    column-gap: 8px;
    align-items: center;
    padding: 0 4px;
}

.calc-no-prices .calc-grid {
    grid-template-columns: 24px 24px minmax(0, 1fr) 88px 168px 40px;
}

.calc-head {
    min-height: 36px;
    background: var(--kbm-brand-surface);
    color: var(--kbm-on-brand-surface);
    font-family: var(--kbm-font-heading);
    font-weight: 600;
    font-size: 0.8125rem;
}

.calc-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.calc-strong {
    font-weight: 600;
}

.calc-group + .calc-group,
.calc-section + .calc-groups .calc-group:first-child {
    border-top: 2px solid var(--kbm-brand-surface);
}

.calc-band {
    min-height: 52px;
    background: var(--kbm-line);
    color: var(--kbm-text);
}

.calc-band-none {
    min-height: 40px;
    background: var(--kbm-panel);
}

.calc-band-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    width: 100%;
    column-gap: 10px;
    min-width: 0;
    min-height: 44px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.calc-band-main:disabled {
    cursor: default;
}

.calc-band-name {
    font-family: var(--kbm-font-heading);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.calc-band-component,
.calc-band-count,
.calc-band-help,
.calc-each {
    font-size: 0.8125rem;
    color: var(--kbm-text-secondary);
}

.calc-band-count {
    font-family: var(--kbm-font-body);
    font-weight: 400;
}

.calc-band-quantity .mud-input-control {
    margin: 0;
}

.calc-band-help {
    line-height: 1.3;
}

.calc-each {
    display: block;
    font-weight: 400;
}

.calc-group-handle,
.calc-line-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    cursor: grab;
    color: var(--kbm-text-secondary);
}

.calc-group-handle:hover,
.calc-line-handle:hover {
    color: var(--kbm-accent);
}

.calc-lines {
    min-height: 8px;
}

.calc-item {
    border-top: 1px solid var(--kbm-line);
}

.calc-row {
    min-height: 52px;
}

.calc-row.calc-open {
    background: var(--kbm-panel);
    box-shadow: inset 3px 0 0 var(--kbm-accent);
}

.calc-row.calc-error {
    box-shadow: inset 3px 0 0 var(--mud-palette-error);
}

.calc-kind {
    display: inline-flex;
    color: var(--kbm-accent);
}

.calc-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 2px;
    min-width: 0;
    min-height: 44px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.calc-title {
    overflow-wrap: anywhere;
}

.calc-meta {
    font-size: 0.875rem;
    color: var(--kbm-text-secondary);
}

.calc-note {
    display: inline-flex;
    align-items: flex-start;
    gap: 4px;
    font-size: 0.875rem;
    font-style: italic;
    color: var(--kbm-text-secondary);
    overflow-wrap: anywhere;
}

.calc-note .mud-icon-root {
    flex-shrink: 0;
    margin-top: 1px;
}

.calc-warning {
    font-size: 0.875rem;
    color: var(--mud-palette-warning-darken);
}

.calc-reserve {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--kbm-text-secondary);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.calc-reserve-inherited {
    border-style: dashed;
}

.calc-panel {
    padding: 12px 16px 16px 60px;
    background: var(--kbm-panel);
    border-top: 1px solid var(--kbm-line);
}

.calc-group-add {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 2px 4px 6px 56px;
    border-top: 1px solid var(--kbm-line);
}

.calc-narrow {
    display: none;
}

.calc-ghost {
    opacity: 0.4;
}

.calc-totals {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 24px;
    margin-top: 12px;
    padding: 10px 12px;
    border-top: 2px solid var(--kbm-accent);
    background: var(--kbm-ground);
}

.calc-total {
    display: flex;
    flex-direction: column;
}

.calc-total-label {
    font-size: 0.8125rem;
    color: var(--kbm-text-secondary);
}

.calc-total-main {
    font-family: var(--kbm-font-heading);
    font-size: 1.25rem;
    color: var(--kbm-accent);
}

.calc-sheet {
    position: fixed;
    inset: 56px 0 0 0;
    z-index: 1150;
    display: flex;
    flex-direction: column;
    background: var(--kbm-ground);
}

.calc-sheet-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 6px 12px 6px 4px;
    border-bottom: 1px solid var(--kbm-line);
}

.calc-sheet-title {
    flex: 1;
    min-width: 0;
}

.calc-sheet-kind {
    font-family: var(--kbm-font-heading);
    font-weight: 600;
    font-size: 1.125rem;
}

.calc-sheet-group {
    font-size: 0.8125rem;
    color: var(--kbm-text-secondary);
}

.calc-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 24px;
}

@media (max-width: 599.98px) {
    .calc-grid {
        grid-template-columns: 24px minmax(0, 1fr) auto 40px;
        padding-left: 8px;
    }

    .calc-no-prices .calc-grid {
        grid-template-columns: 24px minmax(0, 1fr) 40px;
    }

    .calc-head,
    .calc-wide,
    .calc-group-handle,
    .calc-line-handle,
    .calc-band-help {
        display: none;
    }

    .calc-narrow {
        display: inline;
    }

    /* The band keeps its name wide: the quantity goes to a second row below the name. */
    .calc-prices .calc-band {
        grid-template-columns: 32px minmax(0, 1fr) auto 40px;
    }

    .calc-no-prices .calc-band {
        grid-template-columns: 32px minmax(0, 1fr) 40px;
    }

    .calc-band-quantity {
        grid-column: 2;
        grid-row: 2;
        max-width: 140px;
        padding-bottom: 6px;
    }

    .calc-band-quantity:empty {
        display: none;
    }

    .calc-panel {
        padding: 12px;
    }

    .calc-group-add {
        padding-left: 4px;
    }
}

/* Parts list tab (SCR-MD-5): build quantity and date stay narrow beside each other. */
.parts-list-toolbar .parts-list-quantity,
.parts-list-toolbar .parts-list-date {
    flex: 0 1 180px;
    min-width: 140px;
}

.parts-list-article {
    min-width: 0;
}

.parts-list-row + .parts-list-row {
    border-top: 1px solid var(--mud-palette-lines-default);
    padding-top: 12px;
}

/* A list of named choices of a settings page (ChoiceEntries: CRM channels, Resource planning block reasons): handle,
   name, then Active and the Move menu; where the row is too narrow (mobile view) these go under the name, so the name
   keeps the full width (F35). */
.choice-entry {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.choice-entry > .kbm-drag-handle {
    margin-top: 6px;
}

.choice-entry-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* Narrow rows (mobile view): Active and Move under the name, at its right edge. */
@media (max-width: 599.98px) {
    .choice-entry {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .choice-entry-actions {
        grid-column: 2;
        justify-self: end;
        margin-top: 0;
    }
}

/* Change order (OrderDialog, F21): one row per record, a record under another one indented below it. */
.order-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.order-row-child {
    padding-inline-start: 24px;
}

.order-row-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Marketing: a newsletter's content (SCR-MKT-2) and a template (SCR-MKT-8): the block editor beside the mail's preview
   from 1280 px, the preview below it in narrower windows and the mobile view. */
.mail-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

/* Beside each other only where the blocks keep about 400 px next to the 600 px mail; narrower, the preview follows. */
@media (min-width: 1440px) {
    .mail-editor {
        grid-template-columns: minmax(0, 1fr) 620px;
        align-items: start;
    }

    .mail-editor > .mail-preview {
        position: sticky;
        top: calc(var(--kbm-layout-sticky-top, 64px) + 8px);
    }
}

/* Marketing: the preferences page of a newsletter's link (SCR-MKT-12), a narrow column like a mail. */
.preferences-page {
    max-width: 640px;
}

/* Marketing: the sign-up page's fields one below the other, and its honeypot out of sight (RUL-MKT-23). */
.signup-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.signup-website {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.signup-consent,
.signup-snippet {
    white-space: pre-line;
}

.signup-snippet {
    font-family: var(--mud-typography-default-family), monospace;
    font-size: 0.8125rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.block-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.mail-preview-frame-box {
    background: var(--kbm-papier);
    border: 1px solid var(--mud-palette-lines-default);
    overflow-x: auto;
}

.mail-preview-frame {
    display: block;
    border: 0;
    margin: 0 auto;
    height: 70vh;
    min-height: 480px;
    background: var(--kbm-weiss);
}

.mail-preview-desktop {
    width: 100%;
    min-width: 600px;
}

.mail-preview-mobile {
    width: 360px;
    max-width: 100%;
}

/* Facts of a page (label in th, value in td) in the mobile view: the value under its label. */
@media (max-width: 599.98px) {
    .erp-facts tr,
    .erp-facts th,
    .erp-facts td {
        display: block;
        width: 100%;
    }

    .erp-facts.mud-simple-table table tbody tr th {
        padding-bottom: 0;
        border-bottom: none;
    }
}

/* The card board (CardBoard): one column in the mobile view, two from 960 px, three from 1280 px; a wide card takes
   two. Dense flow fills the hole a wide card would leave after two narrow ones. */
.card-board-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.card-board-item {
    min-width: 0;
}

@media (min-width: 960px) {
    .card-board-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row dense;
    }

    .card-board-wide {
        grid-column: span 2;
    }
}

@media (min-width: 1280px) {
    .card-board-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* SCR-MD-22 Person page, Partners: a card per contact, as many side by side as fit (one in the mobile view); inside a
   card two columns of values, wide ones (function, note, e-mail, address) across both. Ended contacts are greyed. */
.person-partners {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 16px;
}

.person-partner-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}

.person-partner-values .person-value-wide {
    grid-column: span 2;
}

.person-partner-ended {
    color: var(--mud-palette-text-secondary);
}

/* Camera scanning (ScanButton, ScanDialog, RUL-IN-14). A field with its camera button: the field takes the room, the
   button sits level with the input's box. */
.scan-field {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

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

.scan-field > .mud-tooltip-root,
.scan-field > .scan-button {
    margin-top: 4px;
}

/* The live picture: as wide as the dialog, 4:3, black around the picture whatever the theme; the frame marks the part
   that is read (barcode-scan.js reads the middle 80 % × 60 %). No rounded corners (brand). */
.scan-view {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: black;
    overflow: hidden;
}

.scan-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-frame {
    position: absolute;
    left: 10%;
    top: 20%;
    width: 80%;
    height: 60%;
    border: 2px solid var(--kbm-blau);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.scan-starting {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
}

/* In the mobile view the dialog fills the screen: the picture takes the height that is left. */
.mud-dialog-fullscreen .scan-view {
    aspect-ratio: auto;
    height: min(70vh, calc(100vw * 4 / 3));
}

/* The banner of a practice installation (RUL-GL-23, PracticeBanner): white on KBM blue below the app bar, square. */
.practice-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin-bottom: 16px;
    padding: 8px 16px;
    background: var(--kbm-blau);
    color: var(--kbm-weiss);
}

.practice-banner a {
    color: var(--kbm-weiss);
    text-decoration: underline;
}

/* Practise as a role: a card per person of the demo company, side by side as far as the width allows. */
.practice-roles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.practice-role {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.practice-role > :last-child {
    margin-top: auto;
}

/* MoreActions: an item's explanation below its text, wrapped to a readable width; on a phone the menu stays inside the screen. */
.more-action {
    display: flex;
    flex-direction: column;
    max-width: 320px;
    white-space: normal;
}

.more-action-tip {
    font-size: 0.8125rem;
    line-height: 1.3;
}

/* The partner's tab Sales (SCR-SAL-8): one row per offer or order confirmation, a line between them. */
.partner-sales-row {
    padding: 10px 16px;
}

.partner-sales-row + .partner-sales-row {
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* Marketing: the calendar of social posts (SCR-MKT-9), seven columns Monday to Sunday; each post a block coloured
   by its status. In the mobile view the days with posts are listed (.social-agenda). */
.social-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--mud-palette-lines-default);
    border-left: 1px solid var(--mud-palette-lines-default);
}

.social-calendar-weekday {
    padding: 4px 8px;
    font-family: var(--kbm-font-heading);
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
    border-right: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.social-calendar-day {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 112px;
    padding: 4px;
    border-right: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

.social-calendar--week .social-calendar-day {
    min-height: 320px;
}

.social-calendar-day--outside {
    background: var(--mud-palette-background-gray);
    color: var(--mud-palette-text-secondary);
}

.social-calendar-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    font-size: 0.875rem;
}

.social-calendar-day--today .social-calendar-day-head > span,
.social-today {
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.social-entry {
    display: flex;
    flex-direction: column;
    padding: 4px 6px;
    font-size: 0.8125rem;
    line-height: 1.3;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    border-left: 3px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-gray);
    overflow: hidden;
}

.social-entry:hover,
.social-entry:focus-visible {
    background: var(--mud-palette-action-default-hover);
}

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

.social-entry--waiting {
    border-left-color: var(--mud-palette-warning);
}

.social-entry--scheduled {
    border-left-color: var(--mud-palette-primary);
}

.social-entry--posted {
    border-left-color: var(--mud-palette-success);
}

.social-entry--failed {
    border-left-color: var(--mud-palette-error);
}

.social-entry-time {
    font-weight: 700;
}

.social-entry-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-entry-meta {
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-agenda {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.social-agenda-day {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.social-agenda .social-entry-title,
.social-agenda .social-entry-meta {
    white-space: normal;
}

/* A post's text as typed, line breaks kept; the preview a narrow column like a network's feed. */
.social-post-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.social-preview {
    max-width: 520px;
}

/* The dry run of a risky action (DryRunResult, RUL-PLT-45): one line per kind of record, separated. */
.oneapp-dry-run-line {
    padding: 6px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.oneapp-dry-run-line:last-child {
    border-bottom: none;
}

/* A picture of a text block with its points (SCR-CON-14, RUL-CON-30): one drawing of the file as it is with room around
   it for the labels, which stand outside the picture (in a column on the left and right, in a row on top and below) with
   a line to a dot on their point, as in the PDF; picture-points.js drags them when the picture is edited. */
.picture-points {
    position: relative;
    max-width: 100%;
    line-height: 0;
    user-select: none;
    -webkit-user-select: none;
}

.picture-points-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.picture-points-editable {
    cursor: crosshair;
    touch-action: none;
}

.picture-point-halo {
    stroke: var(--mud-palette-surface);
    stroke-width: 4.5px;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.picture-point-ink {
    stroke: var(--mud-palette-text-primary);
    stroke-width: 1.5px;
    vector-effect: non-scaling-stroke;
}

.picture-point-hit {
    fill: transparent;
}

.picture-point-ring {
    fill: var(--mud-palette-surface);
}

.picture-point-center {
    fill: var(--mud-palette-text-primary);
}

.picture-point-box {
    fill: transparent;
}

.picture-point-label text {
    fill: var(--mud-palette-text-primary);
    font-family: var(--mud-typography-h6-family, inherit);
    font-weight: 700;
}

.picture-points-editable .picture-point-dot,
.picture-points-editable .picture-point-label {
    cursor: grab;
}

.picture-point-selected .picture-point-box,
.picture-point-selected.picture-point-dot .picture-point-ring {
    fill: var(--kbm-alpengelb);
}

.picture-point-selected.picture-point-label text {
    fill: var(--kbm-schwarz);
}


/* The legend under a picture: label, name and what the point is linked to, one row each. */
.picture-legend-row {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.picture-legend-row:last-child {
    border-bottom: none;
}

.picture-legend-label {
    flex: 0 0 32px;
    font-weight: 700;
}

/* A text block's Markdown as the edition prints it (the server's HTML, no HTML of its own passes). */
.block-preview {
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.block-preview ul,
.block-preview ol {
    padding-left: 1.5em;
}

.block-preview table {
    border-collapse: collapse;
}

.block-preview th,
.block-preview td {
    border: 1px solid var(--mud-palette-lines-default);
    padding: 4px 8px;
}

/* An instruction template (SCR-CON-12): chapters, their sections indented, the blocks and automatic contents below them. */
.template-entry {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.template-entry-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.template-entry-level-2 .template-entry-text {
    padding-left: 16px;
}

.template-entry-content .template-entry-text {
    padding-left: 32px;
}

/* The person menu (RUL-PLT-48): the user's name heads the account entries; KbmSettingsMenu already draws the line above
   them, so the heading draws none of its own. */
.user-menu-name.kbm-settings-heading.mud-typography {
    margin-top: 0;
    border-top: none;
}

/* A button that reads as a link, for a row that opens a dialog (Team overview's Projects): keyboard and screen readers
   reach it, the row around it opens the same. */
.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    font: inherit;
    color: var(--mud-palette-primary);
    text-align: left;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
}

.link-button:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Parts tab of a plant (SCR-MD-4): the view switch, search and actions in one row that wraps on a phone. */
.plant-parts-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}

/* Spare parts list (RUL-MD-64): one button per package with its count, the chosen one framed in KBM blue. */
.spare-part-packages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.spare-part-package {
    display: grid;
    gap: 2px;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 0;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font: inherit;
    cursor: pointer;
}

.spare-part-package:disabled {
    cursor: default;
}

.spare-part-package.selected {
    border-color: var(--mud-palette-primary);
    box-shadow: inset 0 0 0 1px var(--mud-palette-primary);
}

.spare-part-package-name {
    font-family: var(--kbm-font-heading);
    font-weight: 600;
}

.spare-part-package.selected .spare-part-package-name {
    color: var(--mud-palette-primary);
}

.spare-part-package-detail {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.spare-part-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    align-items: center;
}

.spare-part-options .mud-radio-group {
    display: flex;
    flex-wrap: wrap;
}

/* The three views of the Parts tab share a phone's width instead of running off it. */
@media (max-width: 599.98px) {
    .plant-parts-views {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .plant-parts-views .mud-toggle-item {
        min-width: 0;
        height: auto;
        padding: 4px;
        font-size: 0.8125rem;
        line-height: 1.2;
    }

    .plant-parts-views .mud-toggle-item,
    .plant-parts-views .mud-toggle-item * {
        white-space: normal;
        text-align: center;
    }
}

/* A small subheading inside a long work area of the side menu (SCR-PLT-1, question 511): "Planung", "Wissen". */
.nav-section {
    color: var(--mud-palette-text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 12px 16px 4px 36px;
    text-transform: uppercase;
}

/* The side menu's first level (question 521 F): Portal, the work areas (questions 511-514) and Help as small dark
   capitals with their icon in KBM blue and a line above each, like headings; the pages of an area sit a little
   indented below. */
.mud-navmenu:not(.mud-navmenu .mud-navmenu) > .mud-nav-item,
.mud-navmenu .nav-area {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.mud-navmenu:not(.mud-navmenu .mud-navmenu) > .mud-nav-item > .mud-nav-link,
.mud-navmenu .nav-area > .mud-nav-link {
    padding-bottom: 6px;
    padding-top: 14px;
}

.mud-navmenu:not(.mud-navmenu .mud-navmenu) > .mud-nav-item > .mud-nav-link .mud-nav-link-text,
.mud-navmenu .nav-area > .mud-nav-link .mud-nav-link-text {
    color: var(--mud-palette-text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mud-navmenu:not(.mud-navmenu .mud-navmenu) > .mud-nav-item > .mud-nav-link .mud-nav-link-icon,
.mud-navmenu .nav-area > .mud-nav-link .mud-nav-link-icon {
    color: var(--mud-palette-primary);
    height: 20px;
    width: 20px;
}

.mud-navmenu .nav-area .mud-collapse-container .mud-nav-link {
    padding-left: 32px;
}

/* Liquidity plan (SCR-CP-6): the two SVG charts of the approved mock-up and the smaller figures of its tiles. */
.liquidity-charts {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.liquidity-plot {
    position: relative;
}

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

.liquidity-grid {
    stroke: var(--mud-palette-lines-default);
    stroke-width: 1;
}

.liquidity-zero {
    stroke: var(--mud-palette-text-secondary);
    stroke-width: 1;
}

.liquidity-axis {
    fill: var(--mud-palette-text-secondary);
    font-size: 11px;
}

.liquidity-area {
    fill: var(--mud-palette-primary);
    fill-opacity: 0.08;
}

.liquidity-line {
    fill: none;
    stroke: var(--mud-palette-primary);
    stroke-linejoin: round;
    stroke-width: 2.5;
}

.liquidity-minimum {
    stroke: var(--mud-palette-error);
    stroke-dasharray: 6 4;
    stroke-width: 1.5;
}

.liquidity-minimum-text {
    fill: var(--mud-palette-error);
    font-size: 11px;
    font-weight: 600;
}

.liquidity-low {
    fill: var(--mud-palette-error);
    stroke: var(--mud-palette-surface);
    stroke-width: 2;
}

.liquidity-lowest {
    fill: var(--mud-palette-text-primary);
    font-size: 12px;
    font-weight: 700;
}

.liquidity-cursor {
    stroke: var(--mud-palette-text-secondary);
    stroke-dasharray: 2 3;
    stroke-width: 1;
}

.liquidity-hit {
    cursor: pointer;
    fill: transparent;
}

.liquidity-in {
    fill: var(--kbm-stahlcyan);
}

.liquidity-out {
    fill: var(--mud-palette-primary);
}

.liquidity-stripe-ground {
    fill: var(--mud-palette-surface);
}

/* RUL-CP-10: planned money in and out, striped in the colour of its side, with an edge in that colour. */
.liquidity-planned-in {
    stroke: var(--kbm-stahlcyan);
    stroke-width: 1;
}

.liquidity-planned-out {
    stroke: var(--mud-palette-primary);
    stroke-width: 1;
}

.liquidity-legend {
    display: flex;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    gap: 16px;
    margin-bottom: 8px;
}

.liquidity-legend > span {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.liquidity-swatch {
    display: inline-block;
    height: 10px;
    width: 10px;
}

.liquidity-swatch-in {
    background-color: var(--kbm-stahlcyan);
}

.liquidity-swatch-out {
    background-color: var(--mud-palette-primary);
}

.liquidity-tip {
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 0.8125rem;
    min-width: 160px;
    padding: 8px 10px;
    pointer-events: none;
    position: absolute;
    top: 0;
    z-index: 2;
}

.kbm-kpi-value.liquidity-kpi {
    font-size: 1.5rem;
}

.liquidity-kpi-low .kbm-kpi-value.liquidity-kpi {
    color: var(--mud-palette-error);
}

.liquidity-kpi-low {
    border-top-color: var(--mud-palette-error);
}

.liquidity-wrap {
    white-space: normal;
}
