/*
 * The design of the user interface on top of Bootstrap: a dense, calm look for working with many records. Colors come
 * from the Bootstrap variables, so the light and the dark theme both work.
 */

:root {
    --app-topbar-height: 56px;
    --app-sidebar-width: 240px;
    --app-sidebar-collapsed-width: 60px;
    --app-filter-width: 288px;
    --bs-body-font-size: .875rem;
}

body {
    -webkit-font-smoothing: antialiased;
}

/* ---------- density ---------- */

.btn {
    --bs-btn-font-size: .875rem;
    --bs-btn-font-weight: 500;
}

.btn-sm {
    --bs-btn-font-size: .8125rem;
}

/* The secondary buttons follow the colors of the theme instead of the fixed gray of Bootstrap ($secondary): readable
   in dark mode, and on hover only a step darker instead of a filled gray button with white text. Unlike a field
   (.form-control, on the background of the page) they have a surface, a slightly stronger border and a shadow
   (.shadow-sm in the templates), so they are recognized as buttons. Checked (e.g. a radio of .btn-check) looks like an active .btn-icon. */
.btn-outline-secondary {
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-bg: var(--bs-tertiary-bg);
    --bs-btn-border-color: color-mix(in srgb, var(--bs-border-color) 80%, var(--bs-body-color));
    --bs-btn-hover-color: var(--bs-emphasis-color);
    --bs-btn-hover-bg: var(--bs-secondary-bg);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--bs-border-color) 65%, var(--bs-body-color));
    --bs-btn-focus-shadow-rgb: var(--bs-secondary-rgb);
    --bs-btn-active-color: var(--bs-primary-text-emphasis);
    --bs-btn-active-bg: var(--bs-primary-bg-subtle);
    --bs-btn-active-border-color: var(--bs-primary-border-subtle);
    --bs-btn-disabled-color: var(--bs-tertiary-color);
    --bs-btn-disabled-bg: var(--bs-tertiary-bg);
    --bs-btn-disabled-border-color: var(--bs-border-color);
}

/* The primary and secondary buttons have .shadow-sm, its box-shadow is !important: the focus ring of a button is a
   box-shadow, too, it has to win over it for the keyboard */
.btn.shadow-sm:focus-visible,
.btn-check:focus-visible + .btn.shadow-sm {
    box-shadow: var(--bs-btn-focus-box-shadow) !important;
}

.form-control,
.form-select,
.input-group-text {
    font-size: .875rem;
}

.form-control-sm,
.form-select-sm,
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text,
.input-group-sm > .btn {
    font-size: .8125rem;
}

.dropdown-menu {
    --bs-dropdown-font-size: .875rem;
}

.pagination {
    --bs-pagination-font-size: .875rem;
}

.badge {
    font-weight: 600;
}

.modal-title,
.offcanvas-title {
    font-size: 1rem;
    font-weight: 600;
}

/* ---------- links: underlined on hover only, the tables are full of them ---------- */

a {
    text-decoration: none;
}

:where(main, .offcanvas-body) a:hover {
    text-decoration: underline;
}

.btn:hover,
.nav-link:hover,
.dropdown-item:hover,
.list-group-item:hover {
    text-decoration: none;
}

/* ---------- sidebar ---------- */

.sidebar {
    width: var(--app-sidebar-width);
    transition: width .15s ease-in-out;
}

.sidebar.sidebar-collapsed {
    width: var(--app-sidebar-collapsed-width);
}

.sidebar.sidebar-collapsed .sidebar-collapsed-hidden {
    display: none !important;
}

.sidebar .sidebar--collapse-toggle {
    width: 13px;
    margin-right: -8px;
    cursor: col-resize;
    opacity: 0;
    transition: opacity linear .1s;
}

.sidebar .sidebar--collapse-toggle:hover {
    opacity: 1;
}

