/* Roboto 400 from @fontsource/roboto 5.3.0 (OFL-1.1, see fonts/Roboto-LICENSE.txt), split like
   Google Fonts: the browser only fetches latin-ext when the page contains one of its characters.
   VaadinAppShellConfigurator preloads the latin file. */
@font-face {
    font-display: swap;
    font-family: robotoRegular;
    src: url('./fonts/roboto-latin-ext-400-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
        U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-display: swap;
    font-family: robotoRegular;
    src: url('./fonts/roboto-latin-400-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
        U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
    --secanda-dark-violet: #42184f;
    --secanda-violet: #651265;
    --secanda-bright-violet: #962a86;
    --secanda-background-positive: #ebebeb;
    --secanda-darkmode-violet: #ea38c4;

    --grey-text: #adadad;

    --lumo-font-family: robotoRegular;
    --lumo-primary-color: var(--secanda-dark-violet);
    --lumo-primary-color-60pct: hsla(309, 56%, 38%, 0.7);
    --lumo-primary-color-50pct: hsla(309, 56%, 38%, 0.5);
    --lumo-primary-color-20pct: hsla(309, 56%, 38%, 0.2);
    --lumo-primary-color-10pct: hsla(309, 56%, 38%, 0.1);
    --lumo-primary-color-5pct: hsla(309, 56%, 38%, 0.05);
    --lumo-primary-text-color: hsl(0, 0%, 39%);
    --lumo-header-text-color: var(--secanda-violet);
    --lumo-error-color: var(--secanda-bright-violet);

    --secanda-link-color: var(--secanda-violet);

    --fa-primary-color: var(--secanda-violet);

    /* Shared height of the navbar and the drawer logo header (both border-box):
       size-l toggle content + 1px bottom border */
    --secanda-header-height: calc(var(--lumo-size-l) + 1px);

    /* One size for the header icons (icon buttons and dropdown prefix icons);
       the drawer toggle glyph is deliberately larger, see .navbar-drawer-toggle.
       rem instead of --lumo-icon-size-m: that variable is em-based and custom
       properties resolve em at the use site, so it would yield different pixel
       sizes depending on the local font size (e.g. 27px inside the 18px
       dropdown label instead of 24px). */
    --secanda-header-icon-size: 1.5rem;

    /* Matches the visual gap between the header icon buttons: each one has 9px
       padding on both sides (confirmed via devtools), so two adjacent buttons end
       up 18px apart with no flex gap. --lumo-button-size isn't usable here - it's
       only populated by Vaadin's legacy Lumo injection inside a button's own
       shadow DOM, not on arbitrary light-DOM elements like this header wrapper. */
    --secanda-header-item-gap: 18px;

    background: var(--lumo-base-color) linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
}

vaadin-grid.schema-list-grid::part(even-row) {
    --vaadin-grid-cell-background: var(--lumo-contrast-5pct);
}

/* A value the next credential would fail at, see NextCredentialDialog */
vaadin-grid::part(next-credential-problem-row) {
    --vaadin-grid-cell-background: var(--lumo-error-color-10pct);
}

/* A value the person import would change, see PersonImportDialog; the weight keeps it apart without color */
vaadin-grid::part(person-import-changed-cell) {
    --vaadin-grid-cell-background: var(--lumo-primary-color-10pct);
    font-weight: 600;
}

/* A column the person import leaves out, muted so the assigned ones stand out */
vaadin-select.person-import-ignored-column vaadin-select-value-button > vaadin-select-item {
    color: var(--lumo-secondary-text-color);
}

/* The person import's first step: one large area to drop the file on, the button inside it */
vaadin-upload.person-import-upload {
    padding: var(--lumo-space-l);
    border: 2px dashed var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-l);
    background: var(--lumo-contrast-5pct);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

vaadin-upload.person-import-upload[dragover] {
    border-color: var(--lumo-primary-color);
    background: var(--lumo-primary-color-10pct);
}

/* Icon and text above the button, all centred, instead of the button with a label beside it */
vaadin-upload.person-import-upload::part(primary-buttons) {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: var(--lumo-space-m);
}

vaadin-upload.person-import-upload::part(drop-label) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--lumo-space-s);
    padding: 0;
    text-align: center;
}

.person-import-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--lumo-base-color);
    box-shadow: var(--lumo-box-shadow-xs);
}

.person-import-upload-icon .fontawesome {
    width: 26px;
    height: 26px;
    color: var(--lumo-primary-color);
}

.person-import-upload-label {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-xs);
}

.person-import-upload-title {
    font-size: var(--lumo-font-size-l);
    font-weight: 600;
    color: var(--lumo-header-text-color);
}

/* The two kinds of file side by side, one under the other where the dialog is narrow */
.person-import-formats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: var(--lumo-space-m);
    width: 100%;
}

.person-import-format {
    display: flex;
    align-items: flex-start;
    gap: var(--lumo-space-m);
    padding: var(--lumo-space-m);
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-l);
}

.person-import-format-icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--lumo-border-radius-m);
    background: var(--lumo-primary-color-10pct);
}

.person-import-format-icon .fontawesome {
    width: 20px;
    height: 20px;
    color: var(--lumo-primary-text-color);
}

.person-import-format-texts {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-xs);
    min-width: 0;
}

/* In body color, so the drop area stays the one accent of the step */
.person-import-format-title {
    font-weight: 600;
    color: var(--lumo-body-text-color);
}

.person-import-format-example {
    margin: var(--lumo-space-xs) 0 0;
    padding: var(--lumo-space-s) var(--lumo-space-m);
    border-radius: var(--lumo-border-radius-m);
    background: var(--lumo-contrast-5pct);
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-xs);
    line-height: 1.5;
}

/* The fields to export in up to two columns, filled top to bottom so that neighbouring fields stay together */
vaadin-checkbox-group.person-export-columns::part(group-field) {
    display: block;
    columns: 2 14rem;
    column-gap: var(--lumo-space-m);
}

vaadin-checkbox-group.person-export-columns > vaadin-checkbox {
    /* One per line, as the columns are a block, in which the checkboxes would otherwise flow side by side */
    display: flex;
    break-inside: avoid;
}

/* A menu bar item has no gap of its own between icon and label, unlike a vaadin-button */
.person-add-menu .person-add-icon {
    margin-inline-end: var(--lumo-space-s);
}

/* The margin of a vaadin-button instead of Lumo's halved one, so the combo button lines up with the search field */
.person-add-menu vaadin-menu-bar-button {
    margin-block: var(--lumo-space-xs);
}

.person-add-menu vaadin-menu-bar-button[first-visible] {
    margin-inline-start: 0;
}

/* Without the padding of "a vaadin-icon", which would squeeze the glyph to half its width; the gap spaces it */
.person-import-download .fontawesome {
    flex: none;
    width: var(--lumo-font-size-m);
    height: var(--lumo-font-size-m);
    padding-right: 0;
}

vaadin-master-detail-layout::part(detail) {
    background: var(--lumo-base-color);
}

vaadin-master-detail-layout::part(backdrop) {
    background: transparent;
}

vaadin-button[theme~="error"][theme~="primary"] {
    color: white;
    background-color: hsl(3, 79%, 49%); /* from Color.css */
}

vaadin-button.border-error {
    border-color: hsl(3, 79%, 49%); /* from Color.css */
}

body:not([theme~="dark"]) vaadin-button,
body:not([theme~="dark"]) a.selfservice-button-link {
    --lumo-primary-text-color: var(--secanda-violet);
}

[theme="dark"], :host([theme="dark"])  {
    --lumo-font-family: robotoRegular;
    --lumo-base-color: #000;
    --lumo-primary-color: var(--secanda-bright-violet);
    --lumo-primary-color-60pct: hsla(309, 56%, 38%, 0.7);
    --lumo-primary-color-50pct: hsla(309, 56%, 38%, 0.5);
    --lumo-primary-color-20pct: hsla(309, 56%, 38%, 0.2);
    --lumo-primary-color-10pct: hsla(309, 56%, 38%, 0.1);
    /*--lumo-header-text-color: var(--secanda-bright-violet);*/
    /*--lumo-error-color: var(--secanda-darkmode-violet);*/
    --lumo-primary-text-color: var(--secanda-darkmode-violet);
    /*--lumo-button-text-color: var(--secanda-darkmode-violet);*/
    /*--lumo-disabled-text-color: var(--grey-text);*/

    --secanda-link-color: var(--secanda-darkmode-violet);

    --fa-primary-color: var(--secanda-bright-violet);
}

vaadin-grid::part(header-cell) {
    font-weight: 600;
}

.dashboard-layout {
    flex: 1 1 auto;
}

.menu-bar {
    border-bottom: 1px solid lightgray;
    padding: var(--lumo-space-xs) var(--lumo-space-s);
    flex: 0 0 auto;
}

.menu-bar-testserver {
    background-color: var(--lumo-primary-color-10pct)
}

/* All header containers center their children vertically; without this, flex children
   without a fixed height (e.g. the navbar dropdowns) would stretch to the row height. */
.navbar-content-layout,
.navbar-right-cluster,
.navbar-right-text-items,
.header-icons,
.drawer-logo-header {
    align-items: center;
}

.navbar-right-text-items {
    gap: var(--secanda-header-item-gap);
}

/* Half the item gap here: unlike the device-combi/additional-links boundary above (where
   neither side contributes any padding of its own), the first icon button already brings
   its own 9px left padding, so only another 9px is needed to reach the same 18px total. */
.navbar-right-cluster {
    gap: calc(var(--secanda-header-item-gap) / 2);
}

/* Matches the device combination selector's label size (.navbar-dropdown) so all
   text in the header's right-hand cluster reads at the same size. */
.navbar-right-text-items vaadin-menu-bar-item {
    font-size: calc(var(--secanda-header-icon-size) * 0.75);
    cursor: pointer;
    /* Zeroing only padding here would leave Lumo's tertiary-menu-bar negative margin
       (-lumo-button-size / 6, see vaadin-lumo-styles/components/menu-bar-button.css)
       uncompensated, clipping the content; cancel both together instead. A small right
       padding is kept so the label doesn't look flush-cut against the item's edge. */
    margin: 0;
    padding: 0 var(--lumo-space-xs) 0 0;
}

/* The wrapping vaadin-menu-bar-button has its own separate Lumo margin/padding
   (independent from the vaadin-menu-bar-item rule above); zeroed the same way so the
   header's uniform gap is the only spacing between the additional-links items. */
.navbar-right-text-items vaadin-menu-bar-button {
    margin: 0;
    padding: 0;
}

.navbar-content-layout {
    padding-right: var(--lumo-space-m);
    flex-grow: 1;
    min-width: 0;
    /* Fills the navbar part's fixed height exactly, so a background color (e.g. the
       testserver tint) covers the full navbar instead of just the content's own height. */
    height: 100%;
    box-sizing: border-box;
}

/* No left padding: the drawer toggle is always the first navbar element and sits
   flush at the edge; the gap to the following content comes from the layout spacing. */

.navbar-selector-slot,
.navbar-selector-slot > * {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-m);
}

/* Section title in the navbar (NavbarTitle), same label as the parent drawer item;
   compact instead of the Lumo H1 defaults. Coupled to the shared header icon size
   like the navbar dropdown labels, so the whole header row scales together. */
.navbar-page-title {
    font-size: calc(var(--secanda-header-icon-size) * 0.75);
    /* Line box capped at the shared icon size so the text never exceeds the icon height */
    line-height: var(--secanda-header-icon-size);
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

/* Refresh button + data view selector belong together; the visual gap between them
   comes from the paddings of the dropdown and the icon button, see below. */
.navbar-view-group {
    display: flex;
    align-items: center;
}

.navbar-view-group .navbar-dropdown {
    padding-right: calc(var(--secanda-header-item-gap) / 2);
}

/* Muted refresh icon; hovering restores the regular FontAwesome color */
.navbar-view-group .header-icon-button .fontawesome {
    color: var(--lumo-secondary-text-color);
    opacity: 0.5;
    transition: opacity 0.1s, color 0.1s;
}

.navbar-view-group .header-icon-button:hover .fontawesome {
    color: var(--fa-primary-color);
    opacity: 1;
}

.navbar-dropdown {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-xs);
    cursor: pointer;
    /* Coupled to the shared header icon size (0.75 x 24px = 18px, the same size as
       the navbar section title) so label and icons scale together */
    font-size: calc(var(--secanda-header-icon-size) * 0.75);
    /* Line box capped at the shared icon size: keeps the label height at 24px and makes
       icons without an explicit size (1lh fallback, e.g. the chevron) match it as well */
    line-height: var(--secanda-header-icon-size);
    white-space: nowrap;
    /* Same height as the Lumo tertiary icon buttons in the navbar, so all header popovers
       (anchored to the target's bottom edge) open at the same vertical position. */
    height: var(--lumo-size-m);
    box-sizing: border-box;
}

.navbar-dropdown .fontawesome {
    width: var(--lumo-font-size-xs);
    color: var(--lumo-secondary-text-color);
}

/* Prefix icons (e.g. the printer in the device combination selector) keep the shared
   header icon size instead of the small chevron width from the rule above, and use the
   same color as the neighboring tertiary header icon buttons. */
.navbar-dropdown .navbar-dropdown-prefix-icon {
    /* --vaadin-icon-size feeds the host sizing inside the shadow DOM (fallback is 1lh,
       which would scale with the 18px dropdown font instead of the shared icon size) */
    --vaadin-icon-size: var(--secanda-header-icon-size);
    width: var(--secanda-header-icon-size);
    height: var(--secanda-header-icon-size);
    color: var(--fa-primary-color);
}

/* All header icon buttons (refresh, testserver, info, workflows, language, user) use
   the shared header icon size as a square box, so differing glyph aspect ratios do not
   result in visually different icon sizes. */
.header-icon-button .fontawesome {
    --vaadin-icon-size: var(--secanda-header-icon-size);
    width: var(--secanda-header-icon-size);
    height: var(--secanda-header-icon-size);
}
.navbar-dropdown-items {
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow-y: auto;
}

.navbar-dropdown-header {
    padding: var(--lumo-space-xs) var(--lumo-space-s);
    background-color: var(--lumo-contrast-5pct);
    margin-top: var(--lumo-space-xs);
}

.navbar-dropdown-header:first-child {
    margin-top: 0;
}

.navbar-dropdown-header + .header-popover-item {
    margin-top: var(--lumo-space-xs);
}

/* Keeps the search field usable when all entries are short; dropdowns without search
   (device combination) stay as narrow as their longest entry. */
.navbar-dropdown-search {
    min-width: 200px;
    margin-bottom: var(--lumo-space-xs);
}

/* Highlights matches of the current search term within an item's label. */
.navbar-dropdown-search-match {
    background-color: var(--lumo-primary-color-20pct);
    border-radius: var(--lumo-border-radius-s);
}

/* Header popovers are start-/end-aligned (never repositioned at the viewport edge); place the
   fixed arrow inset on the center of the target's icon: --lumo-size-m / 4 horizontal padding
   + half a header icon. Set on vaadin-popover (light DOM): the overlay lives in
   its shadow root, but custom properties inherit into it. */
vaadin-popover[theme~='header-popover'] {
    --vaadin-popover-arrow-inset: calc(var(--lumo-size-m) / 4 + var(--secanda-header-icon-size) / 2);
    /* Open right at the target: the default arrow offset leaves a gap between the arrow tip
       and the target. The rotated square arrow protrudes half its diagonal (~0.71 x size)
       above the panel, so this offset makes the tip touch the target's bottom edge. */
    --vaadin-popover-offset-top: calc(var(--vaadin-popover-arrow-size, 0.75rem) * 0.71);
}

/* Uniform content padding for all header popovers (icon buttons and navbar dropdowns);
   the Lumo default is only --lumo-space-xs vertically. The overlay lives in the
   popover's shadow root; its content part is reachable via exportparts. */
vaadin-popover[theme~='header-popover']::part(content) {
    /* 12px: Lumo has no token between space-s (8px) and space-m (16px). */
    padding: calc(var(--lumo-space-m) - var(--lumo-space-xs));
}

.header-popover-item {
    display: flex;
    align-items: center;
    gap: var(--vaadin-gap-s);
    padding: var(--lumo-space-xs) var(--lumo-space-s);
    cursor: pointer;
    border-radius: var(--lumo-border-radius-m);
    white-space: nowrap;
}

.header-popover-item:hover,
.header-popover-item:focus {
    background-color: var(--lumo-contrast-10pct);
}

.header-popover-item:focus {
    outline: none;
}

/* Same marking as the current page in the drawer's SideNav. The doubled class outranks the
   hover rules, including the transparent hover of a static (non-clickable) active entry. */
.header-popover-item.header-popover-item-active,
.header-popover-item.header-popover-item-active:hover,
.header-popover-item.header-popover-item-active:focus {
    font-weight: 600;
    color: var(--lumo-primary-text-color);
    background-color: var(--lumo-primary-color-10pct);
}

.header-popover-item-static {
    cursor: default;
}

/* Traffic light of a monitored DeviceAnywhere in the device combination selector */
.device-health-dot {
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--lumo-contrast-30pct);
}

.device-health-dot-green {
    background-color: limegreen;
}

/* Not --lumo-error-color: it is the brand violet here, which does not read as red in a traffic light. */
.device-health-dot-red {
    background-color: hsl(3, 85%, 48%);
}

.header-popover-user-info {
    display: flex;
    flex-direction: column;
    padding: var(--lumo-space-xs) var(--lumo-space-s);
    white-space: nowrap;
}

.header-popover-user-info-caption {
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-xs);
}

.header-popover-user-info-name {
    font-weight: 600;
}

.header-popover-item-static:hover {
    background-color: transparent;
}

.header-messages-list {
    display: flex;
    flex-direction: column;
    max-width: 400px;
}

.header-message-warning .fontawesome {
    color: var(--lumo-error-text-color);
}

/* Warning state of the status button: red background with an uncolored (white) icon.
   Lumo tertiary buttons force their background with !important, so it can only be
   changed through the --vaadin-button-tertiary-background hook. */
.header-status-warning {
    --vaadin-button-tertiary-background: hsla(3, 79%, 49%, 0.8); /* from Color.css */
}

.header-status-warning .fontawesome {
    color: white;
}

.header-messages-footer {
    display: block;
    color: var(--lumo-tertiary-text-color);
    font-size: var(--lumo-font-size-xs);
    cursor: pointer;
    margin-top: var(--lumo-space-s);
    padding: var(--lumo-space-xs) var(--lumo-space-s) 0 var(--lumo-space-s);
    border-top: 1px solid var(--lumo-contrast-10pct);
}

/* Fixed instead of Vaadin's auto width: an auto drawer resizes whenever the font, a logo or
   a long view name arrives, and each resize slides the whole page content sideways (CORE-2123). */
vaadin-app-layout {
    --vaadin-app-layout-drawer-width: 16rem;
}

vaadin-app-layout::part(drawer) {
    background: var(--lumo-base-color) linear-gradient(var(--lumo-shade-10pct), var(--lumo-shade-10pct));
    top: 0;
    bottom: 0;
    height: 100%;
    /* Transparent track lets the drawer background show through; ::-webkit-scrollbar
       pseudos cannot reach this shadow DOM scroller, scrollbar-color can. The thumb
       matches the native Chrome scrollbar gray. */
    scrollbar-color: #c1c1c1 transparent;
}

body[theme~='dark'] vaadin-app-layout::part(drawer) {
    scrollbar-color: var(--lumo-contrast-30pct) transparent;
}

vaadin-app-layout::part(navbar) {
    background: var(--lumo-base-color) linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
    border-bottom: 1px solid #D1D5DB;
    /* Fixed shared height with the drawer logo header; min-height overrides the Lumo
       default of --lumo-size-xl, which would win over the height otherwise */
    min-height: 0;
    height: var(--secanda-header-height);
    box-sizing: border-box;
}

.navbar-drawer-toggle::part(icon)::before {
    font-size: var(--lumo-size-s);
    cursor: pointer;
}

.drawer-logo-header {
    /* Fixed shared height with the navbar so both bottom borders sit on one line;
       flex-shrink 0 stops the drawer column from squeezing the header when the nav
       content overflows (e.g. at high browser zoom). */
    height: var(--secanda-header-height);
    flex-shrink: 0;
    padding: 0 var(--lumo-space-m);
    border-bottom: 1px solid #D1D5DB;
    width: 100%;
    box-sizing: border-box;
}

/* Fill the drawer below the logo header */
.drawer-nav-content {
    flex: 1;
}

/* SECANDA logo at the bottom of the drawer; flex-shrink 0 keeps it from being
   squeezed when the nav content overflows. The bottom spacing is padding, not margin:
   Chrome excludes a last child's bottom margin from the scrollable overflow, so a
   margin would collapse once the drawer scrolls. */
.drawer-footer-logo {
    height: var(--lumo-size-l);
    /* viewBox of secandaLogo.svg, reserves the width before the image has loaded */
    aspect-ratio: 427.09 / 81.96;
    align-self: center;
    flex-shrink: 0;
    margin: 0 var(--lumo-space-m);
    padding-bottom: var(--lumo-space-m);
}

/* Page content padding (replaces old .main-window > *:last-child) */
.main-layout > :not([slot]) {
    padding: var(--lumo-space-m);
    box-sizing: border-box;
    overflow-y: auto;
    flex: 1 1 auto;
}

.main-layout > .full-iframe:not([slot]) {
    padding: 0;
}


.nav-parent::part(link),
.nav-child::part(link) {
    transition: background-color 0.1s;
}

.nav-parent::part(link):hover,
.nav-child::part(link):hover {
    background-color: var(--lumo-contrast-10pct);
}

.nav-parent::part(link) {
    cursor: pointer;
    font-weight: 600;
}

.nav-child::part(link) {
    font-size: var(--lumo-font-size-m);
    color: var(--lumo-secondary-text-color);
}

vaadin-button {
    cursor: pointer;
}

vaadin-menu-bar-button {
    cursor: pointer;
}

vaadin-button[disabled] .fontawesome {
    color: var(--lumo-disabled-text-color);
}

/* :where() keeps the default at zero specificity, so color classes like LumoUtility.TextColor win */
:where(.fontawesome) {
    color: var(--fa-primary-color);
}

vaadin-menu-bar-item vaadin-icon,
vaadin-button .fontawesome,
vaadin-context-menu-item .fontawesome {
    height: var(--lumo-icon-size-s);
}

vaadin-tab vaadin-icon {
    height: var(--lumo-size-s);
    width: var(--lumo-size-s);
}

vaadin-dialog-overlay vaadin-tab vaadin-icon {
    height: var(--lumo-icon-size-s);
    width: var(--lumo-icon-size-s);
}

vaadin-context-menu-item[disabled] .fontawesome {
    color: var(--lumo-disabled-text-color);
}

/* Only applies the icon-text gap when the icon has a label sibling; icon-only
   menu bar buttons (e.g. kebab menu, close button) would otherwise be pushed
   off-center by this margin. */
vaadin-menu-bar-item vaadin-icon:not(:only-child) {
    margin-right: var(--lumo-space-xs);
}

vaadin-checkbox vaadin-icon {
    width: calc(var(--lumo-icon-size-s) - 0.25em);
    height: calc(var(--lumo-icon-size-s) - 0.25em);
    margin-right: var(--lumo-space-xs);
}

.sub-tabsheet vaadin-tab vaadin-icon {
    width: var(--lumo-icon-size-m);
    height: var(--lumo-icon-size-m);
    margin-right: var(--lumo-space-xs);
}

vaadin-radio-button vaadin-icon {
    width: var(--lumo-icon-size-l);
    padding-right: var(--lumo-space-s);
}

vaadin-combo-box-item .fontawesome {
    width: var(--lumo-icon-size-l);
    height: var(--lumo-icon-size-l);
    padding-right: var(--lumo-space-s);
}

vaadin-combo-box-item img {
    padding-right: var(--lumo-space-s);
}

a vaadin-icon {
    padding-right: var(--lumo-space-s);
}

.fileexchange-tabsheet vaadin-icon {
    padding-right: var(--lumo-space-s);
}

/* Same size and gap as the icons of RouteTabs, which get theirs from "a vaadin-icon" */
.schema-settings-tabs vaadin-icon {
    padding-right: var(--lumo-space-s);
}

[theme*="primary"], :host([theme*="primary"]) {
    --fa-primary-color: white;
}

/* Icons follow the red label like VaadinIcons did via currentColor; primary keeps its white icon */
vaadin-button[theme~="error"]:not([theme~="primary"]) {
    --fa-primary-color: var(--lumo-error-text-color);
}

.fontawesome.rotate {
    animation-name: fa-rotate;
    animation-duration: 5s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    transform-origin: 50% 50%;
    display: inline-flex;
}

@keyframes fa-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.login-oidc-divider {
    margin-top: var(--lumo-space-l);
    margin-bottom: var(--lumo-space-m);
    border-top: 1px solid lightgray;
}

/* Scales with the shared header height instead of a fixed pixel size */
.menu-logo {
    height: var(--secanda-header-icon-size);
    /* viewBox of secureCoreMenuLogo.svg, reserves the width before the image has loaded */
    aspect-ratio: 3803.4094 / 1018.1101;
}

.checkWarning {
    color: var(--lumo-warning-color);
}

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

.warning-text, .checkFailed {
    color: var(--lumo-error-text-color);
}

.ok-text {
    color: var(--lumo-primary-color);
}

.card-layout {
    background-color: var(--lumo-base-color);
    box-shadow: var(--lumo-box-shadow-s);
}

/* Label/value pairs of a standard-schema detail sidebar (see SchemaSidebarRows), laid out as a
   two-column grid so the block stays centered while the label/value columns line up. */
.schema-details-grid {
    display: grid;
    grid-template-columns: max-content max-content;
    column-gap: var(--lumo-space-s);
    row-gap: var(--lumo-space-xs);
    justify-content: center;
}

.schema-details-grid .schema-details-label {
    text-align: end;
}

/* The list filters (TokenFilterBar): the pinned pills, then a field holding the other pills and the
   search text. The pinned pills are as tall as a Lumo text field, so the bar reads as one row of controls. */
.token-filter {
    /* The space a Lumo field keeps above and below its box, so the button beside it lines up */
    margin-block: var(--lumo-space-xs);
    /* The space between the field's edge and a pill inside it: a small pill's own height, centered in a field */
    --token-gap: calc((var(--lumo-size-m) - var(--lumo-size-s)) / 2);
    --token-size: calc(var(--lumo-size-m) - 2 * var(--token-gap));
}

/* A pill's buttons take the pill's height, so the segments fill it */
.token-filter .filter-pill {
    min-height: var(--pill-size, var(--token-size));
    --lumo-button-size: var(--pill-size, var(--token-size));
    --vaadin-button-height: var(--pill-size, var(--token-size));
}

/* The pinned pills stand closer together than the field is to them, so they read as one group */
.token-filter > .filter-pill:has(+ .token-field) {
    margin-inline-end: 0.25rem;
}

/* The edge sets a pinned pill off from the field beside it, which has the same grey */
.token-filter > .filter-pill {
    --pill-size: var(--lumo-size-m);
    box-sizing: border-box;
    border: 1px solid var(--lumo-contrast-10pct);
}

/* Looks like a Lumo text field, while the text field inside it drops its own box so the two do not nest visibly */
.token-field {
    flex: 1 1 16em;
    min-width: 0;
    min-height: var(--lumo-size-m);
    box-sizing: border-box;
    /* Everything inside is one height; this makes up the rest of a field's height, so a single line is
       exactly as tall as a field and wrapped lines keep the same space above, between and below */
    padding: var(--token-gap);
    row-gap: var(--token-gap);
    column-gap: var(--lumo-space-xs);
    cursor: text;
}

/* The chevron has some room of its own, so it needs less padding than the name to stand as far from the edge */
.token-filter .filter-pill-name {
    padding-inline: 0.625rem;
}

/* The cross and the chevron stand as far from the edge as the name does on the other side */
.token-filter .filter-pill-value {
    padding-inline-end: 0.375rem;
}

/* The segment border is not visible while empty, so the chevron's own room would read as a wide gap after the name */
.token-filter .filter-pill-empty > vaadin-button {
    margin-inline-start: -0.25rem;
}

/* The segments of a pill (FilterPill) open its popover on a click anywhere on them */
.token-filter .filter-pill-segment {
    cursor: pointer;
}

/* A row still waiting for its data is empty, and the virtualizer pads an empty row to 200px, which
   overflows the list for a moment. Holding the row height (FilterChip.ROW_HEIGHT) keeps it from doing so. */
vaadin-virtual-list.filter-checklist > * {
    min-height: var(--lumo-size-m);
}

/* Like a Lumo field, the ring shows for keyboard focus only; a click just puts the caret in the text */
.token-field:has(> vaadin-text-field.token-input[focus-ring]) {
    box-shadow: 0 0 0 var(--vaadin-focus-ring-width) var(--vaadin-focus-ring-color);
}

.token-field > vaadin-text-field.token-input {
    flex: 1 1 12em;
    min-width: 12em;
    padding: 0;
    /* The height of the pills beside it, see .token-field */
    --vaadin-input-field-height: var(--token-size);
    --lumo-text-field-size: var(--token-size);
}

.token-field > vaadin-button {
    --lumo-button-size: var(--token-size);
    --vaadin-button-height: var(--token-size);
}

/* Keeps the filter icon as far from the field's edge as the name of a pill is from its own */
.token-field > vaadin-button.token-add {
    margin-inline-start: 0.375rem;
}

.token-field > vaadin-button.token-clear {
    margin-inline-end: 0.25rem;
}

.token-field > vaadin-text-field.token-input::part(input-field) {
    background: transparent;
    box-shadow: none;
}

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

iframe {
    /*box-shadow: var(--lumo-box-shadow-s);*/
    /*border: 1px solid var(--secanda-violet);*/
    border: 0;
}

/** Loading indicator / Connection indicator **/

.v-status-message {
    display: none;
}

/*
 * The connection indicator injects a "functional" stylesheet into <head> at runtime, even though
 * setApplyDefaultTheme(false) turns its theme off: that sheet makes .v-loading-indicator and
 * .v-status-message transparent and click-through, and turns the popover host into
 * display: contents. Being injected after this file, it wins every specificity tie, so the rules
 * for both indicators need one selector step more than the plain class or attribute (CORE-2037).
 *
 * The indicator also starts with applyDefaultTheme = true and injects its default theme on top of
 * that: a 4px progress bar at the top of the window, widened from 50% to 96% via .first, .second
 * and .third. setApplyDefaultTheme(false) only reaches the client with the first UIDL response,
 * so on a slow first load after a server restart that bar shows up next to our own spinner, which
 * is then positioned against the 4px bar instead of the viewport. Overriding width, height and
 * background-color neutralises it; the three state classes are listed explicitly because their
 * selectors outweigh the plain class.
 */
body .v-loading-indicator,
body .v-loading-indicator.first,
body .v-loading-indicator.second,
body .v-loading-indicator.third {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    background-color: transparent;
    opacity: 1;
    pointer-events: auto;
    z-index: 2147483640;
    animation: loading-fade 0.5s ease-out 0s normal 1 both;
}

/*
 * While idle the bar carries an inline display: none, which the default theme overrides with
 * display: block !important. Without this rule the neutralised bar would cover the whole window
 * as an invisible, click-swallowing overlay until the default theme is dropped.
 */
body .v-loading-indicator[style*='none'] {
    display: none !important;
}

/* A ring with a fading tail, drawn in CSS so it needs no request and follows the theme colour */
.v-loading-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3rem;
    height: 3rem;
    margin: -1.5rem 0 0 -1.5rem;
    z-index: 1;
    border-radius: 50%;
    background: conic-gradient(transparent 10%, var(--fa-primary-color)), var(--lumo-contrast-10pct);
    mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    /* The fade-in delay keeps the ring away from round trips that end before it would be noticed */
    animation: loading-ring-in 0.3s ease-out 0.2s both, loading-ring-spin 0.8s linear infinite;
}

/* Disc behind the ring, so it stands out from whatever content lies underneath */
.v-loading-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4.5rem;
    height: 4.5rem;
    margin: -2.25rem 0 0 -2.25rem;
    box-sizing: border-box;
    /* Invisible normally, but forced-colors mode draws it where the shadow is dropped */
    border: 1px solid transparent;
    border-radius: 50%;
    background-color: var(--lumo-base-color);
    box-shadow: var(--lumo-box-shadow-m);
    animation: loading-ring-in 0.3s ease-out 0.2s both;
}

/* Whatever was loading when the connection dropped, the reconnect card replaces the ring */
body vaadin-connection-indicator[offline] .v-loading-indicator,
body vaadin-connection-indicator[reconnecting] .v-loading-indicator {
    display: none !important;
}

/*
 * Vaadin shows the reconnect state at once and has no grace period for it, so the curtain and the
 * card fade in only after 1.5s: a short WebSocket hiccup then passes without a flash. The overlay
 * still blocks clicks from the start, the server would not take them anyway.
 */
vaadin-connection-indicator[offline]:popover-open,
vaadin-connection-indicator[reconnecting]:popover-open {
    /* :popover-open rather than [popover]: a closed popover has to keep the user agent's
       display: none, or the overlay would cover the app while the connection is fine. */
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: auto;
    z-index: 2147483640;
    background: transparent;
    animation: connection-curtain-in 0.4s ease-out 1.5s both;
}

vaadin-connection-indicator[offline] .v-status-message,
vaadin-connection-indicator[reconnecting] .v-status-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--lumo-space-m);
    opacity: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    width: max-content;
    min-width: 18rem;
    max-width: calc(100vw - 2 * var(--lumo-space-m));
    padding: var(--lumo-space-l) var(--lumo-space-xl);
    /* Invisible normally, but forced-colors mode draws it where the shadow is dropped */
    border: 1px solid transparent;
    border-radius: var(--lumo-border-radius-l);
    background-color: var(--lumo-base-color);
    box-shadow: var(--lumo-box-shadow-l);
    color: var(--lumo-body-text-color);
    text-align: center;
    animation: connection-card-in 0.4s ease-out 1.5s both;
}