.sidebar-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .625rem;
    height: calc(var(--app-topbar-height) - .5rem);
    padding: 0 .375rem;
    overflow: hidden;
    color: var(--bs-body-color);
    white-space: nowrap;
}

.sidebar-brand:hover {
    color: var(--bs-body-color);
}

.sidebar-logo {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: var(--bs-border-radius);
}

.sidebar-brand-name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.sidebar-brand-version {
    color: var(--bs-secondary-color);
    font-size: .75rem;
    line-height: 1.2;
}

.sidebar-nav {
    flex: 1 1 auto;
    margin: .5rem 0;
    padding: .25rem 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-top: var(--bs-border-width) solid var(--bs-border-color);
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
}

.sidebar:not(.sidebar-collapsed) .sidebar-nav {
    margin-top: 0;
    border-top: 0;
}

.sidebar-heading {
    padding: 1rem .75rem .375rem;
    overflow: hidden;
    color: var(--bs-tertiary-color);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* collapsed, a line separates the groups instead of their name */
.sidebar-collapsed .sidebar-heading {
    height: 0;
    margin: .5rem .75rem;
    padding: 0;
    border-top: var(--bs-border-width) solid var(--bs-border-color);
    color: transparent;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1px 0;
    padding: .4375rem .75rem;
    border-radius: var(--bs-border-radius);
    color: var(--bs-body-color);
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-nav .nav-link > .bi {
    flex: 0 0 auto;
    width: 1.125rem;
    color: var(--bs-secondary-color);
    font-size: 1rem;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
}

.sidebar-nav .nav-link.active {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

.sidebar-nav .nav-link.active > .bi {
    color: var(--bs-primary);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .375rem;
    border-radius: var(--bs-border-radius);
    cursor: pointer;
}

.sidebar-user:hover {
    background-color: var(--bs-tertiary-bg);
}

.sidebar-avatar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.sidebar-user-name {
    overflow: hidden;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-login {
    overflow: hidden;
    color: var(--bs-secondary-color);
    font-size: .75rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- topbar ---------- */

.app-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 1rem;
    height: var(--app-topbar-height);
    padding: 0 1.25rem;
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
}

.app-topbar-left {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

/* the actions of the page, next to its title: they do not shrink, the sums of a list (page-stats) do */
.page-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .5rem;
}

/* only the filter toggle and the help: as wide as these, the title, actions and sums of the page get the rest */
.app-topbar-right {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
}

.page-heading {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-width: 0;
}

.page-title {
    flex: 0 0 auto;
    margin: 0;
    overflow: hidden;
    color: var(--bs-emphasis-color);
    font-size: 1.0625rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: .375rem;
    color: var(--bs-secondary-color);
    font-size: 1.0625rem;
    white-space: nowrap;
}

.page-breadcrumb a {
    color: var(--bs-secondary-color);
}

.page-breadcrumb a:hover {
    color: var(--bs-primary);
}

.page-breadcrumb .bi {
    font-size: .75rem;
}

.page-count {
    padding: .125rem .5rem;
    border-radius: 1rem;
    background-color: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* the sums of a list by state, e.g. of the jobs */
.page-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    list-style: none;
    white-space: nowrap;
}

.page-stats li {
    display: flex;
    align-items: center;
    gap: .375rem;
}

.page-stats strong {
    color: var(--bs-body-color);
    font-weight: 600;
}

.status-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background-color: var(--bs-secondary-color);
}

.status-dot.is-success { background-color: var(--bs-success); }
.status-dot.is-danger { background-color: var(--bs-danger); }
.status-dot.is-info { background-color: var(--bs-info); }
.status-dot.is-warning { background-color: var(--bs-warning); }
.status-dot.is-muted { background-color: var(--bs-border-color); }

/* a square button with an icon, e.g. the help in the topbar */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: var(--bs-border-width) solid transparent;
    border-radius: var(--bs-border-radius);
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 1.0625rem;
}

.btn-icon:hover,
.btn-icon:focus-visible {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
}

.btn-icon.active {
    border-color: var(--bs-primary-border-subtle);
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

/* ---------- content ---------- */

.app-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow: auto;
}

.app-content {
    padding: 1.25rem;
}

.app-content-narrow {
    max-width: 1320px;
    margin: 0 auto;
    padding: 1.25rem;
}

.card {
    --bs-card-cap-bg: transparent;
    --bs-card-cap-padding-y: .75rem;
    --bs-card-cap-padding-x: 1rem;
    --bs-card-spacer-x: 1rem;
    --bs-card-border-color: var(--bs-border-color);
    box-shadow: 0 1px 2px rgba(var(--bs-black-rgb), .04);
}

.card-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--bs-emphasis-color);
    font-weight: 600;
}