/* Inlined rather than referenced: the server that would deliver the file is the one that is gone.
   Font Awesome Pro "wifi-slash", regular style. */
vaadin-connection-indicator .v-status-message::before {
    content: '';
    width: 3rem;
    height: 3rem;
    background-color: var(--fa-primary-color);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath d='M73 39.1C63.6 29.7 48.4 29.7 39.1 39.1C29.8 48.5 29.7 63.7 39.1 73.1L567.1 601.1C576.5 610.5 591.7 610.5 601 601.1C610.3 591.7 610.4 576.5 601 567.2L358 324.2C396 332.6 429.5 353.2 453.9 381.9C462.5 392 477.7 393.2 487.7 384.6C497.7 376 499 360.8 490.4 350.8C449.4 302.8 388.2 272.2 320 272.2C315.4 272.2 310.8 272.3 306.3 272.6L199.2 165.3C236.9 151.5 277.6 144 320.1 144C416.5 144 503.7 182.7 567.3 245.4C576.7 254.7 591.9 254.6 601.2 245.2C610.5 235.8 610.4 220.6 601 211.3C528.8 140 429.5 96 320.1 96C264 96 210.7 107.5 162.3 128.3L73 39.1zM111 212.8L76.7 178.5C63.5 188.6 50.9 199.6 39.1 211.3C29.7 220.6 29.6 235.8 38.9 245.2C48.2 254.6 63.4 254.7 72.8 245.4C84.7 233.6 97.5 222.7 111 212.8zM238.3 340.1L203.1 304.9C183 317.3 164.9 332.7 149.6 350.6C141 360.7 142.2 375.8 152.3 384.4C162.4 393 177.5 391.8 186.1 381.7C200.6 364.7 218.3 350.5 238.2 340zM368.1 496C368.1 469.5 346.6 448 320.1 448C293.6 448 272.1 469.5 272.1 496C272.1 522.5 293.6 544 320.1 544C346.6 544 368.1 522.5 368.1 496z'/%3E%3C/svg%3E") center / contain no-repeat;
}

vaadin-connection-indicator[offline] .v-status-message::before {
    background-color: var(--lumo-error-text-color);
}

/* Indeterminate bar while Vaadin keeps retrying, gone once it gives up */
vaadin-connection-indicator[reconnecting] .v-status-message::after {
    content: '';
    align-self: stretch;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--fa-primary-color), transparent) no-repeat,
        var(--lumo-contrast-10pct);
    background-size: 40% 100%, auto;
    animation: connection-progress 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .v-loading-indicator::before {
        animation-duration: 0.3s, 2.4s;
    }

    vaadin-connection-indicator[reconnecting] .v-status-message::after {
        animation-duration: 4s;
    }
}

@media (forced-colors: active) {
    .v-loading-indicator::before,
    vaadin-connection-indicator .v-status-message::before,
    vaadin-connection-indicator .v-status-message::after {
        forced-color-adjust: none;
        --fa-primary-color: CanvasText;
        --lumo-error-text-color: CanvasText;
    }
}

@keyframes loading-fade {
    0% {
        background: rgba(0, 0, 0, 0);
    }
    100% {
        background: rgba(0, 0, 0, .1); /* Darkens the UI */
    }
}

@keyframes loading-ring-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes connection-curtain-in {
    from {
        background-color: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0);
    }
    to {
        background-color: rgba(0, 0, 0, .25);
        backdrop-filter: blur(4px);
    }
}

@keyframes connection-card-in {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 8px));
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes connection-progress {
    from {
        background-position: -70% 0, 0 0;
    }
    to {
        background-position: 170% 0, 0 0;
    }
}

.entity-list-container {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
}

.entity-list-empty {
    color: var(--lumo-secondary-text-color);
}

.entity-list-entry {
    background-color: white;
    padding: var(--lumo-space-s) var(--lumo-space-m) var(--lumo-space-s) var(--lumo-space-s);
    box-shadow: var(--lumo-box-shadow-xs);
}

.entity-info-layout, .entity-button-layout {
    padding-top: var(--lumo-space-xs);
    font-size: var(--lumo-font-size-s);
}

.entity-list-entry .entity-icon {
    width: var(--lumo-size-xl);
    height: var(--lumo-size-xl);
    flex-shrink: 0;
}

.entity-header-label-with-suffix {
    display: inline-flex;
    align-items: center;
}

.encoding-schema-meta-entry {
    padding: var(--lumo-space-xs) 0;
    font-size: var(--lumo-font-size-s);
}

.entity-list-uuid {
    font-size: var(--lumo-font-size-xs);
    color: var(--lumo-tertiary-text-color);
    cursor: pointer;
}

.cardPreview, .largePanelPreview {
    border: 1px solid black;
}

vaadin-dialog-overlay[theme~="large-panel-config"]::part(content) {
    overflow-x: hidden;
}

.cardPreview {
    width: 224px;
    height: 141px;
}

.dashboardCardPreviewSlot {
    border: 1px solid black;
    min-width: 315px;
    width: fit-content;
}

.dashboardCardPreview {
    background: white;
    display: block;
}

.portraitPreviewSlot {
    border: 1px solid black;
    width: fit-content;
}

.portraitPreview {
    height: 202px;
    display: block;
}

.preview-loading {
    background: linear-gradient(90deg, var(--lumo-contrast-5pct) 25%, var(--lumo-contrast-10pct) 50%, var(--lumo-contrast-5pct) 75%);
    background-size: 200% 100%;
    animation: preview-shimmer 1.2s infinite;
}

.preview-loading img {
    display: none;
}

@keyframes preview-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.card-layout .v-drag-over-target {
    border: 1px solid var(--secanda-bright-violet);
    box-shadow: var(--lumo-box-shadow-m);
}

.dashboard-loading {
    color: var(--lumo-tertiary-text-color);
}

.dashboard-template-selector {
    padding-top: var(--lumo-space-s);
    font-size: var(--lumo-font-size-xs);
}

.dashboard-toolbar {
    gap: var(--lumo-space-xs);
    padding-bottom: var(--lumo-space-s);
}

.dashboard-toolbar div {
    display: flex;
    flex-wrap: wrap;
}

.dashboard-footer {
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
}

.workflow-identifier-label {
    text-align: right;
    width: 250px;
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
}

.workflow-editor, .scriptImAndExportArea {
    font-size: var(--lumo-font-size-xs);
    font-family: monospace;
}

.ci-styles-area {
    font-family: monospace;
}

.disabledWorkflow {
    color: var(--lumo-error-text-color);
}

.dashboardButton {
    display: flex;
    justify-content: start;
    align-items: center;
    flex-direction: column;
    border: 2px solid transparent;
    font-size: var(--lumo-font-size-xxs);
    text-align: center;
    cursor: pointer;
    align-self: stretch;
    width: 65px;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    overflow-wrap: anywhere;
    margin-right: 2px;
}

.dashboardButton:hover:not([disabled]) {
    border: 2px dotted var(--secanda-violet);
}

.dashboardButton vaadin-icon, .dashboardButton img {
    width: var(--lumo-size-s);
    height: var(--lumo-size-s);
}

.dashboardButton[disabled] vaadin-icon, .dashboardButton[disabled] img {
    color: var(--lumo-disabled-text-color);
    filter: opacity(50%) grayscale(100%);
}

.dashboardButton[disabled] {
    cursor: not-allowed;
    color: var(--lumo-disabled-text-color);
}

/* Foto-Pflicht-Prüfung läuft: kleiner Spinner in der Ecke des (deaktivierten) Buttons */
.dashboardButton-checking {
    position: relative;
}

.dashboardButton-checking::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--lumo-contrast-20pct);
    border-top-color: var(--secanda-violet);
    border-radius: 50%;
    animation: dashboard-button-checking-spin 0.8s linear infinite;
}

@keyframes dashboard-button-checking-spin {
    to {
        transform: rotate(360deg);
    }
}

.v-drag-over-target {
    border-left: 2px solid var(--secanda-bright-violet);
}

.workflow-status {
    font-size: var(--lumo-font-size-s);
    margin-top: var(--lumo-space-s);
    margin-bottom: var(--lumo-space-s);
}

.workflow-status .text-status {
    font-weight: bold;
}

.workflow-log {
    font-size: var(--lumo-font-size-s);
}

.workflow-log .successfulWorkflowAction, .rs900StatusOkay {
    color: var(--lumo-success-text-color);
}

.workflow-log .failedWorkflowAction, .invalidCommKey, .rs900StatusWarning, .fileExchangeDisabled {
    color: var(--lumo-error-text-color);
}

.download-anchor-invisible {
    display: inline-block;
    width: 0;
    height: 0;
}

.cardTemplate {
    background-color: var(--lumo-contrast-10pct);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}


.cardTemplate:hover {
    background-color: var(--lumo-contrast-20pct);
}

.cardTemplate img {
    border: 1px solid black;

}

.file-exchange .size {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-tertiary-text-color);
}

vaadin-upload.upload-wrapper {
    border: 0;
    padding: 0;
    border-radius: 0;
}

vaadin-upload.upload-wrapper::part(primary-buttons), .upload-wrapper vaadin-upload-file-list,
.ce-import-upload vaadin-upload-file-list {
    display: none;
}

vaadin-upload[dragover="true"].upload-wrapper {
    box-shadow: var(--lumo-box-shadow-s);
}

.template-upload-wrapper {
    height: 143px;
}

.template-panel-editor .gripper {
    width: var(--lumo-icon-size-m);
    height: var(--lumo-icon-size-m);
    flex: 0 0 auto;
    align-self: center;
    border-radius: var(--lumo-border-radius-m);
    cursor: grab;
}

.template-panel-editor .gripper:hover {
    background-color: var(--lumo-contrast-10pct);
}

.template-panel-editor.v-drag-over-target {
    outline: 2px solid var(--secanda-bright-violet);
    outline-offset: -2px;
    box-shadow: var(--lumo-box-shadow-m);
    border-radius: var(--lumo-border-radius-m);
}

.template-panels .new-panel {
    padding-left: calc(var(--lumo-icon-size-l) + var(--lumo-space-xs));
}

.icon-large {
    width: var(--lumo-icon-size-l);
    height: var(--lumo-icon-size-l);
}

.validLicence, .validCommKey, .checkSuccessful {
    color: var(--lumo-success-text-color);
}

.active-workflow-header vaadin-icon {
    height: var(--lumo-icon-size-l);
    width: var(--lumo-icon-size-l);
    padding-right: var(--lumo-space-s);
}

.active-workflow-info-row vaadin-icon {
    height: var(--lumo-icon-size-m);
    width: var(--lumo-icon-size-m);
    padding-right: var(--lumo-space-s);
}

.workflow-history-list span {
    font-size: var(--lumo-font-size-s);
}

.extended-combobox-popup {
    --vaadin-combo-box-overlay-width: 350px;
    --vaadin-multi-select-combo-box-overlay-width: 350px;
}

/* PersonDetailPanel's real photo, unlike the Avatar it falls back to, has no frame of its own and
   otherwise sits directly on the panel's white background as a hard-edged rectangle. Framed here in
   a subtly raised card instead of just floating on the page - contrast-10pct rather than 5pct, and a
   hairline border on the photo itself, because a photo with an almost-white background of its own
   otherwise blends into too light a mat with no visible edge between the two. */
.person-photo-card {
    background: var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-l);
    box-shadow: var(--lumo-box-shadow-s);
    padding: var(--lumo-space-s);
}

.person-photo {
    display: block;
    object-fit: contain;
    border: 1px solid var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-m);
}

/* Clips the action bar to the photo's outline: the card's corners, or the circle of a round photo. */
.person-photo-frame {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    border-radius: var(--lumo-border-radius-l);
}

.person-photo-frame--round {
    border-radius: 50%;
}

.person-photo-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--lumo-space-s) + var(--lumo-space-s));
    display: flex;
    justify-content: center;
    gap: var(--lumo-space-s);
    opacity: 0;
    transition: opacity 0.15s;
}

/* A circle's chord is short near its lower edge, so the buttons sit higher to stay inside the outline */
.person-photo-frame--round .person-photo-actions {
    bottom: var(--lumo-space-l);
}

/* The global violet button color is set on the button itself, so this needs the higher specificity */
.person-photo-frame .person-photo-actions vaadin-button[theme] {
    --lumo-primary-text-color: #fff;
    --fa-primary-color: #fff;
    width: 2.75rem;
    min-width: 0;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    /* Lumo forces a tertiary button's background with !important, so only this hook changes it */
    --vaadin-button-tertiary-background: rgba(0, 0, 0, 0.65);
    /* The ring reads on dark photos, the shadow on light ones. No backdrop-filter: the bar fades in through
       opacity, which makes it a backdrop root, so the blur would only switch on once the fade has ended. */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.person-photo-frame .person-photo-actions vaadin-button[theme]:hover {
    --vaadin-button-tertiary-background: var(--secanda-violet);
}

.person-photo-frame .person-photo-actions vaadin-button.person-photo-delete[theme]:hover {
    --vaadin-button-tertiary-background: var(--lumo-error-color);
}

.person-photo-actions .fontawesome {
    height: var(--lumo-icon-size-m);
}

/* Without a photo the camera is the way in, so it must not hide until hovered */
.person-photo-frame--empty .person-photo-actions {
    opacity: 1;
}

/* focus-within keeps the bar reachable by keyboard */
.person-photo-frame:hover .person-photo-actions,
.person-photo-frame:focus-within .person-photo-actions {
    opacity: 1;
}

/* No hover on touch screens, so the bar stays visible there */
@media (hover: none) {
    .person-photo-actions {
        opacity: 1;
    }
}

/* The e-mail type picker's (PersonEmailsSection) closed box always shows the plain item-label text,
   never the icon+label renderer used for the opened list - Select has no built-in way to show
   anything else there (https://github.com/vaadin/vaadin-select/issues/208). Hidden here so the
   manually maintained icon in the field's own prefix slot can stand in for it instead; scoped through
   vaadin-select-value-button so the same text in the opened list is left alone. */
.email-type-select vaadin-select-value-button vaadin-select-item::part(content) {
    display: none;
}

/* View-Selector: Gruppierte Ansichten */
.view-selector-header {
    font-weight: 600;
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
    letter-spacing: 0.05em;
}

vaadin-combo-box-item:has(.view-selector-header),
vaadin-multi-select-combo-box-item:has(.view-selector-header) {
    pointer-events: none;
    cursor: default;
    background-color: var(--lumo-contrast-5pct);
    margin-top: var(--lumo-space-xs);
    overflow: hidden;
}

vaadin-combo-box-item:first-child:has(.view-selector-header),
vaadin-multi-select-combo-box-item:first-child:has(.view-selector-header) {
    margin-top: 0;
}

/* Abstand nach Header-Item zum folgenden Eintrag */
vaadin-combo-box-item:has(.view-selector-header) + vaadin-combo-box-item,
vaadin-multi-select-combo-box-item:has(.view-selector-header) + vaadin-multi-select-combo-box-item {
    margin-top: var(--lumo-space-xs);
}

.workflow-tabsheet {
    width: 100%;
    height: calc(100% - 50px);
    overflow: hidden;
}

.workflow-tabsheet::part(content) {
    overflow: hidden;
    padding: 0;
}

.engine-workflow-select {
    height: calc(100% - 40px);
}

.engine-workflow-select-fulldialog {
    height: 100%;
}

.engine-workflow-select > * {
    padding-top: var(--lumo-space-s);
}

.engine-workflow-layout {
    padding-top: 0;
    padding-right: var(--lumo-space-m);
}

.engine-workflow-listbox vaadin-item::part(checkmark)::before, .engine-workflow-options vaadin-item::part(checkmark)::before {
    display: none;
}

.engine-workflow-listbox vaadin-item, .engine-workflow-options vaadin-item {
    border: 1px solid transparent;
    padding-left: var(--lumo-space-s);
}

.engine-workflow-listbox vaadin-item[selected], .engine-workflow-options vaadin-item[selected] {
    background-color: var(--lumo-primary-color-10pct);
    border: 1px dashed var(--lumo-primary-color-50pct);
}

.engine-workflow-listbox vaadin-item[selected] vaadin-icon, .engine-workflow-options vaadin-item[selected] vaadin-icon {
    color: var(--secanda-bright-violet);
}

.engine-workflow-options vaadin-item vaadin-icon {
    padding-right: var(--lumo-space-s);
}

.engine-workflow-options {
    padding-top: var(--lumo-space-xs);
}

.engine-workflow-options div {
    padding-top: var(--lumo-space-m);
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-xs);
}

.engine-workflow-options div ul {
    margin-top: 0;
}

.engine-workflow-options vaadin-button {
    margin-bottom: var(--lumo-space-m);
}

.engine-workflow-listbox .engine-entry[disabled], .engine-workflow-options > span:first-child {
    color: var(--secanda-bright-violet);
    font-weight: bold;
}

.engine-workflow-options > span:first-child {
    padding-bottom: var(--lumo-space-s);
}

.engine-workflow-listbox .workflow-entry vaadin-icon {
    color: var(--lumo-tertiary-text-color);
}

.workflow-entry-details {
    color: var(--lumo-tertiary-text-color);
    font-size: var(--lumo-font-size-xs);
}

.engine-workflow-options .triggernodeselect-label {
    font-size: var(--lumo-font-size-xs);
    color: var(--lumo-secondary-text-color);
}

vaadin-dialog-overlay.workflow-dialog::part(content) {
    padding-bottom: var(--lumo-space-s);
    overflow: hidden;
}

.tableExpandRow {
    color: var(--lumo-contrast-50pct);
}

.dashboard-preview-area vaadin-horizontal-layout {
    padding-top: var(--lumo-space-s);
}

.dashboard-preview-area-templates {
    flex-basis: 212px;
}

.dashboard-preview-area vaadin-combo-box, .dashboard-toolbar vaadin-combo-box {
    padding: 0;
}

.dashboard-toolbar vaadin-combo-box > [slot="helper"], .centered-helper vaadin-combo-box::part(helper-text) {
    display: block;
    width: 100%;
    text-align: center;
}

.key-grid::part(row) {
    line-height: var(--lumo-size-m)
}

.encode-scheme-upload-label {
    padding-top: var(--lumo-space-s);
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
}

.role-form-oidc-group-id {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-tertiary-text-color);
}

.combobox-item-identifier {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-tertiary-text-color);
}

.vertical-button {
    height: 54px;
}

.vertical-button .fontawesome {
    padding-top: var(--lumo-space-s);
    height: 36px;
    width: 36px;
}

.vertical-button span {
    font-size: var(--lumo-font-size-xs);
    padding-bottom: var(--lumo-space-s);
}

.capture-dialog-footer, .image-editor-footer {
    gap: var(--lumo-space-xs);
}

@media (max-width: 700px) {
    .capture-dialog-footer vaadin-button:first-child {
        flex: 0 0 100%;
    }

    .image-editor-footer vaadin-button:last-child {
        flex: 0 0 100%;
    }
}

.image-editor-options-panel {
    padding: var(--lumo-space-s) 0 0;
}

.sub-tabsheet [role=tabpanel] {
    padding-top: var(--lumo-space-s);
}

.login-layout {
    height: 100vh;
}

.login-layout > * {
    flex: 1 1 0;
    width: 0;
}

.login-layout .left-pane {
    background-image: url('./images/loginImagePane.webp');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 50% 50%;
}

.login-layout .right-pane {
    justify-content: center;
    align-items: center;
    overflow: auto;
    height: 100%;
}

.login-layout .right-pane > * {
    gap: var(--lumo-space-s);
    margin-top: auto;
    margin-bottom: auto;
}

.login-layout .core-logo {
    width: 100%;
    margin-bottom: var(--lumo-space-xl);
}

.login-layout .right-pane span {
    color: var(--lumo-secondary-text-color);
}

.login-layout .right-pane vaadin-text-field vaadin-icon,
.login-layout .right-pane vaadin-password-field vaadin-icon {
    width: var(--lumo-icon-size-s);
}

.setup-layout {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--lumo-space-l);
    background-color: #2b1029;
}

/* The photo carries a logo meant for the login's left pane, blurred it stays a backdrop instead of a cut-off motif */
.setup-layout::before {
    content: "";
    position: absolute;
    /* Twice the blur radius, so that the soft edge stays outside the viewport */
    inset: -80px;
    z-index: -1;
    background-image: linear-gradient(135deg, rgba(43, 16, 41, 0.75), rgba(15, 15, 25, 0.55)), url('./images/loginImagePane.webp');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    /* Desaturated, the yellow spots of the photo no longer stand out as blotches */
    filter: blur(40px) saturate(0.6);
}

.setup-card {
    box-sizing: border-box;
    padding: var(--lumo-space-xl);
    /* Invisible normally, but forced-colors mode draws it where the shadow is dropped */
    border: 1px solid transparent;
}

.setup-eyebrow {
    letter-spacing: 0.08em;
}

.setup-card h1 {
    text-wrap: balance;
}

.setup-card vaadin-text-field vaadin-icon,
.setup-card vaadin-password-field vaadin-icon {
    width: var(--lumo-icon-size-s);
}

@media (max-width: 500px) {
    .setup-layout {
        padding: var(--lumo-space-m);
    }

    .setup-card {
        padding: var(--lumo-space-l);
    }
}

@media not (prefers-contrast: more) {
    vaadin-text-field vaadin-icon,
    vaadin-password-field vaadin-icon {
        color: var(--lumo-secondary-text-color);
    }
}

.selfservice-login-title {
    margin-top: var(--lumo-space-s);
    margin-bottom: var(--lumo-space-xl);
    text-transform: uppercase;
}

.selfservice-mainview-title {
    margin-top: var(--lumo-space-s);
    margin-bottom: var(--lumo-space-l);
    text-transform: uppercase;
}

.selfservice-login-layout .left-pane {
    background-image: url('/selfservice/images/background');
    justify-content: center;
    align-items: center;
    display: flex;
}

.selfservice-secanda-logo {
    position: absolute;
    bottom: 0;
    left: 0;
    margin-bottom: var(--lumo-space-xl);
    margin-left: calc(var(--lumo-space-xl) + 30px);
    width: 15%;
}

.selfservice-securecore-logo {
    width: 80%;
    padding-left: var(--lumo-space-s);
    padding-right: var(--lumo-space-s);
    margin-top: var(--lumo-space-s);
    backdrop-filter: blur(20px) brightness(80%);
    border-radius: 30px;
}

.selfservice-footer {
    margin-top: var(--lumo-space-l);
    font-size: var(--lumo-font-size-s);
    text-align: center;
    width: 100%;
}

.selfServiceCardPreviewPanel {
    border: 1px solid black;
    background: white;
    display: block;
}

/* An app bar rather than a letterhead: the logo shares one row with language and logout */
.standard-selfservice-topbar .customerlogo {
    max-height: 40px;
    width: auto;
    margin: 0;
}

/* The standard self-service speaks about one card: its state is the page's message */
.standard-selfservice-status {
    --standard-selfservice-status-color: var(--lumo-contrast-60pct);
    --standard-selfservice-status-background: var(--lumo-contrast-5pct);
    --standard-selfservice-status-heading-color: var(--lumo-header-text-color);
    background: var(--standard-selfservice-status-background);
    border-radius: var(--lumo-border-radius-l);
    padding: var(--lumo-space-xl) var(--lumo-space-l);
    text-align: center;
    transition: background-color 0.3s ease;
}

.standard-selfservice-status h2 {
    color: var(--standard-selfservice-status-heading-color);
}

/* The status card as an empty state: the card page lays it out through its VerticalLayout, this one stands alone */
.standard-selfservice-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--lumo-space-xs);
    width: 100%;
    box-sizing: border-box;
}

.standard-selfservice-status-active {
    --standard-selfservice-status-color: var(--lumo-success-color);
    --standard-selfservice-status-background: var(--lumo-success-color-10pct);
}

/* Granted but not yet valid: the color of a held permission on a neutral tile, unlike a request still waiting */
.standard-selfservice-status-upcoming {
    --standard-selfservice-status-color: var(--lumo-success-color);
}

.standard-selfservice-status-blocked,
.standard-selfservice-status-blocking {
    /* Not --lumo-error-color: the theme turns that into the brand violet */
    --standard-selfservice-status-color: var(--lumo-error-text-color);
    --standard-selfservice-status-background: var(--lumo-error-color-10pct);
    --standard-selfservice-status-heading-color: var(--lumo-error-text-color);
}

.standard-selfservice-status-expired {
    --standard-selfservice-status-color: var(--lumo-warning-color);
    --standard-selfservice-status-background: var(--lumo-warning-color-10pct);
    --standard-selfservice-status-heading-color: var(--lumo-warning-text-color);
}

/* Produced and waiting for its holder: a step for them to take, not a problem */
.standard-selfservice-status-awaiting-activation {
    --standard-selfservice-status-color: var(--lumo-primary-text-color);
    --standard-selfservice-status-background: var(--lumo-primary-color-10pct);
}

.standard-selfservice-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin-bottom: var(--lumo-space-m);
    border-radius: 50%;
    background: var(--lumo-base-color);
    color: var(--standard-selfservice-status-color);
    box-shadow: var(--lumo-box-shadow-s);
    animation: standard-selfservice-status-icon-in 0.35s ease-out;
}

/* More specific than .fontawesome, which would otherwise paint every state in the brand color */
.standard-selfservice-status-icon .fontawesome {
    width: 44px;
    height: 44px;
    color: var(--standard-selfservice-status-color);
}

@keyframes standard-selfservice-status-icon-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .standard-selfservice-status,
    .standard-selfservice-status-icon {
        animation: none;
        transition: none;
    }
}

.standard-selfservice-block-reasons {
    margin-top: var(--lumo-space-m);
}

/*
 * A scrollbar showing up, e.g. when the field for "other" appears, would shift the centered page sideways.
 * Every page reserves the space on both edges, so the center stays put also when moving between pages.
 */
.selfservice-mainview > vaadin-vertical-layout:has(.standard-selfservice-topbar) {
    scrollbar-gutter: stable both-edges;
}

.standard-selfservice-block-reason {
    height: auto;
    min-width: 180px;
    padding: var(--lumo-space-m);
    border: 2px solid transparent;
    border-radius: var(--lumo-border-radius-l);
    background: var(--lumo-base-color);
    color: var(--lumo-body-text-color);
    box-shadow: var(--lumo-box-shadow-xs);
}

.standard-selfservice-block-reason-selected {
    border-color: var(--lumo-error-text-color);
    background: var(--lumo-error-color-10pct);
}

.standard-selfservice-block-reason-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--lumo-space-s);
    white-space: normal;
}

.standard-selfservice-block-reason-content .fontawesome {
    width: 28px;
    height: 28px;
    color: var(--lumo-error-text-color);
}

/* The photo of a card order, framed like a selection; the capture buttons wrap onto a line of their own */
.standard-selfservice-photo-selection {
    flex-wrap: wrap;
    padding: var(--lumo-space-m);
}

.standard-selfservice-photo-slot {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 80px;
    overflow: hidden;
    border-radius: var(--lumo-border-radius-m);
    background: var(--lumo-contrast-5pct);
}

.standard-selfservice-photo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Outweighs the small icon of .standard-selfservice-selection, which comes later in this file */
.standard-selfservice-photo-selection .standard-selfservice-photo-slot .fontawesome {
    width: 28px;
    height: 28px;
}

/* Small like the "change" link of an access request; the inline action's own font would make it bigger */
.standard-selfservice-photo-selection .standard-selfservice-inline-action {
    align-self: flex-start;
    margin-top: var(--lumo-space-xs);
    font-size: var(--lumo-font-size-s);
    text-align: start;
}

.standard-selfservice-photo-modes {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: var(--lumo-space-s);
}

.standard-selfservice-photo-modes vaadin-button {
    margin: 0;
    border: 1px solid var(--lumo-contrast-20pct);
    background: var(--lumo-base-color);
}

.standard-selfservice-photo-modes vaadin-button .fontawesome {
    width: var(--lumo-icon-size-s);
    height: var(--lumo-icon-size-s);
    color: var(--lumo-primary-text-color);
}

.standard-selfservice-block-button {
    margin-top: var(--lumo-space-s);
    border: 1px solid var(--lumo-error-color-50pct);
    background: var(--lumo-base-color);
}

.standard-selfservice-unblock-button,
.standard-selfservice-order-button {
    margin-top: var(--lumo-space-s);
    border: 1px solid var(--lumo-contrast-20pct);
    background: var(--lumo-base-color);
}

/* Asked in place of the button it confirms; framed by a border, which forced-colors mode keeps */
.standard-selfservice-confirm {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--lumo-space-s);
    max-width: 24rem;
    margin-top: var(--lumo-space-s);
    padding: var(--lumo-space-m);
    border: 1px solid var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-l);
    background: var(--lumo-base-color);
    text-align: center;
}

.standard-selfservice-confirm-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--lumo-space-s);
}

/* Shaped like a tertiary button, pulled left by its padding so the arrow lines up with the content */
a.standard-selfservice-back,
a.standard-selfservice-help-link {
    display: inline-flex;
    align-items: center;
    gap: var(--lumo-space-s);
    margin-left: calc(-1 * var(--lumo-space-s));
    padding: var(--lumo-space-xs) var(--lumo-space-s);
    border-radius: var(--lumo-border-radius-m);
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

a.standard-selfservice-back:hover,
a.standard-selfservice-back:focus-visible,
a.standard-selfservice-help-link:hover,
a.standard-selfservice-help-link:focus-visible {
    background: var(--lumo-contrast-5pct);
    color: var(--lumo-body-text-color);
    text-decoration: none;
}

/* The faint tint alone does not mark the keyboard focus, so the ring is the same as on a tile */
a.standard-selfservice-back:focus,
a.standard-selfservice-help-link:focus {
    outline: none;
}

a.standard-selfservice-back:focus-visible,
a.standard-selfservice-help-link:focus-visible {
    outline: 2px solid var(--lumo-primary-color);
    outline-offset: 2px;
}

/* Beats "a vaadin-icon", whose padding would squeeze every icon inside a link */
.standard-selfservice-back .fontawesome,
.standard-selfservice-help-link .fontawesome,
.standard-selfservice-tile .fontawesome {
    padding: 0;
}

.standard-selfservice-back .fontawesome,
.standard-selfservice-help-link .fontawesome {
    width: 14px;
    height: 14px;
    color: currentColor;
}

.standard-selfservice-page-header {
    margin-top: var(--lumo-space-s);
}

/* A link shaped like a full-width secondary button, for navigation that sits among buttons. The values are those
   of Lumo's button: --lumo-button-size exists only inside a button, so its default --lumo-size-m stands in */
a.selfservice-button-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--lumo-space-s);
    box-sizing: border-box;
    width: 100%;
    min-height: var(--lumo-size-m);
    margin: var(--lumo-space-xs) 0;
    padding: 0 calc(var(--lumo-size-m) / 3 + var(--lumo-border-radius-m) / 2);
    border-radius: var(--lumo-border-radius-m);
    background: var(--lumo-contrast-5pct);
    color: var(--lumo-primary-text-color);
    font-family: var(--lumo-font-family);
    font-size: var(--lumo-font-size-m);
    font-weight: 500;
    line-height: var(--lumo-line-height-xs);
    text-decoration: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.15s ease;
}

a.selfservice-button-link:hover {
    background: var(--lumo-contrast-10pct);
    text-decoration: none;
}

a.selfservice-button-link:focus {
    outline: none;
}

a.selfservice-button-link:focus-visible {
    outline: 2px solid var(--lumo-primary-color);
    outline-offset: 2px;
}

/* The size of an icon in a button; beats "a vaadin-icon", whose padding would squeeze it */
.selfservice-button-link .fontawesome {
    width: var(--lumo-icon-size-s);
    height: var(--lumo-icon-size-s);
    padding: 0;
    color: currentColor;
}

.standard-selfservice-tiles {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-s);
    width: 100%;
}

/* The status panel shrunk to one line: the same tint, so a tile tells its state before it is opened */
.standard-selfservice-tile {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-m);
    padding: var(--lumo-space-m);
    /* Invisible normally, but forced-colors mode draws it where tint and shadow are dropped */
    border: 1px solid transparent;
    border-radius: var(--lumo-border-radius-l);
    background: var(--standard-selfservice-status-background, var(--lumo-contrast-5pct));
    color: var(--lumo-body-text-color);
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

a.standard-selfservice-tile:hover,
a.standard-selfservice-tile:focus-visible {
    box-shadow: var(--lumo-box-shadow-s);
    transform: translateY(-1px);
    text-decoration: none;
}

/* The browser's outline would frame the tile black after a click, a ring only shows for the keyboard */
a.standard-selfservice-tile:focus {
    outline: none;
}

a.standard-selfservice-tile:focus-visible {
    outline: 2px solid var(--lumo-primary-color);
    outline-offset: 2px;
}

/* Only the icon fades: an opacity on the tile would take the text, which says why it is unavailable, below 4.5:1 */
.standard-selfservice-tile-inactive {
    border-style: dashed;
    border-color: var(--lumo-contrast-30pct);
}

.standard-selfservice-tile-inactive .standard-selfservice-tile-icon {
    opacity: 0.6;
}

.standard-selfservice-tile-icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--lumo-base-color);
    box-shadow: var(--lumo-box-shadow-xs);
}

.standard-selfservice-tile-icon .fontawesome {
    width: 22px;
    height: 22px;
    color: var(--standard-selfservice-status-color, var(--lumo-contrast-60pct));
}