.card-header .badge {
    font-weight: 600;
}

.section-label {
    margin-bottom: .5rem;
    color: var(--bs-secondary-color);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* the actions of a detail page, buttons in a row */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* read-only checkboxes, e.g. the permissions of an API key: disabled, but as legible as the ones of a form (Bootstrap
   fades disabled ones to half) */
.form-check-readonly .form-check-input:disabled,
.form-check-readonly .form-check-input:disabled ~ .form-check-label {
    opacity: 1;
}

.form-check-readonly .form-check-input:disabled:not(:checked) ~ .form-check-label {
    color: var(--bs-secondary-color);
}

/* the actions of a detail page: the primary one (e.g. the transfer) fills the first row, the others share columns of
   the same width; a button that changes its label (ui-action.js) changes neither its own width nor the position of the
   others */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: .5rem;
}

.action-grid > .action-primary {
    grid-column: 1 / -1;
}

.action-grid .btn {
    justify-content: center;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* the anchors of the sections of a detail page */
.section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .125rem .875rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* links to the sections further down the page: a table of contents, not chips (which would look like filters) */
.section-nav a {
    display: inline-flex;
    align-items: center;
    gap: .125rem;
    padding: .125rem 0;
    color: var(--bs-link-color);
    font-size: .875rem;
    text-decoration: none;
}

.section-nav a .bi {
    color: var(--bs-secondary-color);
    font-size: 1rem;
    transition: transform .15s ease-in-out;
}

.section-nav a:hover {
    color: var(--bs-link-hover-color);
    text-decoration: underline;
}

.section-nav a:hover .bi {
    color: inherit;
    transform: translateY(2px);
}

/* e.g. "Fassade" within the sections of the product */
.section-nav-group {
    margin: .5rem 0 .125rem;
    color: var(--bs-secondary-color);
    font-size: .75rem;
    font-weight: 600;
}

.section-label + .section-nav-group {
    margin-top: 0;
}

/* the jump scrolls smoothly and the reached section lights up briefly */
.app-main {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    .app-main {
        scroll-behavior: auto;
    }
}

[id^="section--"] {
    scroll-margin-top: 1.25rem;
}

[id^="section--"]:target {
    animation: section-target 1.6s ease-out;
}

/* an outline, the box-shadow of the cards (.shadow-sm) is !important and would win over the animation */
@keyframes section-target {
    0%, 40% {
        outline: .25rem solid rgba(var(--bs-primary-rgb), .4);
    }

    100% {
        outline: .25rem solid rgba(var(--bs-primary-rgb), 0);
    }
}

.empty-state {
    padding: 3rem 1rem;
    color: var(--bs-secondary-color);
    text-align: center;
}

.empty-state > .bi {
    display: block;
    margin-bottom: .5rem;
    color: var(--bs-tertiary-color);
    font-size: 2rem;
}

.empty-state-title {
    color: var(--bs-body-color);
    font-size: .9375rem;
    font-weight: 600;
}

/* ---------- values: null, true, false and empty, quieter than the data ---------- */

.value-null,
.value-empty {
    color: var(--bs-tertiary-color);
    font-family: var(--bs-font-monospace);
    font-size: .8125em;
    font-style: italic;
}

.value-true,
.value-false {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-family: var(--bs-font-monospace);
    font-size: .8125em;
}

.value-true { color: var(--bs-success-text-emphasis); }
.value-false { color: var(--bs-danger-text-emphasis); }

/* ---------- tables ---------- */

.table {
    --bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), .025);
    --bs-table-hover-bg: rgba(var(--bs-emphasis-color-rgb), .04);
    font-variant-numeric: tabular-nums;
}