.standard-selfservice-tile-texts {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--lumo-space-xs);
    min-width: 0;
}

.standard-selfservice-tile-title {
    font-weight: 600;
    color: var(--standard-selfservice-status-heading-color, var(--lumo-header-text-color));
}

.standard-selfservice-tile-text {
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
}

.standard-selfservice-tile .standard-selfservice-tile-chevron {
    flex: none;
    width: var(--lumo-icon-size-s);
    height: var(--lumo-icon-size-s);
    color: var(--lumo-tertiary-text-color);
}

.standard-selfservice-tile-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--lumo-space-s);
}

.standard-selfservice-stages {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-xs);
    margin-top: var(--lumo-space-xs);
    font-size: var(--lumo-font-size-s);
}

.standard-selfservice-stage {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-s);
    color: var(--lumo-secondary-text-color);
}

.standard-selfservice-stage .fontawesome {
    flex: none;
    width: 14px;
    height: 14px;
}

.standard-selfservice-stage-approved .fontawesome {
    color: var(--lumo-success-color);
}

.standard-selfservice-stage-current {
    color: var(--lumo-body-text-color);
    font-weight: 600;
}

.standard-selfservice-stage-later .fontawesome {
    color: var(--lumo-contrast-30pct);
}

.standard-selfservice-dates {
    flex-wrap: wrap;
    gap: var(--lumo-space-m);
}

.standard-selfservice-steps {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lumo-space-xs) var(--lumo-space-m);
    margin: var(--lumo-space-s) 0 0;
    padding: 0;
    list-style: none;
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-tertiary-text-color);
}

.standard-selfservice-step {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-xs);
}

/* A thin line between the steps, as long as they fit on one row */
.standard-selfservice-step:not(:last-child)::after {
    content: "";
    width: 24px;
    height: 1px;
    margin-left: var(--lumo-space-s);
    background: var(--lumo-contrast-20pct);
}

.standard-selfservice-step-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--lumo-contrast-30pct);
    font-size: var(--lumo-font-size-xs);
    font-weight: 600;
}

.standard-selfservice-step-marker .fontawesome {
    width: 11px;
    height: 11px;
    color: currentColor;
}

.standard-selfservice-step-done {
    color: var(--lumo-secondary-text-color);
}

.standard-selfservice-step-done .standard-selfservice-step-marker {
    border-color: var(--lumo-success-color);
    background: var(--lumo-success-color);
    color: var(--lumo-success-contrast-color);
}

.standard-selfservice-step-current {
    color: var(--lumo-header-text-color);
    font-weight: 600;
}

.standard-selfservice-step-current .standard-selfservice-step-marker {
    border-color: var(--lumo-primary-color);
    background: var(--lumo-primary-color);
    color: var(--lumo-primary-contrast-color);
}

/* What is being requested: framed instead of tinted, so it does not pass for a tile to click */
.standard-selfservice-selection {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-m);
    width: 100%;
    box-sizing: border-box;
    padding: var(--lumo-space-s) var(--lumo-space-m);
    border: 1px solid var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-l);
}

.standard-selfservice-selection .fontawesome {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--lumo-secondary-text-color);
}

.standard-selfservice-selection-texts {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.standard-selfservice-selection-change {
    flex: none;
    font-size: var(--lumo-font-size-s);
    /* Underlined like the inline action beside it: the color alone does not mark a link, least of all in forced-colors mode */
    text-decoration: underline;
}

.standard-selfservice-form-section {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-s);
    width: 100%;
}

/* Matches the label of Lumo's fields, for a group of chips that has no field of its own */
.standard-selfservice-field-label {
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
    font-weight: 500;
}

.standard-selfservice-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lumo-space-s);
}

.standard-selfservice-chip {
    margin: 0;
    border: 1px solid var(--lumo-contrast-20pct);
    border-radius: 999px;
    background: var(--lumo-base-color);
    color: var(--lumo-body-text-color);
}

.standard-selfservice-chip-selected {
    border-color: var(--lumo-primary-color);
    background: var(--lumo-primary-color-10pct);
    color: var(--lumo-primary-text-color);
    font-weight: 600;
}

.standard-selfservice-period-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--lumo-space-s);
    font-size: var(--lumo-font-size-s);
}

/* A native button styled as a link, taking the font of the sentence it continues */
.standard-selfservice-inline-action {
    padding: 0;
    border: 0;
    background: none;
    /* Not the primary text color: outside a vaadin-button the theme sets that to grey */
    color: var(--secanda-link-color);
    font: inherit;
    /* Always underlined: the color alone does not set it apart from the sentence, least of all in forced-colors mode */
    text-decoration: underline;
    cursor: pointer;
}

.standard-selfservice-inline-action:focus-visible {
    outline: 2px solid var(--lumo-primary-color);
    outline-offset: 2px;
    border-radius: var(--lumo-border-radius-s);
}

/* Information rather than a choice: a tinted box with a numbered timeline that ends in the access */
.standard-selfservice-chain {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-s);
    width: 100%;
    box-sizing: border-box;
    margin-top: var(--lumo-space-s);
    padding: var(--lumo-space-m);
    border-radius: var(--lumo-border-radius-l);
    background: var(--lumo-contrast-5pct);
}

.standard-selfservice-timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.standard-selfservice-timeline li {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--lumo-space-m);
    padding-bottom: var(--lumo-space-m);
}

.standard-selfservice-timeline li:last-child {
    padding-bottom: 0;
}

/* The line joining one marker to the next */
.standard-selfservice-timeline li:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 26px;
    bottom: 2px;
    left: 12px;
    width: 2px;
    background: var(--lumo-contrast-20pct);
}

.standard-selfservice-timeline-marker {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 26px;
    height: 26px;
    /* Invisible normally, but forced-colors mode draws it where the shadow is dropped */
    border: 1px solid transparent;
    border-radius: 50%;
    background: var(--lumo-base-color);
    box-shadow: var(--lumo-box-shadow-xs);
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-xs);
    font-weight: 600;
}

.standard-selfservice-timeline-marker-final {
    background: var(--lumo-success-color-10pct);
}

.standard-selfservice-timeline-marker-final .fontawesome {
    width: 13px;
    height: 13px;
    color: var(--lumo-success-text-color);
}

/* Someone else waits for the person, so the tile takes the accent color rather than a status color */
.standard-selfservice-status-attention {
    --standard-selfservice-status-color: var(--lumo-primary-color);
    --standard-selfservice-status-background: var(--lumo-primary-color-10pct);
    --standard-selfservice-status-heading-color: var(--lumo-primary-text-color);
}

/* The secondary color reaches only about 4.4:1 on the tint */
.standard-selfservice-status-attention .standard-selfservice-tile-text {
    color: var(--lumo-body-text-color);
}

/* Rings out a few times on arrival, then rests: the tile asks for attention without nagging */
.standard-selfservice-status-attention .standard-selfservice-tile-icon {
    --standard-selfservice-ripple-base: var(--lumo-box-shadow-xs);
    --standard-selfservice-ripple-color: var(--lumo-primary-color-50pct);
    --standard-selfservice-ripple-size: 14px;
    animation: standard-selfservice-ripple 1.2s ease-out 0.3s 3;
}

.standard-selfservice-count {
    padding: 2px var(--lumo-space-s);
    border-radius: 999px;
    background: var(--lumo-primary-color);
    color: var(--lumo-primary-contrast-color);
    font-size: var(--lumo-font-size-s);
    font-weight: 600;
}

.standard-selfservice-decisions {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-m);
    width: 100%;
}

/* Framed and raised rather than tinted: a request to work through, not a status to read */
.standard-selfservice-decision {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-m);
    padding: var(--lumo-space-l);
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-l);
    background: var(--lumo-base-color);
    box-shadow: var(--lumo-box-shadow-xs);
    transition: box-shadow 0.2s ease;
    animation: standard-selfservice-rise-in 0.3s ease-out both;
}

.standard-selfservice-decision:hover,
.standard-selfservice-decision:focus-within {
    box-shadow: var(--lumo-box-shadow-s);
}

.standard-selfservice-decision-person {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--lumo-space-s) var(--lumo-space-m);
}

/* The basis makes the date wrap below once space runs out, instead of squeezing the name word by word */
/* A photo with a light background would otherwise run into the white card */
.standard-selfservice-decision-avatar {
    flex: none;
    box-shadow: 0 0 0 1px var(--lumo-contrast-10pct);
}

.standard-selfservice-decision-who {
    display: flex;
    flex: 1 1 10em;
    flex-direction: column;
    min-width: 0;
}

.standard-selfservice-decision-name {
    font-weight: 600;
    color: var(--lumo-header-text-color);
}

.standard-selfservice-decision-meta {
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
}

/* Wraps the chips below the name once both no longer fit, e.g. on a phone or for a long name */
.standard-selfservice-decision-subject {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--lumo-space-s) var(--lumo-space-m);
}

.standard-selfservice-decision-permission {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--lumo-space-s);
    font-size: var(--lumo-font-size-l);
    font-weight: 600;
    color: var(--lumo-header-text-color);
    overflow-wrap: anywhere;
}

.standard-selfservice-decision-permission .fontawesome {
    flex: none;
    box-sizing: content-box;
    width: 16px;
    height: 16px;
    padding: var(--lumo-space-s);
    border-radius: var(--lumo-border-radius-m);
    background: var(--lumo-primary-color-10pct);
    color: var(--lumo-primary-text-color);
}

.standard-selfservice-decision-facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lumo-space-s);
}

.standard-selfservice-decision-fact {
    display: inline-flex;
    align-items: center;
    gap: var(--lumo-space-xs);
    padding: var(--lumo-space-xs) var(--lumo-space-s);
    border-radius: 999px;
    background: var(--lumo-contrast-5pct);
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
}

.standard-selfservice-decision-fact .fontawesome {
    width: 12px;
    height: 12px;
    color: currentColor;
}

/* The requester's own words, set apart like a quote so they do not read as the system's */
.standard-selfservice-decision-justification {
    position: relative;
    padding: var(--lumo-space-s) var(--lumo-space-m) var(--lumo-space-s) calc(var(--lumo-space-m) + 4px);
    border-radius: var(--lumo-border-radius-m);
    background: var(--lumo-contrast-5pct);
    color: var(--lumo-body-text-color);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.standard-selfservice-decision-justification::before {
    content: "";
    position: absolute;
    top: var(--lumo-space-s);
    bottom: var(--lumo-space-s);
    left: var(--lumo-space-s);
    width: 3px;
    border-radius: 2px;
    background: var(--lumo-primary-color-50pct);
}

.standard-selfservice-progress {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-xs);
}

.standard-selfservice-progress-segments {
    display: flex;
    gap: 4px;
}

.standard-selfservice-progress-segment {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--lumo-contrast-10pct);
}

.standard-selfservice-progress-done {
    background: var(--lumo-success-color);
}

/* The stage waiting for the person breathes, so the eye finds it among the others */
.standard-selfservice-progress-current {
    background: var(--lumo-primary-color);
    /* A few breaths, then rest: an endless animation cannot be paused (WCAG 2.2.2) */
    animation: standard-selfservice-breathe 2s ease-in-out 3;
}

.standard-selfservice-progress-labels {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--lumo-space-xs) var(--lumo-space-m);
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
}

.standard-selfservice-decision-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--lumo-space-s);
    padding-top: var(--lumo-space-m);
    border-top: 1px solid var(--lumo-contrast-10pct);
}

.standard-selfservice-decision-actions vaadin-button {
    width: 100%;
    margin: 0;
}

.standard-selfservice-decision-actions-form {
    display: flex;
    flex-direction: column;
}

.standard-selfservice-decision-form-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--lumo-space-s);
}

.standard-selfservice-decision-form-buttons vaadin-button {
    width: auto;
}

.standard-selfservice-decision-outcome {
    animation: standard-selfservice-pop-in 0.35s ease-out both;
}

.standard-selfservice-decision-conflict {
    display: flex;
    align-items: flex-start;
    gap: var(--lumo-space-s);
    padding: var(--lumo-space-s) var(--lumo-space-m);
    border-radius: var(--lumo-border-radius-m);
    background: var(--lumo-warning-color-10pct);
    font-size: var(--lumo-font-size-s);
    animation: standard-selfservice-pop-in 0.35s ease-out both;
}

.standard-selfservice-decision-conflict vaadin-icon {
    flex: none;
    width: var(--lumo-icon-size-s);
    height: var(--lumo-icon-size-s);
    margin-top: 0.15em;
    color: var(--lumo-warning-color);
}

@keyframes standard-selfservice-rise-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@keyframes standard-selfservice-pop-in {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
}

@keyframes standard-selfservice-breathe {
    50% {
        opacity: 0.55;
    }
}

/* The base keeps an element's own shadow while the ring spreads around it */
@keyframes standard-selfservice-ripple {
    from {
        box-shadow: var(--standard-selfservice-ripple-base, 0 0 0 0 transparent),
        0 0 0 0 var(--standard-selfservice-ripple-color, var(--lumo-success-color-50pct));
    }
    to {
        box-shadow: var(--standard-selfservice-ripple-base, 0 0 0 0 transparent),
        0 0 0 var(--standard-selfservice-ripple-size, 20px) transparent;
    }
}

@media (max-width: 600px) {
    .standard-selfservice-submit {
        width: 100%;
    }

    .standard-selfservice-decision {
        padding: var(--lumo-space-m);
    }
}

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

    a.standard-selfservice-tile:hover,
    a.standard-selfservice-tile:focus-visible {
        transform: none;
    }

    .standard-selfservice-decision,
    .standard-selfservice-decision-outcome,
    .standard-selfservice-decision-conflict,
    .standard-selfservice-progress-current,
    .standard-selfservice-status-attention .standard-selfservice-tile-icon {
        animation: none;
    }
}

@media (max-width: 800px) {
    .selfServiceCardPreviewPanel {
        max-width: 100%;
        display: block;
    }

    .selfservice .customerlogo {
        margin-top: var(--lumo-space-l);
    }
}

.selfservice .customerlogo, .selfservice.customerlogo {
    margin-top: var(--lumo-space-l);
    max-width: 60%;
}

@media (max-width: 1000px) {
    .login-layout .left-pane {
        display: none;
    }

    .selfservice-login-layout .left-pane {
        display: none;
    }
}

.selfservice-mainview {
    background-image: url('/selfservice/images/background');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    overflow: hidden;
}

.selfservice-mainview > vaadin-vertical-layout {
    backdrop-filter: blur(20px);
    overflow-y: auto;
    contain: layout;
}

.selfservice-mainview hr {
    border-top: 1px solid lightgray;
    margin: 0;
}

.selfservice-mainview .selfservice-loader {
    backdrop-filter: blur(50px) brightness(130%);
    border-radius: 25px;
    color: var(--secanda-background-positive);
    padding-bottom: var(--lumo-space-l);
    overflow: hidden;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Ring and disc have to move together, or the ring sits off-centre on its disc */
.selfservice-loader .v-loading-indicator::before,
.selfservice-loader .v-loading-indicator::after {
    top: 80px;
}

.selfservice-mainview vaadin-badge > vaadin-icon {
    margin: 0 var(--lumo-space-s) 0 0;
}

.selfservice-mainview vaadin-badge:not([theme~="success"]):not([theme~="error"]):not([theme~="contrast"]) {
    color: var(--lumo-primary-color);
}

.selfservice-mainview vaadin-badge:not([theme~="success"]):not([theme~="error"]):not([theme~="contrast"]) .fontawesome {
    --fa-primary-color: var(--lumo-primary-text-color);
}

.selfservice-mainview vaadin-badge[theme~="success"] .fontawesome {
    --fa-primary-color: var(--lumo-success-text-color);
}

.selfservice-mainview vaadin-badge[theme~="error"] .fontawesome {
    --fa-primary-color: hsl(3, 79%, 49%); /* from Color.css */
}

.selfservice-mainview vaadin-badge[theme~="contrast"] .fontawesome {
    --fa-primary-color: var(--lumo-contrast);
}

body[theme~="dark"] .selfservice-mainview vaadin-badge[theme~="contrast"] {
    background-color: var(--lumo-contrast-20pct);
}

.selfservice > span {
    margin-left: 1px
}

.gridFilter > vaadin-radio-button > label {
    padding-top: 0;
    padding-bottom: 0;
    padding-right: 0;
}

.gridFilterLayout vaadin-button {
    margin-top: 0;
}

/* Looks like a small Lumo text field, see PopoverFilterField */
.grid-filter-field {
    box-sizing: border-box;
    height: var(--lumo-size-s);
    line-height: var(--lumo-size-s);
    padding: 0 calc(0.375em + var(--lumo-border-radius-m) / 4 - 1px);
    border-radius: var(--lumo-border-radius-m);
    background-color: var(--lumo-contrast-10pct);
    color: var(--lumo-body-text-color);
    font-size: var(--lumo-font-size-s);
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.grid-filter-field.empty {
    color: var(--lumo-secondary-text-color);
}

.grid-filter-field:hover {
    background-color: var(--lumo-contrast-20pct);
}

.grid-filter-field:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);
}