.table > :not(caption) > * > * {
    padding: .4375rem .75rem;
}

.table > thead > tr > th {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.table-sticky {
    min-width: 100%;
}

.table-sticky td {
    vertical-align: middle;
}

/* separate borders, because collapsed ones belong to the table and don't move with the sticky header */
.table-sticky table {
    border-collapse: separate;
    border-spacing: 0;
}

.table-sticky thead tr {
    top: 0;
    position: sticky;
    z-index: 1;
}

.table-sticky :is(th, td) {
    border-width: 0 var(--bs-border-width) var(--bs-border-width) 0 !important;
}

.table-sticky tr > :first-child {
    border-left-width: 0 !important;
}

.table-sticky tr > :last-child {
    border-right-width: 0 !important;
}

/* the table of a list fills the page, the shadow of a card would only frame the scroll area */
.table-sticky > .table {
    box-shadow: none !important;
}

/* a narrow column with a checkbox or an icon */
.table .col-icon {
    width: 1%;
    text-align: center;
    white-space: nowrap;
}

.table .col-number {
    text-align: right;
    white-space: nowrap;
}

/* ---------- filter panel ---------- */

.filter-panel {
    display: flex;
    flex: 0 0 var(--app-filter-width);
    flex-direction: column;
    width: var(--app-filter-width);
    border-left: var(--bs-border-width) solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
}

.filter-panel.is-collapsed {
    display: none;
}

.filter-panel-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
}

.filter-panel-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--bs-emphasis-color);
    font-weight: 600;
}

.filter-panel-reset {
    font-size: .8125rem;
}

.filter-panel-body {
    flex: 1 1 auto;
    padding: 1rem;
    overflow-y: auto;
}

.filter-panel-footer {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem 1rem;
    border-top: var(--bs-border-width) solid var(--bs-border-color);
}

.filter-field {
    min-width: 0;
    margin: 0 0 .875rem;
    padding: 0;
    border: 0;
}

.filter-field > .form-label,
.filter-field > legend {
    float: none;
    width: auto;
    margin-bottom: .25rem;
    padding: 0;
    color: var(--bs-secondary-color);
    font-family: var(--bs-font-monospace);
    font-size: .75rem;
    font-weight: 500;
}

.filter-field .input-group-text {
    justify-content: center;
    width: 2.75rem;
    color: var(--bs-secondary-color);
}

/* ---------- footer of a list: actions, pagination, page size ---------- */

.app-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 1rem;
    height: 52px;
    padding: 0 1.25rem;
    border-top: var(--bs-border-width) solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
}

.app-footer-start,
.app-footer-end {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: .75rem;
}

.app-footer-end {
    justify-content: flex-end;
}

.app-footer .pagination {
    --bs-pagination-padding-x: .625rem;
    --bs-pagination-padding-y: .25rem;
    --bs-pagination-font-size: .8125rem;
}

.app-footer .page-size {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    white-space: nowrap;
}

/* the selection of a list, e.g. jobs to run, with the action that appears with it */
.selection-action {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--bs-secondary-color);
    font-size: .8125rem;
}

.icon-link > .bi {
    transform: none;
}

/* a secondary button (.btn .btn-outline-secondary) for its colors and states, laid out like a search field: the text on
   the left, the key on the right */
.command-palette-trigger {
    --bs-btn-padding-y: .3rem;
    --bs-btn-padding-x: .75rem;
    --bs-btn-font-size: .875rem;
    --bs-btn-font-weight: 400;
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 13rem;
    padding-right: .4rem;
    text-align: left;
    white-space: nowrap;
}