.gridFilter vaadin-date-picker::part(toggle-button) {
    display: none;
}

.gridFilter vaadin-time-picker::part(toggle-button) {
    display: none;
}

vaadin-grid::part(drag-and-drop-enabled) {
    cursor: grab;
}

vaadin-text-field > vaadin-icon[slot="suffix"] {
    color: var(--lumo-secondary-text-color);
    width: var(--lumo-icon-size-s);
    cursor: pointer;
}

.dascom-connection-info, .dascom-connection-info .fontawesome {
    text-align: center;
    color: var(--lumo-primary-color);
}
.dascom-connection-info .fontawesome {
    width: var(--lumo-icon-size-s);
    height: var(--lumo-icon-size-s);
}

.dascom-connection-info span {
    padding-left: var(--lumo-space-s);
}

.engine-parameters > textarea {
    font-family: monospace;
}

.proxy-info {
    margin-top: var(--lumo-space-m);
}

.proxy-info > pre {
    margin: 0;
    width: 100%;
}

vaadin-text-field.multi-lang-textfield::part(input-field) {
    cursor: pointer;
}

.multi-lang-textfield .translations-missing {
    width: var(--lumo-icon-size-s);
    /* On the warning rather than the toggle, so the toggle keeps its position while the warning is hidden */
    margin-right: var(--lumo-space-xs);
}

/* Matches the toggle of combo boxes: Lumo draws its chevron at about half the icon box, Font Awesome at 70 % */
.multi-lang-textfield .multi-lang-toggle {
    width: 1em;
    height: 1em;
}

vaadin-grid::part(background-grey) {
    background-color: #dcdcdc;
    background-image: unset;
}

.importCard {
    cursor: pointer;
    flex: 1;
    min-width: 400px;
}

.activeImportCard {
    background-color: var(--lumo-primary-color-5pct);
}

vaadin-markdown li {
    margin-block: 0;
}

.activityLogDetails p {
    margin-block: 0;
}

/* Let long activity log entries wrap onto several lines instead of being cut off; the grid grows the row to fit. */
vaadin-grid-cell-content:has(.activityLogDetails) {
    white-space: normal;
    overflow-wrap: anywhere;
}

vaadin-virtual-list {
    min-height: 0;
}

vaadin-master-detail-layout {
    min-height: 0;
}

.entity-list {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
}

vaadin-tabsheet vaadin-tab vaadin-icon {
    padding-right: var(--lumo-space-xs);
    width: var(--lumo-icon-size-m);
}

vaadin-tabsheet.migration vaadin-tab[disabled] vaadin-icon {
    color: var(--lumo-disabled-text-color);
}

vaadin-tabsheet.migration vaadin-tab {
    cursor: pointer;
}

.custom-form-header {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
    padding-top: var(--lumo-space-s);
}

vaadin-grid::part(clickable-cell) {
    cursor: pointer;
}

vaadin-message-list, vaadin-message-input {
    padding: 0;
}

vaadin-message {
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
}

vaadin-grid::part(diagnostics-result-column) {
    height: 50px;
}

.diagnostics-details {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-tertiary-text-color);
}

vaadin-menu-bar-item a {
    color: var(--lumo-body-text-color);
}
vaadin-menu-bar-item a:hover {
    text-decoration: none;
}

.sortable-grid::part(body-cell) {
    cursor: grab;
}

.sortable-grid::part(first-row) {
    padding-top: 2px;
}

.sortable-grid::part(body-cell):active {
    cursor: grabbing;
}

.sortable-grid::part(drag-selected) {
    background-color: var(--lumo-primary-color-10pct);
}

.secret-field-indicator > vaadin-button[slot="suffix"] {
    margin: 0;
}

/* Row checkboxes are non-interactive when individual deselection is frozen (large-dataset select-all).
   The :not() excludes the header select-all checkbox which must remain clickable. */
vaadin-grid.selection-frozen vaadin-grid-cell-content vaadin-checkbox:not(.vaadin-grid-select-all-checkbox) {
    pointer-events: none;
    opacity: 0.4;
}

/* ── Background Enhancement Preview Window ─────────────────────────────── */

.rembg-preview-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* White backdrop for the revealed (non-transparent-checkered) result image; must not apply
   while .preview-loading is still supplying its shimmer gradient background. */
.rembg-preview-wrapper:not(.preview-loading) {
    background: #fff;
}

.rembg-preview-image {
    display: block;
    width: 100%;
    border-radius: var(--lumo-border-radius-m);
}

.rembg-status-row {
    gap: var(--lumo-space-s);
    margin-top: var(--lumo-space-xs);
}

.rembg-hint-label {
    font-size: var(--lumo-font-size-s);
    margin-top: calc(-1 * var(--lumo-space-xs));
}

/* ── Stars ────────────────────────────────────────────────────────────────── */

/* 4-pointed sparkle shape — thicker points, visible on any background via purple drop-shadow */
.rembg-star {
    position: absolute;
    top: var(--top);
    left: var(--left);
    pointer-events: none;
    clip-path: polygon(50% 0%, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0% 50%, 37% 37%);
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.7));
    opacity: 0;
}

/* Sizes */
.rembg-star--sm  { width: 15px; height: 15px; }
.rembg-star--md  { width: 22px; height: 22px; }
.rembg-star--lg  { width: 34px; height: 34px; }

/* Colors — radial gradient from bright centre to the named hue */
.rembg-star--light   { background: radial-gradient(circle, #ffffff 0%, #EDE9FE 60%); }
.rembg-star--lavender{ background: radial-gradient(circle, #EDE9FE 0%, #C4B5FD 60%); }
.rembg-star--violet  { background: radial-gradient(circle, #C4B5FD 0%, #8B5CF6 60%); }
.rembg-star--magenta { background: radial-gradient(circle, #F0ABFC 0%, #D946EF 60%); }
.rembg-star--indigo  { background: radial-gradient(circle, #C7D2FE 0%, #818CF8 60%); }

/* Per-star data: position, hop offset (--tx/--ty), duration, twinkle delay. */
.rembg-star--p1  { --top: 12%; --left: 22%; --tx:   8px; --ty:  -6px; --dur: 1.7s; --delay: 0.50s; }
.rembg-star--p2  { --top:  5%; --left: 58%; --tx:  -5px; --ty:   9px; --dur: 2.4s; --delay: 1.30s; }
.rembg-star--p3  { --top: 30%; --left: 82%; --tx:  -9px; --ty:   4px; --dur: 1.4s; --delay: 0.25s; }
.rembg-star--p4  { --top: 55%; --left: 88%; --tx:  -7px; --ty:  -8px; --dur: 2.1s; --delay: 0.75s; }
.rembg-star--p5  { --top: 72%; --left: 65%; --tx:  -4px; --ty: -10px; --dur: 1.9s; --delay: 0.00s; }
.rembg-star--p6  { --top: 85%; --left: 35%; --tx:   6px; --ty:  -8px; --dur: 1.3s; --delay: 1.00s; }
.rembg-star--p7  { --top: 65%; --left: 12%; --tx:   9px; --ty:  -5px; --dur: 2.6s; --delay: 0.50s; }
.rembg-star--p8  { --top: 38%; --left:  8%; --tx:  10px; --ty:   5px; --dur: 1.6s; --delay: 1.30s; }
.rembg-star--p9  { --top: 20%; --left: 45%; --tx:  -3px; --ty:   8px; --dur: 2.2s; --delay: 0.25s; }
.rembg-star--p10 { --top: 48%; --left: 55%; --tx:   7px; --ty:  -6px; --dur: 1.5s; --delay: 0.75s; }
.rembg-star--p11 { --top: 75%; --left: 42%; --tx:  -8px; --ty:   6px; --dur: 2.8s; --delay: 0.00s; }
.rembg-star--p12 { --top: 35%; --left: 32%; --tx:   5px; --ty:   9px; --dur: 2.0s; --delay: 1.00s; }

/* Refining positions — different scatter so stars visibly shift when the stage changes */
.rembg-stage-refining .rembg-star--p1  { --top: 25%; --left: 70%; }
.rembg-stage-refining .rembg-star--p2  { --top: 60%; --left: 15%; }
.rembg-stage-refining .rembg-star--p3  { --top: 15%; --left: 38%; }
.rembg-stage-refining .rembg-star--p4  { --top: 80%; --left: 58%; }
.rembg-stage-refining .rembg-star--p5  { --top: 42%; --left: 88%; }
.rembg-stage-refining .rembg-star--p6  { --top: 10%; --left: 75%; }
.rembg-stage-refining .rembg-star--p7  { --top: 50%; --left: 28%; }
.rembg-stage-refining .rembg-star--p8  { --top: 68%; --left: 48%; }
.rembg-stage-refining .rembg-star--p9  { --top: 32%; --left: 62%; }
.rembg-stage-refining .rembg-star--p10 { --top: 88%; --left: 22%; }
.rembg-stage-refining .rembg-star--p11 { --top: 18%; --left: 85%; }
.rembg-stage-refining .rembg-star--p12 { --top: 55%; --left: 42%; }

/* Processing: slowed to refining speed from before */
.rembg-stage-processing .rembg-star {
    animation: rembg-twinkle calc(var(--dur) * 1.7) ease-in-out var(--delay) infinite;
}

/* Refining: a notch slower still */
.rembg-stage-refining .rembg-star {
    animation: rembg-twinkle calc(var(--dur) * 2.4) ease-in-out var(--delay) infinite;
}

@keyframes rembg-twinkle {
    /* — twinkle at base position — */
    0%   { opacity: 0;    transform: translate(0, 0)                   scale(0.2) rotate(0deg);   }
    8%   { opacity: 1;    transform: translate(0, 0)                   scale(1.0) rotate(14deg);  }
    18%  { opacity: 0.5;  transform: translate(0, 0)                   scale(0.6) rotate(0deg);   }
    28%  { opacity: 1;    transform: translate(0, 0)                   scale(1.0) rotate(-14deg); }
    /* — fade out at base — */
    40%  { opacity: 0;    transform: translate(0, 0)                   scale(0.2) rotate(0deg);   }
    /* — invisible snap to hop offset — */
    42%  { opacity: 0;    transform: translate(var(--tx), var(--ty))   scale(0.2) rotate(0deg);   }
    /* — twinkle at offset position — */
    52%  { opacity: 1;    transform: translate(var(--tx), var(--ty))   scale(1.0) rotate(-14deg); }
    62%  { opacity: 0.5;  transform: translate(var(--tx), var(--ty))   scale(0.6) rotate(0deg);   }
    72%  { opacity: 1;    transform: translate(var(--tx), var(--ty))   scale(1.0) rotate(14deg);  }
    /* — fade out at offset — */
    84%  { opacity: 0;    transform: translate(var(--tx), var(--ty))   scale(0.2) rotate(0deg);   }
    /* — invisible snap back to base, pause dark before looping — */
    86%  { opacity: 0;    transform: translate(0, 0)                   scale(0.2) rotate(0deg);   }
    100% { opacity: 0;    transform: translate(0, 0)                   scale(0.2) rotate(0deg);   }
}

/* Canvas Editor */

canvas-editor {
    display: inline-flex;
    align-items: flex-start;
    gap: var(--lumo-space-m);
}

.ce-editor-section {
    display: inline-flex;
    flex-direction: column;
    box-shadow: 0 0 0 1px var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-m);
    overflow: hidden;
}

.ce-preview-section {
    display: inline-flex;
    flex-direction: column;
    box-shadow: 0 0 0 1px var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-m);
    overflow: hidden;
}

canvas-editor.ce-mode-editor-only .ce-preview-section { display: none; }
canvas-editor.ce-mode-preview-only .ce-editor-section { display: none; }
canvas-editor.ce-auto-editor-only:not(.ce-mode-preview-only) .ce-preview-section { display: none; }

canvas-editor.ce-portrait .ce-editor-section,
canvas-editor.ce-portrait .ce-preview-section {
    align-items: center;
    background: var(--lumo-contrast-5pct);
}

.ce-view-toggle vaadin-button {
    margin: 0;
    --vaadin-button-height: 28px;
}

.ce-view-toggle .ce-toolbar__sep {
    margin: 0;
}

.ce-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--lumo-space-xs);
    padding: var(--lumo-space-xs) var(--lumo-space-s);
    background: var(--lumo-base-color);
    border-top: 1px solid var(--lumo-contrast-20pct);
    border-bottom: 1px solid var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-m) var(--lumo-border-radius-m) 0 0;
}

.ce-toolbar__group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ce-toolbar__sep {
    width: 1px;
    height: 20px;
    background: var(--lumo-contrast-20pct);
    margin: 0 var(--lumo-space-xs);
    flex-shrink: 0;
}

canvas-editor vaadin-button.ce-btn .fontawesome {
    width: 25px;
    height: 25px;
}

canvas-editor vaadin-button.ce-btn {
    --vaadin-button-height: 28px;
}

canvas-editor vaadin-button.ce-btn::part(label) {
    display: flex;
    align-items: center;
    padding: 0;
}

canvas-editor vaadin-button.ce-btn--active {
    --vaadin-button-tertiary-background: var(--lumo-primary-color-10pct);
    --vaadin-button-tertiary-text-color: var(--lumo-primary-text-color);
}

canvas-editor vaadin-checkbox {
    --vaadin-checkbox-label-font-size: var(--lumo-font-size-s);
    --vaadin-checkbox-size: var(--lumo-font-size-m);
    --vaadin-checkbox-label-padding: 0 var(--lumo-space-xs) 0 0;
}

canvas-editor vaadin-select,
canvas-editor vaadin-combo-box {
    --vaadin-field-default-height: 28px;
    max-width: 200px;
    font-size: var(--lumo-font-size-s);
}

/* The stroke width, with step buttons like the font size below: at 90px a two-digit value was cut off
   between them. */
canvas-editor vaadin-integer-field {
    --vaadin-field-default-height: 28px;
    width: 128px;
    font-size: var(--lumo-font-size-s);
}

/* Position and size fields in the context panel, in mm with one decimal. */
canvas-editor vaadin-number-field {
    --vaadin-field-default-height: 28px;
    width: 68px;
    font-size: var(--lumo-font-size-s);
}

/* Font size in points with step buttons, and the line spacing as a multiple. The stepped field has room
   for its widest value, "84,5", next to both step buttons (2 x 31.5px) and the unit, with a few pixels
   to spare for another font. */
canvas-editor vaadin-number-field.ce-font-size-field {
    width: 112px;
}

/* Opacity, corner radius and stroke width share a row and look alike, so each carries an icon (18px). */
canvas-editor vaadin-integer-field.ce-opacity-field {
    width: 140px;
}

/* "mm" takes more room than "pt". */
canvas-editor vaadin-number-field.ce-corner-radius-field {
    width: 146px;
}

/* Lumo sizes the step buttons at 1.5 x the icon size, 31.5px here, which makes the field taller than
   the select and combo box beside it. */
canvas-editor vaadin-number-field.ce-font-size-field::part(decrease-button),
canvas-editor vaadin-number-field.ce-font-size-field::part(increase-button),
canvas-editor vaadin-number-field.ce-corner-radius-field::part(decrease-button),
canvas-editor vaadin-number-field.ce-corner-radius-field::part(increase-button),
canvas-editor vaadin-integer-field::part(decrease-button),
canvas-editor vaadin-integer-field::part(increase-button) {
    max-height: var(--lumo-size-s);
}

/* Lumo fades out the last 1.25em of every input as an overflow hint. The value sits centred between the
   step buttons and never overflows, so the fade only ate into its last digit, as in "100". */
canvas-editor vaadin-number-field.ce-font-size-field > input,
canvas-editor vaadin-number-field.ce-corner-radius-field > input,
canvas-editor vaadin-integer-field.ce-opacity-field > input {
    mask-image: none;
}

canvas-editor vaadin-combo-box.ce-line-spacing-field {
    width: 88px;
}

.ce-geometry-row {
    gap: 4px;
    padding-top: 4px;
}

/* Prefix and value are centred separately by default, which leaves their baselines apart. */
.ce-geometry-row vaadin-number-field > input,
.ce-geometry-row vaadin-number-field > [slot='prefix'] {
    align-self: baseline;
}

.ce-geometry-row [slot='prefix'] {
    color: var(--lumo-secondary-text-color);
    font-size: var(--vaadin-input-field-value-font-size, var(--lumo-font-size-s));
    font-weight: 600;
}

.ce-color-picker {
    width: 28px;
    height: 28px;
    padding: 2px;
    border: 1px solid var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-s);
    background: var(--lumo-base-color);
    cursor: pointer;
    flex-shrink: 0;
}

.ce-color-picker--transparent {
    display: flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    font: inherit;
}

.ce-canvas {
    display: block;
    position: relative;
}

.ce-underlay {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    pointer-events: none;
}

.ce-editor-area {
    display: grid;
    grid-template-areas: "corner ruler-h" "ruler-v canvas";
    grid-template-columns: 18px auto;
    grid-template-rows: 18px auto;
}

.ce-ruler-corner {
    grid-area: corner;
    background: var(--lumo-contrast-5pct);
    border-right: 1px solid var(--lumo-contrast-20pct);
    border-bottom: 1px solid var(--lumo-contrast-20pct);
    box-sizing: border-box;
}

.ce-ruler-h {
    grid-area: ruler-h;
    display: block;
}

.ce-ruler-v {
    grid-area: ruler-v;
    display: block;
}

.ce-canvas-wrapper {
    grid-area: canvas;
    position: relative;
    display: block;
    line-height: 0;
}

.ce-card-area {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.ce-context-panel {
    position: fixed;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 4px 6px;
    background: var(--lumo-base-color);
    border: 1px solid var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-m);
    box-shadow: var(--lumo-box-shadow-m);
    pointer-events: all;
    opacity: 1;
    transition: opacity 0.12s ease;
}

.ce-context-row {
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

/* Groups two toggle buttons so a tooltip can hang on the group: a disabled vaadin-button gets
   pointer-events: none and never sees the hover its own tooltip would need. */
.ce-btn-pair {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* The second row of a text field's panel, as far from the first as the position fields are. */
.ce-context-row--continued {
    padding-top: 4px;
}

.ce-context-panel.ce-context-panel--hidden {
    opacity: 0;
    pointer-events: none;
}

/* Wider than a field's default of 12em, which cuts off the longer column labels. */
.ce-barcode-source {
    width: 16em;
}

.ce-context-panel__sep {
    width: 1px;
    height: 20px;
    background: var(--lumo-contrast-20pct);
    margin: 0 2px;
    flex-shrink: 0;
}

.ce-preview {
    display: block;
}

.ce-error-overlay {
    position: absolute;
    z-index: 3;
    top: var(--lumo-space-xs);
    left: var(--lumo-space-xs);
    right: var(--lumo-space-xs);
    padding: var(--lumo-space-xs) var(--lumo-space-s);
    border: 1px solid var(--lumo-error-color-50pct);
    border-radius: var(--lumo-border-radius-m);
    /* Opaque, not tinted: it has to stay readable over whatever the card shows underneath. */
    background-color: var(--lumo-base-color);
    box-shadow: var(--lumo-box-shadow-s);
    color: var(--lumo-error-text-color);
    font-size: var(--lumo-font-size-s);
    line-height: var(--lumo-line-height-s);
    word-break: break-all;
    /* Clicks belong to the card underneath. */
    pointer-events: none;
}

.ce-col-picker {
    position: relative;
}

.ce-col-panel {
    position: absolute;
    top: calc(100% + var(--lumo-space-xs));
    left: 0;
    z-index: 1000;
    /* Sized by its longest entry: absolutely placed under a narrow button, it would otherwise shrink to
       min-width and wrap entries such as "Bild hochladen". */
    width: max-content;
    min-width: 180px;
    max-width: 360px;
    max-height: 500px;
    overflow-y: auto;
    background: var(--lumo-base-color);
    border: 1px solid var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-m);
    box-shadow: var(--lumo-box-shadow-m);
}

.ce-col-panel vaadin-list-box {
    width: 100%;
}

.ce-col-group-label {
    padding: 6px 16px 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--lumo-secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    pointer-events: none;
}

/* A vaadin-select has no non-item entries, so a group heading is a disabled item - which Lumo paints
   like an unavailable option. The theme token scopes this to the pickers that group their columns
   rather than to every disabled item in the application; the items are light-DOM children of the
   field, and its overlay is a shadow part of it (vaadin-select::part(overlay)), not its own element. */
vaadin-select[theme~="ce-grouped"] vaadin-select-item[disabled] {
    color: var(--lumo-secondary-text-color);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

vaadin-list-box + .ce-col-group-label {
    border-top: 1px solid var(--lumo-contrast-10pct);
    margin-top: 4px;
}

.ce-col-subgroup-label {
    padding: 4px 16px 2px 24px;
    font-size: 10px;
    font-weight: 600;
    color: var(--lumo-secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
}

.ce-toolbar__spacer {
    flex: 1 0 var(--lumo-space-xl);
}

.ce-toolbar__right {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-xs);
}

.ce-layout-name {
    font-size: var(--lumo-font-size-xs);
    font-weight: 600;
    color: var(--lumo-secondary-text-color);
    white-space: nowrap;
}

.ce-zoom-level {
    min-width: 3.5em;
    text-align: center;
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
    align-self: center;
    user-select: none;
}

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

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

.ce-spinner {
    animation: ce-spin 0.8s linear infinite;
    transform-origin: center;
    transform-box: fill-box;
}

.ce-barcode-type-row {
    padding: var(--lumo-space-xs) var(--lumo-space-s) var(--lumo-space-s);
    border-bottom: 1px solid var(--lumo-contrast-10pct);
}

.ce-expr-input {
    width: 160px;
    height: 28px;
    padding: 0 var(--lumo-space-xs);
    border: 1px solid var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-s);
    background: var(--lumo-base-color);
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-body-text-color);
    font-family: monospace;
}

.ce-condition-panel {
    min-width: 260px;
    border-top: 1px solid var(--lumo-contrast-10pct);
    margin-top: var(--lumo-space-s);
    padding-top: var(--lumo-space-s);
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-xs);
}

.ce-condition-empty {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-xs);
    font-size: var(--lumo-font-size-m);
    color: var(--lumo-body-text-color);
    padding: var(--lumo-space-xs);
    white-space: nowrap;
}

.ce-condition-row {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-xs);
}

.ce-condition-field {
    flex: 1;
    min-width: 0;
}

.ce-condition-value {
    --vaadin-field-default-height: 28px;
    width: 100px;
    font-size: var(--lumo-font-size-s);
}

.ce-condition-op-row {
    display: flex;
    justify-content: center;
    padding: 2px 0;
}

.ce-condition-op-btn {
    min-width: 64px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.ce-condition-add {
    width: 100%;
    margin-top: 2px;
}

.ce-condition-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    background: var(--lumo-primary-color);
    color: var(--lumo-primary-contrast-color);
    border-radius: 7px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 2px;
    line-height: 1;
}


.archived-entry {
    opacity: 0.5;
}

.connector-type-card {
    cursor: pointer;
}

.connector-type-card:hover {
    background: var(--lumo-contrast-5pct);
}

/* The badge centres its icon in the line, but Roboto's letters sit slightly above the middle of it */
vaadin-badge > vaadin-icon[slot="icon"] {
    translate: 0 -0.07em;
}

/* Scales a logo that is not square into the icon's box instead of stretching it */
.vendor-icon {
    object-fit: contain;
}

.connector-type-card-upcoming {
    background: var(--lumo-contrast-5pct);
}

/* Everything but the badge saying why the card cannot be chosen */
.connector-type-card-upcoming > :not(.connector-type-coming-soon) {
    filter: grayscale(1);
    opacity: 0.5;
}

.clickable-dashboard-card {
    cursor: pointer;
}

.clickable-dashboard-card:hover {
    background: var(--lumo-contrast-5pct);
}

/*
 * A dashboard card's title link, stretched over the whole card (vaadin-card is position: relative), so the card
 * is one link whose address shows before the click, see CORE-2283. The ring goes around the card, not the title.
 */
/* With :hover, so it outweighs Lumo's a:where(:any-link):hover, which would underline the title */
.dashboard-card-link,
.dashboard-card-link:hover,
.dashboard-row-link:hover {
    color: inherit;
    text-decoration: none;
}

.dashboard-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.dashboard-card-link:focus {
    outline: none;
}

.clickable-dashboard-card:has(.dashboard-card-link:focus-visible) {
    outline: 2px solid var(--lumo-primary-color);
    outline-offset: 2px;
}

/* A row of a card that leads somewhere else than the card, laid above the card's stretched link */
.dashboard-row-link {
    position: relative;
    z-index: 1;
    display: block;
    /* The card's VerticalLayout aligns its children to the start, which would shrink the row to its text */
    width: 100%;
    box-sizing: border-box;
    color: inherit;
    text-decoration: none;
    border-radius: var(--lumo-border-radius-s);
}

.dashboard-row-link:hover {
    background: var(--lumo-contrast-5pct);
}

.dashboard-row-link:focus {
    outline: none;
}

.dashboard-row-link:focus-visible {
    outline: 2px solid var(--lumo-primary-color);
    outline-offset: 2px;
}

/* The switch between the credential list and the card orders, see CredentialPage.showOrders */
.credential-orders-toggle-active {
    background: var(--lumo-primary-color-10pct);
    color: var(--lumo-primary-text-color);
}

/* The count would take the button's line height and sit off the middle of its circle, so the circle has its own size */
.credential-orders-toggle vaadin-badge {
    --vaadin-badge-line-height: 1;
    --vaadin-badge-padding: 0 0.4em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 1.6em;
    height: 1.6em;
}

.credential-orders-toggle vaadin-badge::part(number) {
    line-height: 1;
}

/* Level with the page title above, which sits at the page's own padding */
.credential-orders {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-m);
    padding-bottom: var(--lumo-space-m);
    box-sizing: border-box;
}