.command-palette-trigger kbd {
    margin-left: auto;
}

/* in the sidebar, below the brand: as wide as the navigation */
.sidebar-command-palette {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    margin-top: .5rem;
}

.command-palette-trigger kbd,
.command-palette kbd {
    display: inline-block;
    min-width: 1.4em;
    padding: .1rem .35rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-sm);
    background-color: var(--bs-body-bg);
    box-shadow: inset 0 -1px 0 var(--bs-border-color);
    color: var(--bs-secondary-color);
    font-family: var(--bs-font-sans-serif);
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

.command-palette {
    width: min(620px, calc(100vw - 2rem));
    max-height: min(600px, calc(100vh - 12vh - 2rem));
    margin: 12vh auto auto;
    padding: 0;
    overflow: hidden;
    border: var(--bs-border-width) solid var(--bs-border-color-translucent);
    border-radius: .75rem;
    background-color: var(--bs-body-bg);
    box-shadow: 0 1.5rem 3rem -.75rem rgba(var(--bs-black-rgb), .35), 0 0 0 1px rgba(var(--bs-black-rgb), .04);
    color: var(--bs-body-color);
}

/* only opacity and transform are animated, the dialog is displayed and focusable from the first frame */
.command-palette[open] {
    display: flex;
    animation: command-palette-in .14s cubic-bezier(.2, .9, .3, 1);
}

.command-palette::backdrop {
    background-color: rgba(var(--bs-black-rgb), .3);
    backdrop-filter: blur(2px);
    animation: command-palette-backdrop-in .14s ease-out;
}

@keyframes command-palette-in {
    from {
        opacity: 0;
        transform: translateY(-.5rem) scale(.98);
    }
}

@keyframes command-palette-backdrop-in {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .command-palette[open],
    .command-palette::backdrop {
        animation: none;
    }
}

.command-palette-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.command-palette-search {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
    color: var(--bs-secondary-color);
}

.command-palette-search > .bi {
    font-size: 1.125rem;
}

/* the key Esc as a button: only its key is visible, it is pressed on hover */
.command-palette-close {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: none;
    line-height: 1;
    cursor: pointer;
}

.command-palette-close kbd {
    transition: color .15s ease-in-out, border-color .15s ease-in-out, background-color .15s ease-in-out;
}

.command-palette-close:hover kbd,
.command-palette-close:focus-visible kbd {
    border-color: color-mix(in srgb, var(--bs-border-color) 65%, var(--bs-body-color));
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
}

.command-palette-close:focus-visible {
    border-radius: var(--bs-border-radius-sm);
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(var(--bs-secondary-rgb), .5);
}

.command-palette-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--bs-body-color);
    font-size: 1.125rem;
}

.command-palette-input::placeholder {
    color: var(--bs-tertiary-color);
}

.command-palette-options {
    flex: 1 1 auto;
    margin: 0;
    padding: .375rem .5rem .5rem;
    overflow-y: auto;
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
    list-style: none;
}

.command-palette-options:not(:has(> [role="option"]:not([hidden]))) {
    display: none;
}

.command-palette-group {
    padding: .625rem .75rem .25rem;
    color: var(--bs-tertiary-color);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.command-palette-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .375rem .75rem;
    border-radius: .5rem;
    cursor: pointer;
}

.command-palette-group[hidden],
.command-palette-option[hidden] {
    display: none;
}

.command-palette-option[aria-selected="true"] {
    background-color: var(--bs-tertiary-bg);
}

.command-palette-option[aria-selected="true"]::before {
    position: absolute;
    top: .5rem;
    bottom: .5rem;
    left: 0;
    width: 3px;
    border-radius: 3px;
    background-color: var(--bs-primary);
    content: "";
}

.command-palette-icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: .5rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-secondary-color);
}