.credential-orders-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--lumo-space-m);
}

.credential-orders-kpi {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-m);
    padding: var(--lumo-space-m);
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-l);
    background: var(--lumo-base-color);
}

.credential-orders-kpi-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--lumo-primary-color-10pct);
    color: var(--lumo-primary-text-color);
}

.credential-orders-kpi-text {
    display: flex;
    flex-direction: column;
    line-height: var(--lumo-line-height-xs);
}

/* Marked by its border and value as well, so the color is not alone in saying it */
.credential-orders-kpi-alert {
    border-color: var(--lumo-error-color-50pct);
}

.credential-orders-kpi-alert .credential-orders-kpi-icon {
    background: var(--lumo-error-color-10pct);
    color: var(--lumo-error-text-color);
}

.credential-orders-kpi-alert .credential-orders-kpi-value {
    color: var(--lumo-error-text-color);
}

.credential-orders-list {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-s);
}

/* An empty tab takes the rest of the page, so its message sits in the middle like an empty inbox */
/* Where the image configuration crops to a circle the photos are round, as the avatars are */
.credential-order-photos-round .credential-order-thumbnail {
    height: 3rem;
    border-radius: 50%;
}

.credential-order-compare-photos-round .credential-order-compare-frame {
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
}

.credential-order-compare-photos-round .credential-order-compare-frame img {
    object-fit: cover;
}

.credential-orders-list:has(> .credential-orders-empty) {
    flex-grow: 1;
}

.credential-orders-empty {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    min-height: 16rem;
    padding: var(--lumo-space-l);
    text-align: center;
}

.credential-orders-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: var(--lumo-primary-color-10pct);
    color: var(--lumo-primary-text-color);
}

.credential-order-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-m);
    padding: var(--lumo-space-m);
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-l);
    background: var(--lumo-base-color);
}

.credential-order-card:hover {
    border-color: var(--lumo-contrast-20pct);
}

.credential-order-card-selectable {
    cursor: pointer;
}

/* Opens every printed panel in full size */
.printed-card-front {
    cursor: pointer;
}

/* Keeps the heading's look, the underline on hover marks it as a link */
.credential-person-link {
    color: inherit;
    text-decoration: none;
}

.credential-person-link:hover {
    text-decoration: underline;
}

/* The border carries the selection beside the ticked box, which forced-colors mode keeps; the tint only adds to it */
.credential-order-card-selected,
.credential-order-card-selected:hover {
    border-color: var(--lumo-primary-color);
    background: var(--lumo-primary-color-10pct);
}

.credential-order-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--lumo-space-m);
}

.credential-order-main {
    display: flex;
    flex: 1 1 16rem;
    flex-direction: column;
    gap: var(--lumo-space-xs);
    min-width: 0;
}

.credential-order-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--lumo-space-s);
}

.credential-order-holder {
    color: var(--lumo-body-text-color);
    text-decoration: none;
}

.credential-order-holder:hover {
    color: var(--lumo-primary-text-color);
    text-decoration: underline;
}

.credential-order-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lumo-space-xs);
}

/* Where an order in production or a closed one stands, at the start of its row; the badge in the outcome says it in words as well */
.credential-order-status-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--lumo-contrast-5pct);
    color: var(--lumo-secondary-text-color);
}

.credential-order-status-icon-in-production {
    background: var(--lumo-primary-color-10pct);
    color: var(--lumo-primary-text-color);
}

.credential-order-status-icon-produced {
    background: var(--lumo-success-color-10pct);
    color: var(--lumo-success-text-color);
}

.credential-order-status-icon-rejected {
    background: var(--lumo-error-color-10pct);
    color: var(--lumo-error-text-color);
}

/* Takes the place of an open order's actions, aligned to the end like them */
.credential-order-outcome {
    display: flex;
    flex: 0 1 18rem;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--lumo-space-xs);
    margin-left: auto;
    min-width: 0;
    text-align: right;
}

/* Two photos wide in every row, so the names start level whether or not a new photo came */
.credential-order-photos {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-xs);
    width: 7.5rem;
    color: var(--lumo-secondary-text-color);
}

.credential-order-compare {
    height: auto;
    padding: 0;
}

/* The arrow or equals sign between the two photos, small and grey so it links them rather than competes */
.credential-order-transition {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
}

.credential-order-transition .fontawesome {
    width: var(--lumo-icon-size-s);
    height: var(--lumo-icon-size-s);
    color: var(--lumo-tertiary-text-color);
}

.credential-order-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 4rem;
    overflow: hidden;
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-m);
    box-sizing: border-box;
    background: var(--lumo-contrast-5pct);
    color: var(--lumo-tertiary-text-color);
}

.credential-order-compare-content {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-m);
}

.credential-order-compare-photos {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-m);
}

.credential-order-compare-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--lumo-space-s);
}

/* Both sides the same size, an empty one as well, so the photos line up */
.credential-order-compare-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 12rem;
    height: 16rem;
    overflow: hidden;
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-l);
    box-sizing: border-box;
    background: var(--lumo-contrast-5pct);
}

.credential-order-compare-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.credential-order-compare-frame-empty {
    flex-direction: column;
    gap: var(--lumo-space-s);
    padding: var(--lumo-space-m);
    color: var(--lumo-tertiary-text-color);
    text-align: center;
}

.credential-order-compare-hint {
    display: flex;
    align-items: flex-start;
    gap: var(--lumo-space-s);
    max-width: 26rem;
}

.credential-order-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.credential-order-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
    gap: var(--lumo-space-s);
}

/* The badge is the button's whole face, so the button adds no frame of its own */
.person-order-badge {
    height: auto;
    padding: 0;
}

.person-order-card {
    gap: var(--lumo-space-s);
    border-color: var(--lumo-primary-color-50pct);
}

/* Laid out like the header of a Card, with the link to all orders at its end like "Bearbeiten" beside it */
.person-order-heading {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-s);
    color: var(--lumo-primary-text-color);
}

.person-order-title {
    flex-grow: 1;
    font-size: var(--lumo-font-size-l);
    font-weight: 600;
    line-height: var(--lumo-line-height-xs);
}

.person-order-show-all {
    flex-shrink: 0;
    margin: 0 0 0 auto;
}

vaadin-grid-cell-content:has(.approval-history-timeline) {
    display: block;
    padding: var(--lumo-space-m) var(--lumo-space-l);
}

.approval-history-timeline {
    position: relative;
    padding-left: 28px;
    margin-left: 6px;
    border-left: 2px solid var(--lumo-contrast-20pct);
}

.approval-history-entry {
    position: relative;
    padding-bottom: var(--lumo-space-m);
}

.approval-history-entry:last-child {
    padding-bottom: 0;
}

.approval-history-placeholder {
    min-height: 26px;
    display: flex;
    align-items: center;
}

.approval-history-dot {
    position: absolute;
    left: -41px;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lumo-base-color);
    /* Opaque layer needed: --lumo-contrast-30pct alone is translucent and would show the connecting line through. */
    background: linear-gradient(var(--lumo-contrast-30pct), var(--lumo-contrast-30pct)), var(--lumo-base-color);
}

.approval-history-dot vaadin-icon {
    width: 14px;
    height: 14px;
    color: inherit;
}

.approval-history-dot-approved {
    background: var(--lumo-success-color);
}

.approval-history-dot-rejected {
    background: var(--lumo-error-color);
}

.approval-history-revoked {
    margin-top: var(--lumo-space-m);
    border-left: none;
}

.approval-justification {
    /* border-box needed: setWidthFull() sets inline width:100%, which else overflows with this padding/border. */
    box-sizing: border-box;
    background: var(--lumo-contrast-5pct);
    border-left: 3px solid var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-s);
    padding: var(--lumo-space-s) var(--lumo-space-m);
}


/* The list of a standard schema's mails: icon, name and badges in one line, the badges as a column on the right */
.mail-template-row {
    display: grid;
    /* The name may wrap rather than push the badge out of the narrow list */
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--lumo-space-s);
    padding-block: var(--lumo-space-xs);
}

@media (prefers-contrast: more), (forced-colors: active) {
    html {
        --vaadin-input-field-border-width: 2px;
        --vaadin-input-field-border-color: currentColor;
        --vaadin-button-border: 2px solid currentColor;
        --lumo-secondary-text-color: var(--lumo-body-text-color);
        --lumo-tertiary-text-color: var(--lumo-body-text-color);
    }

    /* The drop area and the cards are framed by a tint alone otherwise */
    vaadin-upload.person-import-upload,
    .person-import-format {
        border-color: currentColor;
    }

    .selfservice-mainview {
        background-image: none;
    }

    .setup-layout {
        background-color: var(--lumo-contrast-10pct);
    }

    .setup-layout::before {
        display: none;
    }

    .setup-card {
        border: 2px solid currentColor;
    }

    .selfservice-login-layout {
        backdrop-filter: none;
        background-color: var(--lumo-base-color);

        .left-pane {
            display: none;
        }

        .selfservice {
            max-width: 500px;
        }
    }

    .selfservice-mainview > vaadin-vertical-layout {
        background-color: var(--lumo-base-color);
    }

    .selfservice-mainview .selfservice-loader {
        backdrop-filter: none;
        background-color: var(--lumo-base-color);
        color: var(--lumo-body-text-color);
    }

    .selfservice-mainview vaadin-badge[theme~="success"],
    .selfservice-mainview vaadin-badge[theme~="error"],
    .selfservice-mainview vaadin-badge[theme~="contrast"] {
        background-color: transparent;
    }

    vaadin-badge,
    .standard-selfservice-count {
        border: 1px solid currentColor;
    }

    /* Set on the button itself: the variable does not reach tertiary buttons, and the classes of the order, block
       and unblock buttons fix a faint 1px border. The chips have a rule of their own, a chosen one sets its color */
    .selfservice-mainview:has(.standard-selfservice-topbar) vaadin-button:not([theme~="primary"]):not(.standard-selfservice-chip) {
        border: 2px solid currentColor;
    }

    .standard-selfservice-chip {
        border: 2px solid currentColor;
    }

    /* The inline variant, e.g. of the language switch, has neither padding nor height, so the border would touch the
       label. It gets the size of the tertiary button beside it, e.g. the logout button */
    .selfservice-mainview:has(.standard-selfservice-topbar) vaadin-button[theme~="tertiary-inline"] {
        height: var(--vaadin-button-height, var(--lumo-button-size));
        padding: 0 calc(var(--lumo-button-size) / 3 + var(--lumo-border-radius-m) / 2);
        font-size: var(--lumo-font-size-m);
    }

    /* Shaped like a tertiary button, so it gets the border of the buttons beside it, not just a hover tint */
    a.standard-selfservice-back,
    a.standard-selfservice-help-link {
        border: 2px solid currentColor;
    }

    /* Its edge is only a tint, which disappears in forced colors and stays faint in high contrast */
    a.selfservice-button-link {
        border: 1px solid currentColor;
    }

    hr {
        --lumo-contrast-10pct: var(--lumo-contrast);
    }

    .card-layout {
        border: 1px solid var(--lumo-contrast);
        box-shadow: none;
    }

    vaadin-upload::part(drop-label) {
        color: var(--lumo-body-text-color);
    }
}

@media (forced-colors: active) {
    vaadin-progress-bar {
        --lumo-primary-color: Highlight;
    }

    /* Keeps the traffic light colours; the outline keeps the dot visible on any system background. */
    .device-health-dot {
        forced-color-adjust: none;
        outline: 1px solid CanvasText;
    }

    .fontawesome {
        --fa-primary-color: ButtonText;
    }

    vaadin-icon {
        color: ButtonText;
    }

    .selfservice-mainview .selfservice-loader {
        background-color: Canvas;
        color: CanvasText;
        border: 1px solid CanvasText;
    }

    a.standard-selfservice-tile:hover,
    a.standard-selfservice-tile:focus-visible {
        border-color: Highlight;
    }

    /* An anchor gets LinkText (blue) here, but this one is shaped like the buttons beside it, and so is its border */
    a.standard-selfservice-back,
    a.standard-selfservice-help-link,
    a.selfservice-button-link {
        color: ButtonText;
    }

    /* A button would get ButtonText (black) here, but this one reads as a link and sits beside real ones */
    .standard-selfservice-inline-action {
        color: LinkText;
    }

    /* The fill is dropped, so a chosen chip would differ from the others by its bold font alone */
    .standard-selfservice-chip-selected,
    .standard-selfservice-step-current .standard-selfservice-step-marker {
        forced-color-adjust: none;
        background: Highlight;
        color: HighlightText;
        border-color: Highlight;
    }

    /* The joining lines are backgrounds, which are dropped too */
    .standard-selfservice-timeline li:not(:last-child)::before {
        width: 0;
        background: none;
        border-left: 2px solid CanvasText;
    }

    .standard-selfservice-step:not(:last-child)::after {
        height: 0;
        background: none;
        border-top: 1px solid CanvasText;
    }

    /* The labels beside the segments say the same */
    .standard-selfservice-progress-segments {
        display: none;
    }

    /* Without the round surface, the initials read like a typo */
    .selfservice-mainview:has(.standard-selfservice-topbar) vaadin-avatar {
        border: 1px solid CanvasText;
    }
}

/* Long, unbreakable config values (hex hashes, tokens, ...) must wrap instead of overflowing their card. */
.config-overview-value {
    word-break: break-all;
}


/* Copy-to-clipboard button */

.copy-button {
    color: var(--lumo-secondary-text-color);
    opacity: 0.3;
    transition: opacity 0.15s ease;
}

.copy-button:hover {
    opacity: 1;
}

.copy-button-success {
    color: var(--lumo-success-text-color);
    opacity: 1;
}

.copy-button-error {
    color: var(--lumo-error-text-color);
    opacity: 1;
}

.copy-button vaadin-icon {
    color: inherit;
}


/* My approvals: a brief celebration when the inbox reaches zero. */

.approval-confetti-layer {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    z-index: 10000;
}

.approval-confetti-piece {
    animation: approval-confetti-burst var(--duration) cubic-bezier(.16, .72, .3, 1) var(--delay) forwards;
    height: calc(var(--size) * .65);
    left: 0;
    position: absolute;
    top: 0;
    transform-origin: center;
    width: var(--size);
    will-change: transform, opacity;
}

@keyframes approval-confetti-burst {
    0% {
        opacity: 0;
        transform: translate3d(var(--origin-x), var(--origin-y), 0) rotate(0deg) scale(.3);
    }

    12% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate3d(calc(var(--origin-x) + var(--burst-x)), calc(var(--origin-y) + var(--burst-y)), 0)
                rotate(var(--rotation)) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .approval-confetti-layer {
        display: none;
    }
}

/* Long unbroken values (URLs, identifiers) wrap instead of scrolling: the tooltip closes as soon as
   the pointer leaves its target, so a scrollbar inside it can never be reached. */
vaadin-tooltip::part(content) {
    overflow-wrap: anywhere;
}

/* The switch of an area in the role dialog of a standard schema: segments side by side, the chosen one filled */
.mode-switch {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border-radius: var(--lumo-border-radius-l);
    background: var(--lumo-contrast-5pct);
}

.mode-switch vaadin-button {
    margin: 0;
    min-width: 7.5em;
    border-radius: var(--lumo-border-radius-l);
    background: transparent;
    color: var(--lumo-secondary-text-color);
    font-weight: 500;
}

.mode-switch vaadin-button[aria-pressed="true"] {
    background: var(--lumo-primary-color);
    color: var(--lumo-primary-contrast-color);
}

/* A locked switch, such as a built-in role's, keeps its choice readable but plainly out of reach */
.mode-switch vaadin-button[disabled] {
    color: var(--lumo-disabled-text-color);
}

.mode-switch vaadin-button[disabled][aria-pressed="true"] {
    background: var(--lumo-contrast-50pct);
    color: var(--lumo-base-color);
}

/* Between two modes not chosen only, a line beside the highlighted one would cling to it */
.mode-switch-divider {
    align-self: center;
    width: 1px;
    height: 1.25em;
    background: var(--lumo-contrast-20pct);
}

.mode-switch vaadin-button[aria-pressed="true"] + .mode-switch-divider,
.mode-switch-divider:has(+ vaadin-button[aria-pressed="true"]) {
    visibility: hidden;
}

/* The columns of the role area dialog's tables (ActionTable): fixed ones for boxes, the assign and revoke fields
   widening with the dialog. Managed kinds: label, read, write, delete, then read, assign and revoke */
.action-table-managed {
    grid-template-columns: 11em 4.5em 6em 5em 4.5em minmax(7em, 1fr) minmax(7em, 1fr);
}

/* Kinds that are only assigned: label, then read, assign and revoke */
.action-table-assign {
    grid-template-columns: 11em 4.5em minmax(7em, 1fr) minmax(7em, 1fr);
}

/* A scope field set to "all" shows its one chip in full rather than as an overflow count */
vaadin-multi-select-combo-box.scope-all {
    --vaadin-multi-select-combo-box-input-min-width: 0;
}

/* Keeps the place of an icon so a column lines up; opacity, as the svg inside sets its own visibility */
.placeholder-icon {
    opacity: 0;
}

/* NoticeCard: the card has no colour variant of its own, so the class tints it as a warning or an error */
vaadin-card.notice-warning {
    --vaadin-card-background: var(--lumo-warning-color-10pct);
    --vaadin-card-border-color: var(--lumo-warning-color);
    --vaadin-card-padding: var(--lumo-space-s);
}

vaadin-card.notice-error {
    --vaadin-card-background: var(--lumo-error-color-10pct);
    --vaadin-card-border-color: var(--lumo-error-color);
    --vaadin-card-padding: var(--lumo-space-s);
}

/* Help pages of management portal and self-service (HelpOverview, HelpEntryCard) and their administration */
.help-page {
    margin: 0 auto;
    gap: var(--lumo-space-l);
    container: help-page / inline-size;
}

/* The search shortens the page below the window height; the reserved gutter keeps the page from shifting */
vaadin-app-layout:has(.help-page)::part(content) {
    scrollbar-gutter: stable;
}

.help-header {
    gap: var(--lumo-space-m);
}

.help-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--lumo-space-xl) 0;
    text-align: center;
}

/* The violet of the other help icons, not the green of a success */
.help-no-results-icon {
    color: var(--fa-primary-color);
}

.help-section {
    width: 100%;
}

.help-section-title {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-s);
}

.help-section-title h2 {
    margin: 0;
    font-size: var(--lumo-font-size-xl);
}

/* --lumo-primary-text-color is grey in the light theme, the help icons take the violet of all others */
.help-section-icon {
    width: 24px;
    height: 24px;
    color: var(--fa-primary-color);
}

.help-section-description {
    margin: var(--lumo-space-xs) 0 var(--lumo-space-m);
    color: var(--lumo-secondary-text-color);
}

.help-topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--lumo-space-m);
}

/* vaadin-card positions its host, so the click area of its action (.help-topic-link::after) spans the whole card */
vaadin-card.help-topic-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

/* Only a card with something to open invites a click */
.help-topic-card:has(.help-topic-link) {
    cursor: pointer;
}

.help-topic-card:has(.help-topic-link):hover {
    box-shadow: var(--lumo-box-shadow-m);
    transform: translateY(-2px);
}

/* Fills the card's media part, which keeps 16:9 by itself */
.help-thumb {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--lumo-contrast-10pct);
    color: var(--lumo-body-text-color);
    overflow: hidden;
}

.help-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.help-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.15s ease;
}

.help-thumb-play .fontawesome {
    width: 56px;
    height: 56px;
    color: white;
}

.help-topic-card:hover .help-thumb-play {
    background: rgba(0, 0, 0, 0.45);
}

.help-thumb-placeholder {
    gap: var(--lumo-space-s);
    background: linear-gradient(135deg, var(--lumo-primary-color-10pct), var(--lumo-contrast-10pct));
}

/* Stands in for a whole thumbnail, so it has to carry the card beside cards with a picture */
.help-thumb-icon {
    width: 72px;
    height: 72px;
    color: var(--fa-primary-color);
}

.help-admin-thumbnail .help-thumb-icon {
    width: 40px;
    height: 40px;
}

/* Names the category on a card in a printer model's block, which has no category headings */
.help-topic-category {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
}

.help-topic-title {
    margin: 0;
    font-size: var(--lumo-font-size-l);
}

/* Cards in a row grow to the longest one, so a long description fades out instead of stretching them all */
.help-topic-description {
    --help-description-max: 6lh;
    max-height: var(--help-description-max);
    overflow: hidden;
    margin: 0;
    color: var(--lumo-secondary-text-color);
    /* Measured from the top, so that a text shorter than the limit keeps its last line */
    mask-image: linear-gradient(to bottom, black calc(var(--help-description-max) - 1.5lh), transparent var(--help-description-max));
}

/* A link or, for a page, a native button dressed as one */
.help-topic-link {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: var(--lumo-space-xs);
    margin-top: auto;
    padding: 0;
    border: none;
    background: none;
    color: var(--secanda-link-color);
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

/* The raised card already marks the hover, the underline Lumo gives a hovered link would only repeat it */
.help-topic-card:hover .help-topic-link {
    text-decoration: none;
}

.help-topic-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--vaadin-card-border-radius, var(--lumo-border-radius-l));
}

/* The whole card is the target, so the focus ring goes around the card, not around the label */
.help-topic-link:focus {
    outline: none;
}

.help-topic-link:focus-visible::after {
    outline: 2px solid var(--lumo-primary-color);
    outline-offset: -2px;
}

/* Links within the description stay reachable above the card-wide click area */
.help-topic-description a {
    position: relative;
    z-index: 1;
}

.help-topic-link .fontawesome {
    width: 14px;
    height: 14px;
    padding: 0;
}

.help-printer-card {
    margin-bottom: var(--lumo-space-m);
}

.help-icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--lumo-primary-color-10pct);
}

.help-icon-circle .fontawesome {
    width: 32px;
    height: 32px;
    color: var(--fa-primary-color);
}

/* Beside the logout button, not hanging out to the left like the back link */
a.standard-selfservice-help-link {
    margin-left: 0;
}

.help-overview {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-l);
}

.help-filter-bar {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-s);
}

.help-category {
    margin-bottom: var(--lumo-space-m);
}

.help-category-title {
    margin: var(--lumo-space-s) 0;
    font-size: var(--lumo-font-size-l);
}

.help-topic-models {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
}

.help-empty {
    color: var(--lumo-secondary-text-color);
}

.help-page-content img {
    max-width: 100%;
    height: auto;
}

.help-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin-top: var(--lumo-space-s);
}

/* An own help entry no page shows (HelpItemTab): icon and title grey, the buttons stay as they are */
.help-item-hidden .entity-icon,
.help-item-hidden h3 {
    --fa-primary-color: var(--lumo-secondary-text-color);
    color: var(--lumo-secondary-text-color);
}

.help-admin-intro {
    margin: 0;
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
}

.help-admin-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    aspect-ratio: 16 / 9;
    border-radius: var(--lumo-border-radius-m);
    background: var(--lumo-contrast-5pct);
    overflow: hidden;
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-xs);
    text-align: center;
}

.help-admin-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The look of a Vaadin field label, for a row of controls that is no field itself */
.help-admin-field-label {
    display: block;
    margin-bottom: var(--lumo-space-xs);
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
    font-weight: 500;
}

/* Markdown wraps even a single line in a paragraph, whose margins would stretch the card */
.help-topic-description p,
.help-topic-description ul,
.help-topic-description ol {
    margin: 0 0 var(--lumo-space-xs);
}

.help-topic-description ul,
.help-topic-description ol {
    padding-left: 1.4em;
}

.help-header-search {
    width: 320px;
    max-width: 100%;
}

/* Beside the title the search would squeeze it and stick out of the card */
@container help-page (max-width: 720px) {
    .help-header-search {
        grid-column: 1 / -1;
        grid-row: 3;
        width: 100%;
        margin-top: var(--lumo-space-s);
    }
}

.help-admin-thumbnail-buttons {
    gap: var(--lumo-space-s);
}

/* A tab holding a field that blocks saving; the icon says so without relying on the color */
vaadin-tab.help-admin-tab-invalid {
    color: var(--lumo-error-text-color);
}

vaadin-tab.help-admin-tab-invalid::after {
    content: "!";
    margin-left: var(--lumo-space-xs);
    font-weight: 600;
}

.help-admin-error {
    margin-top: var(--lumo-space-s);
    color: var(--lumo-error-text-color);
}

/* The look of a Vaadin helper text, below a row of controls that is no field itself */
.help-admin-hint {
    display: block;
    margin-top: var(--lumo-space-xs);
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-xs);
}

@media (forced-colors: active) {
    /* The tint behind the play icon disappears, the icon itself has to stay visible */
    .help-thumb-play .fontawesome {
        forced-color-adjust: none;
        color: CanvasText;
        background: Canvas;
    }
}