.command-palette-option[aria-selected="true"] .command-palette-icon {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary);
    color: var(--bs-white);
}

.command-palette-title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 500;
}

.command-palette-syntax {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    gap: .375rem;
    min-width: 0;
    font-size: .8125rem;
}

.command-palette-syntax > code {
    padding: .125rem .4rem;
    border-radius: var(--bs-border-radius-sm);
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    font-size: inherit;
}

.command-palette-argument {
    overflow: hidden;
    max-width: 16rem;
    padding: .0625rem .4rem;
    border: var(--bs-border-width) dashed var(--bs-border-color);
    border-radius: var(--bs-border-radius-sm);
    color: var(--bs-tertiary-color);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-palette-argument.is-filled {
    border-style: solid;
    border-color: var(--bs-primary-border-subtle);
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-family: var(--bs-font-monospace);
}

.command-palette-footer {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: .625rem 1.25rem;
    background-color: var(--bs-tertiary-bg);
    font-size: .8125rem;
}

/* takes the remaining width in one line, the input shows a long argument completely */
.command-palette-status {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.command-palette-status > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-palette-status.is-error {
    color: var(--bs-danger-text-emphasis);
}

.command-palette-status.is-error > .bi {
    font-size: 1rem;
}

.command-palette-keys {
    display: flex;
    flex: 0 0 auto;
    gap: 1rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.command-palette-keys kbd + kbd {
    margin-left: .125rem;
}

.help {
    font-size: .875rem;
}

.help > p:first-child {
    font-size: 1rem;
}

.help h6 {
    margin: 1.5rem 0 .5rem;
    color: var(--bs-secondary-color);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.help dt {
    font-weight: 500;
}

.help code {
    padding: .0625rem .3rem;
    border-radius: var(--bs-border-radius-sm);
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

.help dd {
    margin-bottom: .75rem;
    color: var(--bs-secondary-color);
}

.help dd:last-child {
    margin-bottom: 0;
}

/* ---------- states of records, e.g. of jobs and situations ---------- */

.state-badge {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .0625rem .5rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: 1rem;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.state-badge::before {
    width: .4375rem;
    height: .4375rem;
    border-radius: 50%;
    background-color: currentColor;
    content: "";
}

.state-badge.is-success {
    border-color: var(--bs-success-border-subtle);
    background-color: var(--bs-success-bg-subtle);
    color: var(--bs-success-text-emphasis);
}

.state-badge.is-danger {
    border-color: var(--bs-danger-border-subtle);
    background-color: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
}

.state-badge.is-info {
    border-color: var(--bs-info-border-subtle);
    background-color: var(--bs-info-bg-subtle);
    color: var(--bs-info-text-emphasis);
}

.state-badge.is-warning {
    border-color: var(--bs-warning-border-subtle);
    background-color: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
}

/* a row that needs attention, e.g. a failed job, is marked at its start */
.table tr.is-danger > :first-child {
    box-shadow: inset 3px 0 0 var(--bs-danger);
}

.table tr.is-warning > :first-child {
    box-shadow: inset 3px 0 0 var(--bs-warning);
}

/* the details of a row, e.g. the error of a failed job */
.table tr.row-detail > td {
    background-color: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
    font-family: var(--bs-font-monospace);
    font-size: .8125rem;
    white-space: pre-wrap;
}

/* the progress along the bottom edge of the topbar */
.topbar-progress {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    --bs-progress-height: 3px;
    --bs-progress-bg: transparent;
    border-radius: 0;
}

.topbar-progress .progress {
    border-radius: 0;
}

/* the progress of an exploration in its row */
.progress-inline {
    --bs-progress-height: .375rem;
    min-width: 6rem;
}

/* ---------- properties of a record, label and value ---------- */

.table-properties {
    --bs-table-bg: transparent;
}

.table-properties > tbody > tr > th {
    width: 1%;
    padding-right: 1.5rem;
    color: var(--bs-secondary-color);
    font-family: var(--bs-font-monospace);
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.table-properties > tbody > tr:last-child > * {
    border-bottom: 0;
}

.table-events {
    --bs-table-bg: transparent;
}

.table-events > tbody > tr:last-child > * {
    border-bottom: 0;
}

/* the field names of a detail page are labels, quieter than their values */
.app-content-narrow .table > tbody > tr > th {
    color: var(--bs-secondary-color);
    font-family: var(--bs-font-monospace);
    font-size: .8125rem;
    font-weight: 500;
}

/* ---------- login ---------- */

.login {
    max-width: 380px;
    padding: 1rem;
}

.login-logo {
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 .25rem .75rem rgba(var(--bs-black-rgb), .12);
}

.login-title {
    margin-bottom: .25rem;
    color: var(--bs-emphasis-color);
    font-size: 1.375rem;
    font-weight: 600;
}

.login .form-label {
    font-weight: 500;
}

.state-badge.is-plain::before {
    content: none;
}

/* the QR code of a one-time password: dark on white also in the dark theme, scanners need the contrast */
.otp-qr-code {
    flex: 0 0 auto;
    padding: .5rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: #fff;
    line-height: 0;
}

.otp-qr-code svg {
    width: 180px;
    height: 180px;
}

/* ---------- dark theme ---------- */

[data-bs-theme="dark"] .card {
    box-shadow: none;
}

[data-bs-theme="dark"] .sidebar-logo,
[data-bs-theme="dark"] .login-logo {
    outline: var(--bs-border-width) solid var(--bs-border-color);
}

/* the chosen theme and the current page (e.g. the profile) in a menu: a tint like an active .btn-icon, the solid primary
   color of .dropdown-item.active is meant for white text */
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item.active:hover,
.dropdown-menu .dropdown-item.active:focus {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-weight: 500;
}

/* Combobox (combobox.js): a text field with a filterable list in the look of the dropdown */
.combobox {
    position: relative;
}

/* the field and the button look like one control: one border color, one focus ring */
.combobox .input-group {
    border-radius: var(--bs-border-radius);
    transition: box-shadow .15s ease-in-out;
}

.combobox .input-group:focus-within {
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
}

.combobox .input-group:has(.is-invalid):focus-within {
    box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25);
}

.combobox .form-control:focus {
    box-shadow: none;
}

.combobox-toggle {
    --bs-btn-color: var(--bs-secondary-color);
    --bs-btn-bg: var(--bs-body-bg);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-body-color);
    --bs-btn-hover-bg: var(--bs-tertiary-bg);
    --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-active-color: var(--bs-body-color);
    --bs-btn-active-bg: var(--bs-secondary-bg);
    --bs-btn-active-border-color: var(--bs-border-color);
    padding-inline: .875rem;
}

/* the focus border of .form-control ($input-focus-border-color: the primary color, half white) */
.combobox .input-group:focus-within .combobox-toggle {
    --bs-btn-border-color: color-mix(in srgb, var(--bs-primary) 50%, #fff);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--bs-primary) 50%, #fff);
}

.combobox .is-invalid + .combobox-toggle,
.combobox .input-group:focus-within .is-invalid + .combobox-toggle {
    --bs-btn-border-color: var(--bs-form-invalid-border-color);
    --bs-btn-hover-border-color: var(--bs-form-invalid-border-color);
}

.combobox-menu {
    --bs-dropdown-border-color: var(--bs-border-color);
    left: 0;
    width: 100%;
    max-height: 20rem;
    margin-top: .125rem;
    padding-top: 0;
    overflow-y: auto;
}

/* the header of the group stays on top while its time zones are scrolled */
.combobox-menu > li[role="presentation"] {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--bs-dropdown-bg);
}

.combobox-menu .dropdown-header {
    padding-top: .5rem;
}

.combobox-menu .dropdown-item {
    cursor: pointer;
}
