/*
 * A project's theme changes only these values, once for the light appearance (:root) and once for
 * the dark one ([data-bs-theme="dark"], after it), so every screen keeps the same contrast:
 *   --apollo-brand       white text on it, 4.5:1 or more
 *   --apollo-brand-ink   brand text on the surface, 7:1 or more (dark on light, light on dark)
 *   --apollo-brand-tint  the brand as "r g b", for the translucent layers
 *   --apollo-accent-soft soft brand background; --apollo-brand-ink and --apollo-ink on it 7:1 or more
 * Data text needs 7:1 and other text 4.5:1, on the lightest and the darkest point under the glass,
 * so the data sits on a solid sheet inside a glass frame. Everything else is neutral or a state colour.
 * Test-ApolloTheme.ps1 of the Apollo.Tools package measures the pairs of the base and of a project's theme in both appearances.
 */
:root {
    --apollo-brand: #3d5a80;
    --apollo-brand-ink: #1f3550;
    --apollo-brand-tint: 61 90 128;
    --apollo-accent-soft: #dfe8f3;

    /* The dark brand fill under white text: the section bars, the open tab, a pressed button. */
    --apollo-brand-strong: var(--apollo-brand-ink);
    --apollo-on-brand: #fff;
    --apollo-focus: var(--apollo-brand);
    --apollo-glass-bg:
        linear-gradient(180deg, rgb(255 255 255 / 0.55), rgb(255 255 255 / 0.30)),
        rgb(var(--apollo-brand-tint) / 0.06);
    --apollo-glass-edge: rgb(255 255 255 / 0.75);
    --apollo-sheet-frame: rgb(255 255 255 / 0.45);
    /* A report's page is paper, white in both looks as the PDF it prints to: the dark one keeps these. */
    --apollo-paper: #fff;
    --apollo-paper-ink: #000;
    --apollo-shadow: 0 10px 30px rgb(var(--apollo-brand-tint) / 0.16), 0 1px 2px rgb(0 0 0 / 0.06);
    /* A surface that gives up its blur (an open dropdown, a panel), the panel over the page and the veil under it. */
    --apollo-glass-solid: rgb(255 255 255 / 0.95);
    --apollo-panel-shadow: 0 18px 40px rgb(0 0 0 / 0.18), inset 0 1px 0 #fff;
    --apollo-scrim: rgb(0 0 0 / 0.25);
    /* The floating message, under the top bar. */
    --apollo-toast-top: 76px;

    --apollo-ink: #16191d;
    --apollo-ink-2: #3b424b;
    --apollo-line: #d5d9de;
    --apollo-line-soft: #e6e9ec;
    --apollo-control-line: #868f9a;
    --apollo-surface: #ffffff;
    --apollo-ok: #124f2a;
    --apollo-ok-bg: #e3f2e8;
    --apollo-warn: #5f3a00;
    --apollo-warn-bg: #fdf0d5;
    --apollo-err: #8a1f17;
    --apollo-err-bg: #fbe4e1;
    --apollo-off-bg: #eceef1;
    --apollo-radius-glass: 18px;
    --apollo-radius-sheet: 16px;
    --apollo-radius-section: 10px;
    --apollo-radius-control: 8px;
    --apollo-radius-pill: 999px;
    --apollo-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --apollo-text-xs: 11px;
    --apollo-text-sm: 12px;
    --apollo-text-md: 13px;
    --apollo-text-lg: 20px;
    --apollo-space-1: 2px;
    --apollo-space-2: 4px;
    --apollo-space-3: 6px;
    --apollo-space-4: 8px;
    --apollo-space-5: 10px;
    --apollo-space-6: 12px;
    --apollo-max-width: 1320px;
    /* The page's side margin and the frame of a sheet, which a sheet-wide inline row takes off the window. */
    --apollo-page-gutter: 16px;
    --apollo-sheet-border: 6px;
    /* The one space between the page's cards. */
    --apollo-gap: 10px;
    /* The most fields per line a screen this wide shows, whatever the descriptor's cols. */
    --apollo-cols-max: 8;
    /* A number's field in a form: about 14 digits. */
    --apollo-field-number: 9rem;
    /* The dense form's grid, which a child's table lines up with: the space between columns, the sheet's
       side padding, the label's least width and its share of the cell; the label's gap is --apollo-space-5. */
    --apollo-form-gap: 18px;
    --apollo-form-pad: 14px;
    --apollo-label-min: 96px;
    --apollo-label-share: 0.44;

    /* Bootstrap, from the tokens above. */
    --bs-primary: var(--apollo-brand);
    --bs-link-color: var(--apollo-brand-ink);
    --bs-link-hover-color: var(--apollo-ink);
    --bs-body-color: var(--apollo-ink);
    --bs-body-font-family: var(--apollo-font);
    --bs-body-font-size: var(--apollo-text-md);
    --bs-body-line-height: 1.45;
    --bs-secondary-color: var(--apollo-ink-2);
    --bs-border-color: var(--apollo-line);
    --bs-border-radius: var(--apollo-radius-control);
}

/* The dark appearance: Bootstrap's colour mode, which apollo-head.js turns on before the first paint
   when the user chose it. The same tokens with the dark values; a project's theme gives its four
   again, in a [data-bs-theme="dark"] block after its :root. */
[data-bs-theme="dark"] {
    --apollo-brand: #3d5a80;
    --apollo-brand-ink: #b9cde6;
    --apollo-brand-tint: 61 90 128;
    --apollo-accent-soft: #233246;

    --apollo-brand-strong: var(--apollo-brand);
    --apollo-focus: var(--apollo-brand-ink);
    --apollo-glass-bg:
        linear-gradient(180deg, rgb(255 255 255 / 0.09), rgb(255 255 255 / 0.04)),
        rgb(var(--apollo-brand-tint) / 0.10);
    --apollo-glass-edge: rgb(255 255 255 / 0.12);
    --apollo-sheet-frame: rgb(255 255 255 / 0.07);
    --apollo-shadow: 0 10px 30px rgb(0 0 0 / 0.40), 0 1px 2px rgb(0 0 0 / 0.30);
    --apollo-glass-solid: rgb(28 32 38 / 0.96);
    --apollo-panel-shadow: 0 18px 40px rgb(0 0 0 / 0.5), inset 0 1px 0 rgb(255 255 255 / 0.1);
    --apollo-scrim: rgb(0 0 0 / 0.5);

    --apollo-ink: #eceef1;
    --apollo-ink-2: #c0c6ce;
    --apollo-line: #3a4048;
    --apollo-line-soft: #2b3037;
    --apollo-control-line: #7f8894;
    --apollo-surface: #181b20;
    --apollo-ok: #8fdcab;
    --apollo-ok-bg: #143322;
    --apollo-warn: #f2c879;
    --apollo-warn-bg: #3a2b0f;
    --apollo-err: #ffa79c;
    --apollo-err-bg: #3e1a16;
    --apollo-off-bg: #262a30;

    --bs-body-bg: var(--apollo-surface);
    --bs-body-color: var(--apollo-ink);
    --bs-link-hover-color: #fff;
    --bs-secondary-bg: #20242a;
    --bs-tertiary-bg: #1d2126;
    --bs-emphasis-color: #fff;
    color-scheme: dark;
}

body.apollo {
    min-height: 100vh;
    color: var(--apollo-ink);
    accent-color: var(--apollo-brand);
    font-variant-numeric: tabular-nums;
    /* The brand fades from the top down, so the glass has something to blur. */
    background:
        linear-gradient(180deg, rgb(var(--apollo-brand-tint) / 0.32), transparent 55%),
        linear-gradient(180deg, #f3f1ef, #e9ecef);
    background-attachment: fixed;
}

.apollo-wrap {
    max-width: var(--apollo-max-width);
    margin: 0 auto;
    padding: 0 var(--apollo-page-gutter);
}

/* The change animates only after the first paint (apollo-ready), so a saved preference does not
   slide in on load. */
.apollo-wide .apollo-wrap {
    max-width: 100vw;
}

.apollo-ready .apollo-wrap {
    transition: max-width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    .apollo-ready .apollo-wrap {
        transition: none;
    }
}

/* Glass: frosted, tinted, with a light edge on top. */
.apollo-glass {
    background: var(--apollo-glass-bg);
    border: 1px solid var(--apollo-glass-edge);
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 0.95),
        inset 0 -1px 0 rgb(255 255 255 / 0.35),
        inset 0 0 18px rgb(255 255 255 / 0.25),
        var(--apollo-shadow);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
}

/* A backdrop-filter inside another one blurs nothing: while a dropdown is open inside a glass
   surface (the menu, "Mais"), the surface gives up its own blur so the dropdown's works. */
.apollo-glass:has(.dropdown-menu.show) {
    background: var(--apollo-glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .apollo-glass {
        background: var(--apollo-glass-solid);
    }
}


/* Plain links take the brand ink; :where keeps Bootstrap's components (buttons, menus, pages)
   in charge of their own colours. */
:where(body.apollo) a:where(:not([class])) {
    color: var(--apollo-brand-ink);
}

/* Focus: 3px of solid brand, 3:1 or more on white and on the glass in both palettes. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.page-link:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--apollo-focus);
    outline-offset: 2px;
    box-shadow: none;
}

/* The fields, the checkboxes and Tom Select take the same solid ring, never Bootstrap's blue at 25 %;
   the close button takes the links' outline. */
.apollo .form-control:focus,
.apollo .form-select:focus,
.apollo .ts-wrapper.focus .ts-control {
    border-color: var(--apollo-control-line);
    box-shadow: 0 0 0 3px var(--apollo-focus);
}

.apollo .btn-close:focus {
    box-shadow: none;
}

.apollo .btn-close:focus-visible {
    outline: 3px solid var(--apollo-focus);
    outline-offset: 2px;
    opacity: 1;
}

/* Top bar: menu on the left, the site and the user on the right, as in the current products. */
.apollo-topbar {
    position: sticky;
    top: var(--apollo-gap);
    z-index: 1020;
    margin-top: var(--apollo-gap);
    padding: var(--apollo-space-3) var(--apollo-space-4);
    gap: var(--apollo-space-2);
    border-radius: var(--apollo-radius-glass);
    flex-wrap: wrap;
}

.apollo-brand {
    display: flex;
    align-items: center;
    gap: var(--apollo-space-4);
    padding: 0 var(--apollo-space-5) 0 var(--apollo-space-2);
    color: var(--apollo-brand-ink);
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.apollo-mark {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--apollo-brand);
    color: var(--apollo-on-brand);
}

.apollo-menu {
    gap: var(--apollo-space-1);
}

.apollo-menu .nav-link {
    padding: 7px var(--apollo-space-6);
    border-radius: var(--apollo-radius-pill);
    color: var(--apollo-ink);
    font-weight: 550;
}

.apollo-menu .nav-link:hover,
.apollo-menu .nav-link.show {
    background: rgb(var(--apollo-brand-tint) / 0.12);
    color: var(--apollo-brand-ink);
}

/* The current group: the brand fill and aria-current, never the colour alone. */
.apollo-menu .nav-link[aria-current] {
    background: var(--apollo-brand);
    color: var(--apollo-on-brand);
}

/* The gap keeps the list off the group's button, and off the list a submenu opens from. */
.apollo-menu .dropdown-menu {
    --bs-dropdown-spacer: var(--apollo-gap);
    min-width: 240px;
}

/* The margin keeps the highlight off the lines between the entries. */
.apollo-menu .dropdown-item {
    margin: var(--apollo-space-1) 0;
    padding: 7px var(--apollo-space-5);
    border-radius: 8px;
}

/* The open page: the pale brand, bold and a brand bar, never the colour alone. */
.apollo-menu .dropdown-item[aria-current] {
    background: var(--apollo-accent-soft);
    color: var(--apollo-brand-ink);
    font-weight: 650;
    box-shadow: inset 3px 0 0 var(--apollo-brand);
}

/* A soft line in the menu's colour between the entries, so each one stands apart. */
.apollo-menu .dropdown-menu > li + li {
    border-top: 1px solid rgb(var(--apollo-brand-tint) / 0.22);
}

.apollo-menu .dropdown-header {
    padding: var(--apollo-space-4) var(--apollo-space-5) var(--apollo-space-2);
    font-size: var(--apollo-text-xs);
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* A group that opens to the side (data-apollo-submenu): a line with an arrow, and its list beside the
   menu, level with the line, past the menu's padding and the gap. */
.apollo-menu .apollo-submenu {
    position: relative;
}

.apollo-menu .apollo-submenu > .dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--apollo-space-4);
}

.apollo-submenu-arrow {
    margin-left: auto;
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-xs);
}

.apollo-menu .apollo-submenu > .dropdown-item[aria-expanded="true"] {
    background: var(--apollo-accent-soft);
    color: var(--apollo-brand-ink);
}

.apollo-menu .apollo-submenu > .dropdown-menu {
    position: absolute;
    top: calc(-1 * var(--apollo-menu-padding) - 1px);
    left: calc(100% + var(--apollo-menu-padding) + var(--bs-dropdown-spacer));
    margin: 0;
}

/* The gap belongs to the list, so the pointer crossing it stays over the group. */
.apollo-menu .apollo-submenu > .dropdown-menu::before {
    content: "";
    position: absolute;
    top: 0;
    right: 100%;
    bottom: 0;
    width: calc(var(--apollo-menu-padding) + var(--bs-dropdown-spacer) + 1px);
}

.apollo-who {
    display: flex;
    align-items: center;
    gap: var(--apollo-space-5);
    margin-left: auto;
    color: var(--apollo-ink-2);
    white-space: nowrap;
}

.apollo-who b {
    color: var(--apollo-ink);
    font-weight: 600;
}

.apollo-pill {
    padding: 5px 11px;
    border: 1px solid var(--apollo-line);
    border-radius: var(--apollo-radius-pill);
    background: rgb(255 255 255 / 0.7);
    color: var(--apollo-ink);
}

/* The language pill opens the list of languages when the application offers more than one. */
button.apollo-pill {
    font: inherit;
    cursor: pointer;
}

.apollo-icon-button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--apollo-ink-2);
    text-decoration: none;
}

.apollo-icon-button[aria-pressed="true"] {
    background: rgb(var(--apollo-brand-tint) / 0.16);
    color: var(--apollo-brand-ink);
}

/* The appearance button shows the sun in the light one and the moon in the dark one. */
[data-apollo-theme-toggle] .bi-moon-stars,
[data-bs-theme="dark"] [data-apollo-theme-toggle] .bi-sun {
    display: none;
}

[data-bs-theme="dark"] [data-apollo-theme-toggle] .bi-moon-stars {
    display: inline;
}

.apollo-icon-button:hover {
    background: rgb(var(--apollo-brand-tint) / 0.12);
    color: var(--apollo-ink);
}

/* Page header: breadcrumb and title on the left; system date, user and client logo on the right. */
.apollo-pagehead {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: var(--apollo-gap) 0;
    padding: var(--apollo-space-4) 16px;
    border-radius: var(--apollo-radius-glass);
}

.apollo-pagehead .breadcrumb {
    --bs-breadcrumb-divider-color: var(--apollo-ink-2);
    --bs-breadcrumb-item-active-color: var(--apollo-ink-2);
    margin-bottom: 0;
    font-size: var(--apollo-text-sm);
}

.apollo-pagehead .breadcrumb a {
    color: var(--apollo-brand-ink);
}

.apollo-pagehead h1 {
    margin: 0;
    padding-left: var(--apollo-space-5);
    border-left: 3px solid var(--apollo-brand);
    font-size: var(--apollo-text-lg);
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.apollo-pagehead-meta {
    margin-left: auto;
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-sm);
    line-height: 1.4;
    text-align: right;
}

.apollo-pagehead-meta b {
    color: var(--apollo-ink);
    font-weight: 600;
}

.apollo-client-logo:empty {
    display: none;
}

/* The bar has the glass radius, never a capsule, because it wraps to a second line on narrower
   screens. Below 768px the .apollo-secondary actions move to the .apollo-more menu. */
.apollo-toolbar {
    /* Above the content that follows, so its dropdowns open over the data. */
    position: relative;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--apollo-space-3);
    margin: 0 0 var(--apollo-gap);
    padding: var(--apollo-space-3);
    border-radius: var(--apollo-radius-glass);
}

/* A form in the bar (a select and its button, or one button that posts) sits in the line. */
.apollo-toolbar form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--apollo-space-3);
}

.apollo-toolbar-end {
    display: flex;
    flex-wrap: wrap;
    gap: var(--apollo-space-3);
    margin-left: auto;
}

.apollo-more {
    display: none;
}

/* The "Mais" menu is Bootstrap's dropdown (dropdown-menu-end): Popper keeps it on the screen,
   and Esc or a click outside closes it. */
.apollo-toolbar .dropdown-menu,
.apollo-menu .dropdown-menu {
    --bs-dropdown-bg: var(--apollo-glass-solid);
    --bs-dropdown-border-color: var(--apollo-brand);
    --bs-dropdown-border-radius: 14px;
    --bs-dropdown-font-size: var(--apollo-text-md);
    --bs-dropdown-link-color: var(--apollo-ink);
    --bs-dropdown-link-hover-color: var(--apollo-brand-ink);
    --bs-dropdown-link-hover-bg: var(--apollo-accent-soft);
    --bs-dropdown-link-active-color: var(--apollo-on-brand);
    --bs-dropdown-link-active-bg: var(--apollo-brand);
    --bs-dropdown-header-color: var(--apollo-ink-2);
    --apollo-menu-padding: var(--apollo-space-4);
    padding: var(--apollo-menu-padding);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
}

.apollo-toolbar .dropdown-item {
    padding: 7px var(--apollo-space-5);
    border-radius: 8px;
}

.apollo-toolbar .dropdown-item.apollo-danger {
    color: var(--apollo-err);
}

.apollo-separator {
    width: 1px;
    height: 22px;
    margin: 0 var(--apollo-space-2);
    background: var(--apollo-line);
}

.apollo .btn {
    --bs-btn-padding-x: 14px;
    --bs-btn-padding-y: var(--apollo-space-3);
    --bs-btn-font-size: var(--apollo-text-md);
    --bs-btn-font-weight: 550;
    --bs-btn-border-radius: var(--apollo-radius-pill);
    display: inline-flex;
    align-items: center;
    gap: var(--apollo-space-3);
    white-space: nowrap;
}

/* One small size for every button of the base, as Bootstrap's own .btn-sm, which .apollo .btn overrides. */
.apollo .btn-sm {
    --bs-btn-padding-x: var(--apollo-space-6);
    --bs-btn-padding-y: 3px;
    --bs-btn-font-size: var(--apollo-text-sm);
}

/* The secondary button: the brand's outline and ink. */
.apollo .btn-light {
    --bs-btn-bg: rgb(255 255 255 / 0.75);
    --bs-btn-border-color: var(--apollo-brand);
    --bs-btn-color: var(--apollo-brand-ink);
    --bs-btn-hover-bg: var(--apollo-surface);
    --bs-btn-hover-border-color: var(--apollo-brand);
    --bs-btn-hover-color: var(--apollo-brand-ink);
    --bs-btn-active-bg: var(--apollo-surface);
    --bs-btn-active-border-color: var(--apollo-brand);
    --bs-btn-active-color: var(--apollo-brand-ink);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

.apollo .btn-light.apollo-danger {
    --bs-btn-border-color: var(--apollo-err);
    --bs-btn-color: var(--apollo-err);
    --bs-btn-hover-border-color: var(--apollo-err);
    --bs-btn-hover-color: var(--apollo-err);
    --bs-btn-active-border-color: var(--apollo-err);
    --bs-btn-active-color: var(--apollo-err);
}

.apollo .btn-primary {
    --bs-btn-bg: var(--apollo-brand);
    --bs-btn-border-color: var(--apollo-brand);
    --bs-btn-hover-bg: var(--apollo-brand-strong);
    --bs-btn-hover-border-color: var(--apollo-brand-strong);
    --bs-btn-active-bg: var(--apollo-brand-strong);
    --bs-btn-active-border-color: var(--apollo-brand-strong);
}

/* Search panel: opens and closes like "Pesquisar" in the current products. */
.apollo-search {
    margin: 0 0 var(--apollo-gap);
    padding: var(--apollo-space-2) var(--apollo-space-3);
    border-radius: var(--apollo-radius-glass);
}

.apollo-search summary {
    display: flex;
    align-items: center;
    gap: var(--apollo-space-4);
    padding: var(--apollo-space-4) var(--apollo-space-5);
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.apollo-search summary::-webkit-details-marker {
    display: none;
}

.apollo-search summary::before {
    content: "\F282"; /* bi-chevron-down */
    font-family: "bootstrap-icons";
    font-size: var(--apollo-text-xs);
    transform: rotate(-90deg);
}

.apollo-search[open] summary::before {
    transform: none;
}

.apollo-search-count {
    color: var(--apollo-ink-2);
    font-weight: 500;
}

/* The shared views' list (D15): one bar with the search, its arrow and the count of filters on the
   left and the export and New on the right, which go under them on a narrow screen; open, the fields
   under the bar and Clear and Search at the foot. */
.apollo-search-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--apollo-space-4);
    padding: var(--apollo-space-3) var(--apollo-space-4);
}

/* The whole bar opens and closes its block (apollo.js). */
[data-apollo-toggle-area] {
    cursor: pointer;
}

.apollo-search-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--apollo-space-3);
    padding: var(--apollo-space-1) var(--apollo-space-2);
    border: 0;
    background: none;
    color: inherit;
    font-weight: 600;
}

.apollo-search-arrow {
    font-size: var(--apollo-text-xs);
}

.apollo-search-toggle[aria-expanded="true"] .apollo-search-arrow {
    transform: rotate(180deg);
}

.apollo-search-actions {
    display: flex;
    gap: var(--apollo-space-3);
    margin-left: auto;
}

.apollo-search-filters {
    padding: 1px var(--apollo-space-4);
    border-radius: var(--apollo-radius-pill);
    background: var(--apollo-accent-soft);
    color: var(--apollo-brand-ink);
    font-size: var(--apollo-text-sm);
    font-weight: 600;
}


.apollo-search-bar .apollo-search-fields {
    margin: 0 var(--apollo-space-5);
    padding: var(--apollo-space-5) 0 var(--apollo-space-2);
    border-top: 1px solid var(--apollo-line-soft);
}

.apollo-search-foot {
    display: flex;
    justify-content: flex-end;
    gap: var(--apollo-space-4);
    padding: var(--apollo-space-3) var(--apollo-space-5) var(--apollo-space-5);
}

/* In a child's tab, under the parent's sections: a lower bar. */
.apollo-search-compact .apollo-search-head {
    padding: var(--apollo-space-1) var(--apollo-space-3);
    font-size: var(--apollo-text-md);
}

.apollo-search .form-label {
    color: var(--apollo-ink);
}

.apollo-search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: var(--apollo-space-5) 14px;
    align-items: end;
    padding: var(--apollo-space-2) var(--apollo-space-5) var(--apollo-space-6);
}

/* A list's search with the descriptor's cols. */
.apollo-search-fields[class*="apollo-cols-"] {
    grid-template-columns: repeat(min(var(--apollo-cols), var(--apollo-cols-max)), minmax(0, 1fr));
}

/* Fields */
.apollo .form-label {
    margin-bottom: var(--apollo-space-2);
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-sm);
    font-weight: 600;
}

.apollo .form-control,
.apollo .form-select {
    padding-top: var(--apollo-space-3);
    padding-bottom: var(--apollo-space-3);
    padding-left: var(--apollo-space-5);
    border-color: var(--apollo-control-line);
    border-radius: var(--apollo-radius-control);
    color: var(--apollo-ink);
    font-size: var(--apollo-text-md);
}

.apollo .form-check-label {
    margin-left: 0.25rem;
}

/* A 20px box in the brand, pale when empty, that draws its own tick and dash in the on-brand colour, so both
   follow the theme in the two aspects; Bootstrap's images are fixed colours. */
.apollo .form-check-input {
    position: relative;
    display: inline-grid;
    place-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0;
    vertical-align: middle;
    border: 1.5px solid var(--apollo-brand);
    border-radius: calc(var(--apollo-radius-control) * 0.75);
    background-color: var(--apollo-accent-soft);
    background-image: none;
    transition: background-color 0.12s, border-color 0.12s;
}

.apollo .form-check-input::before {
    content: "";
    width: 0.8rem;
    height: 0.8rem;
    background: var(--apollo-on-brand);
    clip-path: polygon(14% 52%, 4% 62%, 38% 94%, 96% 24%, 86% 14%, 37% 74%);
    transform: scale(0);
    transition: transform 0.12s;
}

/* At least 24 x 24 px of clicks (WCAG 2.2, 2.5.8), also for a box with no label beside it. */
.apollo .form-check-input::after {
    content: "";
    position: absolute;
    inset: -3px;
}

.apollo .form-check-input:checked,
.apollo .form-check-input:indeterminate {
    border-color: var(--apollo-brand);
    background-color: var(--apollo-brand);
    background-image: none;
}

.apollo .form-check-input:checked::before {
    transform: scale(1);
}

.apollo .form-check-input:indeterminate::before {
    height: 0.18rem;
    border-radius: 1px;
    clip-path: none;
    transform: scale(1);
}

/* Focus keeps the size, the border and the place: a thin ring outside, past a gap of the surface, so it never
   reads as a larger box and pushes nothing. */
.apollo .form-check-input:focus {
    border-color: var(--apollo-brand);
    box-shadow: 0 0 0 2px var(--apollo-surface), 0 0 0 4px var(--apollo-focus);
}

/* A form's yes or no is a switch (Bootstrap's form-switch, 36 x 20 px), in a child's grid too; the box stays where many sit together
   or one can be mixed. The knob takes the control line when off and the on-brand colour when on, drawn here
   because Bootstrap's knob is an image in a fixed colour. */
.apollo-grid .form-check-input,
:where(.apollo-child-grid) .apollo-table .form-check-input {
    width: 2.25rem;
    border-color: var(--apollo-control-line);
    border-radius: var(--apollo-radius-pill);
    background-color: var(--apollo-surface);
    place-content: center start;
}

.apollo-grid .form-check-input::before,
:where(.apollo-child-grid) .apollo-table .form-check-input::before {
    width: 0.875rem;
    height: 0.875rem;
    margin-left: 0.125rem;
    border-radius: 50%;
    background: var(--apollo-control-line);
    clip-path: none;
    transform: none;
    transition: translate 0.12s, background-color 0.12s;
}

.apollo-grid .form-check-input:checked::before,
:where(.apollo-child-grid) .apollo-table .form-check-input:checked::before {
    background: var(--apollo-on-brand);
    translate: 1rem 0;
}

.apollo-grid .form-check-input:focus:not(:checked):not(.is-invalid),
:where(.apollo-child-grid) .apollo-table .form-check-input:focus:not(:checked):not(.is-invalid) {
    border-color: var(--apollo-control-line);
}

@media (prefers-reduced-motion: reduce) {
    .apollo .form-check-input,
    .apollo .form-check-input::before {
        transition: none;
    }
}

/* Tom Select draws its own box with Bootstrap's light line: it takes the fields' line, 3:1 or more. */
.apollo .ts-control {
    border-color: var(--apollo-control-line);
}

/* A field the server refused keeps Bootstrap's red border, which the line colour above would hide. */
.apollo .form-control.is-invalid,
.apollo .form-select.is-invalid,
.apollo .form-check-input.is-invalid {
    border-color: var(--bs-form-invalid-border-color);
}

.apollo-toolbar .form-select {
    width: auto;
    border-radius: var(--apollo-radius-pill);
}

/* Data: a solid sheet inside a glass frame. */
.apollo-sheet {
    background: var(--apollo-surface);
    background-clip: padding-box;
    border: var(--apollo-sheet-border) solid var(--apollo-sheet-frame);
    border-radius: var(--apollo-radius-sheet);
    box-shadow: inset 0 0 0 1px var(--apollo-line), var(--apollo-shadow);
    /* The content keeps to the rounded corners. A select or a date picker opens outside the page
       and is not cut; a Bootstrap dropdown would be, so it goes in the toolbar, not in a sheet. */
    overflow: hidden;
}

.apollo-table-wrap {
    overflow: auto;
}

.apollo-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.apollo-table th,
.apollo-table td {
    padding: var(--apollo-space-3) var(--apollo-space-5);
    border-bottom: 1px solid var(--apollo-line-soft);
    text-align: left;
    white-space: nowrap;
}

.apollo-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--apollo-accent-soft);
    color: var(--apollo-brand-ink);
    font-size: var(--apollo-text-sm);
    font-weight: 650;
}

.apollo-table thead tr.apollo-group th {
    border-bottom: 1px solid var(--apollo-surface);
    text-align: left;
}

.apollo-table thead tr.apollo-group th.apollo-num {
    text-align: right;
}

/* A thin vertical line between the column groups, in the header and in the rows. */
.apollo-table th.apollo-g,
.apollo-table td.apollo-g {
    border-left: 1px solid var(--apollo-line);
}

.apollo-table tbody tr:hover td {
    background: var(--apollo-accent-soft);
}

.apollo-table .apollo-num {
    text-align: right;
}

/* A child's grid (D13): dense rows of fields. The cells align to the top, so a field's error, one line
   under it, never moves a field out of its row (D15). */
.apollo-child-grid .apollo-table td {
    padding-top: 3px;
    padding-bottom: 3px;
    vertical-align: top;
}

.apollo-child-grid .apollo-table .form-control,
.apollo-child-grid .apollo-table .form-select {
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: var(--apollo-space-1) var(--apollo-space-4);
    font-size: inherit;
}

/* A switch in the middle of a field's height, level with the fields beside it, without making the row taller. */
.apollo-child-grid .apollo-table .form-check-input {
    margin-block: calc((1.5em + 2 * var(--apollo-space-1) + 2px - 1.25rem) / 2);
}

/* The list's arrow keeps Bootstrap's room on the right, as on the form. */
.apollo-child-grid .apollo-table .form-select {
    padding-right: 2.25rem;
}

.apollo-child-grid .apollo-table .form-control.is-invalid,
.apollo-child-grid .apollo-table .form-select.is-invalid {
    padding-right: var(--apollo-space-4);
    background-image: none;
}

.apollo-child-grid .apollo-table .invalid-feedback {
    display: block;
    margin: 0;
    overflow: hidden;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The table's column titles, which each cell repeats where the row turns into a form. */
.apollo-child-grid .apollo-table td > .form-label {
    display: none;
}

/* A child's table takes the whole sheet and lays its columns on the screen's grid (apollo-cols-N, the
   parent's first section), measured on the sheet (cqi): the remove button in the label column, where the
   record forms have it, and each long field where a form column's fields start. A short field (apollo-short:
   a box, a number, a date, a plain list, a short text) keeps its column as narrow as the field or its title. */
.apollo-child-grid {
    container-type: inline-size;
}

.apollo-child-grid .apollo-table {
    --apollo-cols-shown: min(var(--apollo-cols, 4), var(--apollo-cols-max));
    --apollo-child-pitch: calc((100cqi - 2 * var(--apollo-form-pad) - (var(--apollo-cols-shown) - 1) * var(--apollo-form-gap)) / var(--apollo-cols-shown));
    --apollo-child-label: max(var(--apollo-label-min), var(--apollo-child-pitch) * var(--apollo-label-share));
    --apollo-child-field: calc(var(--apollo-child-pitch) - var(--apollo-child-label) - var(--apollo-space-5));
}

.apollo-child-grid .apollo-table th,
.apollo-child-grid .apollo-table td {
    width: 1%;
    padding-right: var(--apollo-form-gap);
    padding-left: 0;
}

/* A long field followed by another long one reaches at least the next form column: its title spans the
   field's cell and an empty spacer cell, which takes the room left, so every row of the column keeps the
   same width. */
.apollo-child-grid .apollo-table th:not(.apollo-short, .apollo-row-actions):has(~ th:not(.apollo-short)) {
    min-width: calc(var(--apollo-child-pitch) + var(--apollo-form-gap));
}

.apollo-child-grid .apollo-table td.apollo-spacer {
    width: 0;
    padding: 0;
}

/* With no button, the first field still starts at the form's field column. */
.apollo-child-grid .apollo-table:not(:has(.apollo-row-actions)) :is(th, td):first-child {
    padding-left: calc(var(--apollo-form-pad) + var(--apollo-child-label) + var(--apollo-space-5));
}

.apollo-child-grid .apollo-table th:last-child,
.apollo-child-grid .apollo-table td:last-child {
    width: auto;
}

/* A title starts where its field starts, a number's too. */
.apollo-child-grid .apollo-table th.apollo-num {
    text-align: left;
}

/* The remove button opens the row in the form's label column. */
.apollo-child-grid .apollo-table .apollo-row-actions {
    width: calc(var(--apollo-form-pad) + var(--apollo-child-label) + var(--apollo-space-5));
    padding-right: 0;
    padding-left: var(--apollo-form-pad);
    text-align: left;
}

.apollo-child-grid .apollo-table .form-control[type="number"],
.apollo-child-grid .apollo-table .form-control[inputmode="decimal"] {
    width: var(--apollo-field-number);
    text-align: right;
}

/* A long field is at least as wide as the form's field column and grows with the longest value of its
   column, up to one form column, so no value is cut (field-sizing; an older browser, before Firefox 152, keeps
   the field column's width). */
.apollo-child-grid .apollo-table td:not(.apollo-short) :is(.form-control, .form-select) {
    width: 100%;
    min-width: var(--apollo-child-field);
    max-width: var(--apollo-child-pitch);
    field-sizing: content;
}

/* As many long fields as the form shows columns on this screen: the row no longer fits, so each row
   turns into a form on the same grid, as the record children are. A child with its cols written, as the
   migrated ones, stays a table, as the Artemis drew it, and its long fields share the line. A browser without
   style queries (before Firefox 151) leaves the table to scroll sideways. */
@media (min-width: 1400px) {
    .apollo-child-grid .apollo-table.apollo-cols-1:has(th:not(.apollo-short, .apollo-row-actions)),
    .apollo-child-grid .apollo-table.apollo-cols-2:has(th:not(.apollo-short, .apollo-row-actions) ~ th:not(.apollo-short)),
    .apollo-child-grid .apollo-table.apollo-cols-3:has(th:not(.apollo-short, .apollo-row-actions) ~ th:not(.apollo-short) ~ th:not(.apollo-short)),
    .apollo-child-grid .apollo-table.apollo-cols-4:has(th:not(.apollo-short, .apollo-row-actions) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short)),
    .apollo-child-grid .apollo-table.apollo-cols-5:has(th:not(.apollo-short, .apollo-row-actions) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short)),
    .apollo-child-grid .apollo-table.apollo-cols-6:has(th:not(.apollo-short, .apollo-row-actions) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short)),
    .apollo-child-grid .apollo-table.apollo-cols-7:has(th:not(.apollo-short, .apollo-row-actions) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short)),
    .apollo-child-grid .apollo-table.apollo-cols-8:has(th:not(.apollo-short, .apollo-row-actions) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short) ~ th:not(.apollo-short)) {
        --apollo-child-rows: overflow;
    }
}

@media (max-width: 1399.98px) and (min-width: 992px) {
    .apollo-child-grid .apollo-table.apollo-cols-1:has(th:not(.apollo-short, .apollo-row-actions)),
    .apollo-child-grid .apollo-table.apollo-cols-2:has(th:not(.apollo-short, .apollo-row-actions) ~ th:not(.apollo-short)),
    .apollo-child-grid .apollo-table:is(.apollo-cols-3, .apollo-cols-4, .apollo-cols-5, .apollo-cols-6, .apollo-cols-7, .apollo-cols-8):has(th:not(.apollo-short, .apollo-row-actions) ~ th:not(.apollo-short) ~ th:not(.apollo-short)) {
        --apollo-child-rows: overflow;
    }
}

@media (max-width: 991.98px) and (min-width: 576px) {
    .apollo-child-grid .apollo-table.apollo-cols-1:has(th:not(.apollo-short, .apollo-row-actions)),
    .apollo-child-grid .apollo-table:is(.apollo-cols-2, .apollo-cols-3, .apollo-cols-4, .apollo-cols-5, .apollo-cols-6, .apollo-cols-7, .apollo-cols-8):has(th:not(.apollo-short, .apollo-row-actions) ~ th:not(.apollo-short)) {
        --apollo-child-rows: overflow;
    }
}

@container style(--apollo-child-rows: overflow) {
    /* A table that keeps its rows: the long fields share the line. */
    .apollo-child-grid .apollo-table.apollo-keep-table th:not(.apollo-short, .apollo-row-actions):has(~ th:not(.apollo-short)) {
        min-width: 0;
    }

    .apollo-child-grid .apollo-table.apollo-keep-table :is(th, td):not(.apollo-short, .apollo-row-actions, .apollo-spacer) {
        width: auto;
    }

    .apollo-child-grid .apollo-table.apollo-keep-table td:not(.apollo-short) :is(.form-control, .form-select) {
        min-width: 0;
        max-width: none;
    }

    /* Any other table turns each row into a form on the same grid. */
    .apollo-child-grid .apollo-table:not(.apollo-keep-table) thead,
    .apollo-child-grid .apollo-table:not(.apollo-keep-table) td.apollo-spacer {
        display: none;
    }

    .apollo-child-grid .apollo-table:not(.apollo-keep-table) tbody {
        display: block;
    }

    .apollo-child-grid .apollo-table:not(.apollo-keep-table) tr {
        display: grid;
        position: relative;
        grid-template-columns: repeat(var(--apollo-cols-shown), minmax(0, 1fr));
        gap: var(--apollo-space-3) var(--apollo-form-gap);
        padding: var(--apollo-space-5) var(--apollo-form-pad);
        border-bottom: 1px solid var(--apollo-line-soft);
    }

    .apollo-child-grid .apollo-table:not(.apollo-keep-table) td,
    .apollo-child-grid .apollo-table:not(.apollo-keep-table) td:last-child {
        display: grid;
        grid-template-columns: minmax(var(--apollo-label-min), calc(var(--apollo-label-share) * 100%)) minmax(0, 1fr);
        align-items: center;
        gap: var(--apollo-space-1) var(--apollo-space-5);
        width: auto;
        padding: 0;
        border: 0;
        white-space: normal;
    }

    .apollo-child-grid .apollo-table:not(.apollo-keep-table) td > .form-label {
        display: block;
        margin: 0;
        text-align: right;
    }

    .apollo-child-grid .apollo-table:not(.apollo-keep-table) td.apollo-row-actions + td > .form-label {
        padding-left: 36px;
    }

    .apollo-child-grid .apollo-table:not(.apollo-keep-table) .apollo-row-actions {
        display: block;
        position: absolute;
        top: 8px;
        left: var(--apollo-form-pad);
        padding: 0;
    }
}

/* The list's popup has no form around it: each column as wide as its values or its title, the last one
   with the rest. */
@media (min-width: 576px) {
    .modal-body > .apollo-child-grid .apollo-table :is(th, td),
    .modal-body > .apollo-child-grid .apollo-table:not(:has(.apollo-row-actions)) :is(th, td):first-child {
        padding: var(--apollo-space-3) calc(2 * var(--apollo-form-pad)) var(--apollo-space-3) var(--apollo-form-pad);
    }

    .modal-body > .apollo-child-grid .apollo-table th.apollo-num {
        text-align: right;
    }
}

/* A child wider than one line: each row is a form on the parent's grid. The remove button sits in the
   free space on the left of the first label, as the Artemis' actions column. */
.apollo-child-record {
    position: relative;
    border-bottom: 1px solid var(--apollo-line-soft);
}

.apollo-child-record > .apollo-row-actions {
    position: absolute;
    top: 8px;
    left: var(--apollo-form-pad);
}

.apollo-child-record .apollo-grid > div:first-child .form-label {
    padding-left: 36px;
}

.apollo-child-foot {
    display: flex;
    gap: var(--apollo-space-4);
    align-items: center;
    padding: var(--apollo-space-4) var(--apollo-space-6);
    border-top: 1px solid var(--apollo-line-soft);
}

/* An Inline list (the Artemis' Inline): the edit and the delete open each row; the row being edited has the
   pale brand of a chosen row and its fields aligned to the top, so an error under one keeps the others in line. */
.apollo-inline .apollo-table .apollo-row-actions {
    width: 1%;
    padding-top: 3px;
    padding-bottom: 3px;
    white-space: nowrap;
}

.apollo-inline .apollo-row-actions form {
    display: inline;
}

.apollo-inline .apollo-row-actions .btn {
    padding: 2px 7px;
}

.apollo-inline .apollo-table tr.apollo-editing > td {
    padding-top: 3px;
    padding-bottom: 3px;
    background: var(--apollo-accent-soft);
    vertical-align: top;
}

.apollo-inline .apollo-table tr.apollo-editing .form-control,
.apollo-inline .apollo-table tr.apollo-editing .form-select {
    min-width: 7rem;
    min-height: 0;
    padding: var(--apollo-space-1) var(--apollo-space-4);
    font-size: inherit;
}

.apollo-inline .apollo-table tr.apollo-editing .form-control.is-invalid,
.apollo-inline .apollo-table tr.apollo-editing .form-select.is-invalid {
    padding-right: var(--apollo-space-4);
    background-image: none;
}

.apollo-inline .apollo-table .invalid-feedback {
    display: block;
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
}

/* The column's title, which a narrow screen shows above each field. */
.apollo-inline .apollo-table td > .form-label {
    display: none;
}

.apollo-table td.apollo-open {
    width: 34px;
}

.apollo-table td a {
    color: var(--apollo-brand-ink);
    font-weight: 600;
    text-decoration: none;
}

.apollo-table td a:hover {
    text-decoration: underline;
}

.apollo-table td.apollo-open a {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: var(--apollo-radius-control);
    color: var(--apollo-ink-2);
}

/* The ring keeps the icon's highlight apart from the row's, which has the same pale brand. */
.apollo-table td.apollo-open a:hover {
    background: var(--apollo-accent-soft);
    box-shadow: inset 0 0 0 1px var(--apollo-brand);
    color: var(--apollo-brand);
}

/* A header the list sorts by: a link with the arrow of the order applied (D14). */
.apollo-table th a.apollo-sort {
    display: inline-flex;
    align-items: center;
    gap: var(--apollo-space-2);
    color: inherit;
    white-space: nowrap;
    text-decoration: none;
}

.apollo-table th a.apollo-sort:hover {
    text-decoration: underline;
}

.apollo-table th a.apollo-sort .bi {
    font-size: 0.75em;
}

/* The one row of an empty list. */
.apollo-no-rows,
.apollo-table td.apollo-no-rows {
    margin: 0;
    padding: 28px var(--apollo-space-6);
    color: var(--apollo-ink-2);
    text-align: center;
}

.apollo-table td.apollo-no-rows a {
    margin-left: var(--apollo-space-3);
}

/* States: a word with a dot on a pale background; the word carries the meaning. */
.apollo-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px var(--apollo-space-4);
    border-radius: var(--apollo-radius-pill);
    font-size: var(--apollo-text-sm);
    font-weight: 600;
    vertical-align: middle;
}

.apollo-tag::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.apollo-tag-ok { color: var(--apollo-ok); background: var(--apollo-ok-bg); }
.apollo-tag-warn { color: var(--apollo-warn); background: var(--apollo-warn-bg); }
.apollo-tag-err { color: var(--apollo-err); background: var(--apollo-err-bg); }
.apollo-tag-off { color: var(--apollo-ink-2); background: var(--apollo-off-bg); }

.apollo-sheet-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--apollo-space-4);
    padding: var(--apollo-space-4) var(--apollo-space-5);
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-sm);
}

/* Pagination in capsules (Bootstrap's markup). */
.apollo .pagination {
    --bs-pagination-padding-x: 0;
    --bs-pagination-padding-y: 0;
    --bs-pagination-font-size: var(--apollo-text-md);
    --bs-pagination-color: var(--apollo-ink);
    --bs-pagination-border-color: var(--apollo-line);
    --bs-pagination-hover-color: var(--apollo-ink);
    --bs-pagination-active-bg: var(--apollo-brand);
    --bs-pagination-active-border-color: var(--apollo-brand);
    --bs-pagination-disabled-color: var(--apollo-ink-2);
    gap: var(--apollo-space-2);
    margin: 0;
}

.apollo .pagination .page-link {
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    margin-left: 0;
    border-radius: var(--apollo-radius-pill);
}

/* Form: sections with a title bar and a grid of fields. */
.apollo-section {
    margin-bottom: var(--apollo-gap);
}

.apollo-section > h2 {
    margin: 0;
    padding: 9px 14px;
    border-radius: var(--apollo-radius-section) var(--apollo-radius-section) 0 0;
    background: var(--apollo-brand-strong);
    color: var(--apollo-on-brand);
    font-size: var(--apollo-text-sm);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.apollo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--apollo-space-6) 22px;
    margin: 0;
    padding: 14px;
}

.apollo-grid .apollo-wide {
    grid-column: 1 / -1;
}

.apollo-readonly {
    padding: var(--apollo-space-3) 0;
    font-weight: 500;
}

/* Read-only data: the label small, upper case and muted; the value larger and strong. */
.apollo-dl {
    gap: 0;
    padding: 0;
}

.apollo-dl > div {
    padding: 9px 14px var(--apollo-space-5);
    border-right: 1px solid var(--apollo-off-bg);
    border-bottom: 1px solid var(--apollo-off-bg);
}

.apollo-dl > div:nth-child(3n) {
    border-right: 0;
}

.apollo-dl dt {
    margin: 0 0 var(--apollo-space-1);
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.apollo-dl dd {
    margin: 0;
    color: var(--apollo-ink);
    font-size: 14px;
    font-weight: 600;
}

/* The fields per line of the search and of each section, as the Artemis' cols. */
.apollo-cols-1 { --apollo-cols: 1; }
.apollo-cols-2 { --apollo-cols: 2; }
.apollo-cols-3 { --apollo-cols: 3; }
.apollo-cols-4 { --apollo-cols: 4; }
.apollo-cols-5 { --apollo-cols: 5; }
.apollo-cols-6 { --apollo-cols: 6; }
.apollo-cols-7 { --apollo-cols: 7; }
.apollo-cols-8 { --apollo-cols: 8; }

/* Dense grid, close to the current products' screens: four columns without cols, fewer on a narrow
   screen. The label takes 44 % of the cell, so a label like "Número do documento" fits on one line at
   1440px; a wide field's label has exactly the same width, so every field of a column starts on the same
   line. */
.apollo-grid.apollo-dense {
    --apollo-cols-shown: min(var(--apollo-cols, 4), var(--apollo-cols-max));
    grid-template-columns: repeat(var(--apollo-cols-shown), minmax(0, 1fr));
    gap: var(--apollo-space-3) var(--apollo-form-gap);
    padding: var(--apollo-space-5) var(--apollo-form-pad);
    --apollo-wide-label: calc((100% - (var(--apollo-cols-shown) - 1) * var(--apollo-form-gap)) * var(--apollo-label-share) / var(--apollo-cols-shown));
}

/* The rows start at the top, so a field keeps its place in the line when an error shows under it or
   under its neighbour. The field's column may shrink below its content (a lookup's box), so it never
   pushes the label. */
.apollo-grid.apollo-dense > div {
    display: grid;
    grid-template-columns: minmax(var(--apollo-label-min), calc(var(--apollo-label-share) * 100%)) minmax(0, 1fr);
    align-content: start;
    align-items: center;
    gap: var(--apollo-space-1) var(--apollo-space-5);
}

.apollo-grid.apollo-dense > .apollo-wide {
    grid-template-columns: minmax(var(--apollo-label-min), var(--apollo-wide-label)) minmax(0, 1fr);
}

/* The server's error under its field, in the value's column. */
.apollo-grid.apollo-dense .invalid-feedback {
    grid-column: 2;
    margin-top: 0;
}

.apollo-grid.apollo-dense .form-label {
    margin: 0;
    text-align: right;
}

.apollo-grid.apollo-dense .form-control,
.apollo-grid.apollo-dense .form-select {
    padding-top: var(--apollo-space-2);
    padding-bottom: var(--apollo-space-2);
    padding-left: var(--apollo-space-4);
}

.apollo-grid.apollo-dense .apollo-readonly {
    padding: var(--apollo-space-2) 0;
}

/* A box in the middle of a field's height, level with the fields beside it. */
.apollo-grid.apollo-dense .form-check-input {
    margin-block: calc((1.5 * var(--apollo-text-md) + 2 * var(--apollo-space-2) + 2px - 1.25rem) / 2);
}

/* Each field of a form as wide as what it holds, from its type and its length, never past its column; a
   text with no limit, a lookup and a list that searches keep the whole column. A plain list is as wide as
   its longest value. The field is a grid item, which stretches unless it starts at the left. */
.apollo-grid select.form-select:not([data-apollo-lookup]):not([data-apollo-search]),
.apollo-grid .form-control[size],
.apollo-grid .form-control[type="date"],
.apollo-grid .form-control[type="datetime-local"],
.apollo-grid .form-control[type="time"] {
    justify-self: start;
    width: auto;
    max-width: 100%;
}

/* A number on the right, as in a list's column. */
.apollo-grid .form-control[type="number"],
.apollo-grid .form-control[inputmode="decimal"] {
    justify-self: start;
    width: var(--apollo-field-number);
    max-width: 100%;
    text-align: right;
}

/* Each column is a label and a value sized to their content, the same in every row (subgrid): a
   value grows sideways while the row has room and wraps only when it has none. Each cell draws its
   left border and the list hides the first column's, so the borders follow any number of columns. */
.apollo-dl.apollo-dense {
    grid-template-columns: repeat(var(--apollo-cols-shown), max-content auto);
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.apollo-dl.apollo-dense > div {
    display: grid;
    grid-column: span 2;
    grid-template-columns: subgrid;
    align-items: baseline;
    gap: 0;
    margin-left: -1px;
    padding: var(--apollo-space-3) var(--apollo-space-6);
    border-right: 0;
    border-left: 1px solid var(--apollo-off-bg);
}

/* Read-only view only: a short bar between the label and the value, like the separator of the
   action bar. The forms have none, their read-only fields included. */
.apollo-dl.apollo-dense dt {
    position: relative;
    margin: 0 var(--apollo-space-5) 0 0;
    padding-right: var(--apollo-space-5);
    font-size: var(--apollo-text-sm);
    font-weight: 500;
    letter-spacing: 0;
    text-align: right;
    text-transform: none;
}

.apollo-dl.apollo-dense dt::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 1px;
    height: 14px;
    transform: translateY(-50%);
    background: var(--apollo-line);
}

/* A value never crosses its cell's border: a long code breaks inside it. */
.apollo-dl.apollo-dense dd {
    min-width: 0;
    font-size: var(--apollo-text-md);
    overflow-wrap: anywhere;
}

.apollo-dl dd.apollo-empty {
    color: var(--apollo-ink-2);
    font-weight: 400;
}

@media (max-width: 1399.98px) {
    :root {
        --apollo-cols-max: 3;
    }
}

.apollo-audit {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: var(--apollo-space-5);
    padding: var(--apollo-space-2) var(--apollo-space-3) 0;
    color: var(--apollo-ink);
    font-size: var(--apollo-text-sm);
}

.apollo-audit b {
    color: var(--apollo-ink);
    font-weight: 600;
}

/* Children in tabs (Bootstrap's nav-pills and tab panes). */
.apollo-tabs {
    width: max-content;
    max-width: 100%;
    margin: 0 0 var(--apollo-gap);
    padding: var(--apollo-space-3);
    border-radius: var(--apollo-radius-pill);
    overflow-x: auto;
    flex-wrap: nowrap;
}

.apollo-tabs .nav-link {
    padding: var(--apollo-space-3) 14px;
    border-radius: var(--apollo-radius-pill);
    color: var(--apollo-ink-2);
    font-weight: 550;
    white-space: nowrap;
}

.apollo-tabs .nav-link.active,
.apollo-tabs .nav-link.active .apollo-search-count {
    background: var(--apollo-brand-strong);
    color: var(--apollo-on-brand);
}

.apollo-tabs .nav-link.active {
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

.apollo-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--apollo-space-4);
    margin: var(--apollo-gap) 0 16px;
    padding: var(--apollo-space-5) 16px;
    border-radius: var(--apollo-radius-glass);
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-sm);
}

.apollo-footer a {
    color: var(--apollo-ink-2);
}

/* Loading. Everything that waits shows only after 150ms, so a quick answer never flashes.
     .apollo-load       a part loaded after the page (Html.ApolloLoad), or that failed to load
     .apollo-busy       a part being reloaded: its data stays under a "A carregar…" chip, faded
                        below AAA on purpose while it is no longer the current data
     [aria-busy] .btn   a button that saves (data-apollo-busy), locked until the answer arrives
     .apollo-progress   the thin bar at the top of the window while the page changes */
.apollo-spinner {
    --bs-spinner-width: 1em;
    --bs-spinner-height: 1em;
    --bs-spinner-border-width: 0.15em;
    flex: none;
    color: var(--apollo-brand);
    vertical-align: -0.15em;
}

.btn-primary .apollo-spinner {
    color: var(--apollo-on-brand);
}

/* Bootstrap fades a disabled button to 65%; a busy one keeps its colours and contrast. */
.btn[aria-busy="true"] {
    --bs-btn-disabled-opacity: 1;
    --bs-btn-disabled-bg: var(--bs-btn-bg);
    --bs-btn-disabled-border-color: var(--bs-btn-border-color);
    --bs-btn-disabled-color: var(--bs-btn-color);
    cursor: progress;
}

.apollo-load {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--apollo-space-5) 14px;
    min-height: 120px;
    padding: 14px;
    color: var(--apollo-ink-2);
    font-weight: 500;
}

.apollo-load > .apollo-spinner {
    font-size: 18px;
}

.apollo-load-failed {
    color: var(--apollo-err);
    font-weight: 550;
}

.apollo-busy {
    position: relative;
}

.apollo-busy > :not(.apollo-busy-chip) {
    opacity: 0.45;
    transition: opacity 0.15s 0.15s;
}

.apollo-busy-chip {
    position: absolute;
    top: 10px;
    left: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: var(--apollo-space-4);
    padding: 5px var(--apollo-space-6);
    transform: translateX(-50%);
    border: 1px solid var(--apollo-line);
    border-radius: var(--apollo-radius-pill);
    background: var(--apollo-surface);
    box-shadow: 0 4px 14px rgb(var(--apollo-brand-tint) / 0.18);
    color: var(--apollo-ink);
    font-weight: 550;
    animation: apollo-appear 0s 0.15s both;
}

.apollo-progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1090;
    display: none;
    height: 3px;
    overflow: hidden;
    pointer-events: none;
}

.apollo-progress::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 40%;
    border-radius: 0 3px 3px 0;
    background: var(--apollo-brand);
    box-shadow: 0 0 6px rgb(var(--apollo-brand-tint) / 0.55);
    animation: apollo-progress 1.4s ease-in-out infinite;
}

.apollo-navigating .apollo-progress {
    display: block;
    animation: apollo-appear 0s 0.15s both;
}

@keyframes apollo-appear {
    from {
        visibility: hidden;
    }
}

@keyframes apollo-progress {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(250%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .apollo-progress::before {
        width: 100%;
        animation: none;
    }
}

@media (max-width: 767.98px) {
    /* A workflow action's form goes with its button, so it leaves no gap in the toolbar. */
    .apollo-toolbar .apollo-secondary,
    .apollo-toolbar form:has(> .apollo-secondary) {
        display: none;
    }

    .apollo-toolbar .apollo-more {
        display: block;
    }

    /* Nothing to move: no "Mais". */
    .apollo-toolbar:not(:has(.apollo-secondary)) .apollo-more {
        display: none;
    }
}

/* A list on the left and the selected item on the right (the roles of the menu editor). The
   list folds to a narrow strip with its toggle. */
.apollo-split {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: var(--apollo-space-6);
    align-items: start;
}

.apollo-split-collapsed {
    grid-template-columns: 44px minmax(0, 1fr);
}

.apollo-split-collapsed .apollo-list-pane > :not(.apollo-list-toggle) {
    display: none;
}

.apollo-split-collapsed .apollo-list-toggle {
    height: 180px;
    padding: var(--apollo-space-6) var(--apollo-space-5);
    border: 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.apollo-split-collapsed .apollo-list-toggle .bi {
    display: none;
}

.apollo-list-toggle {
    width: 100%;
    padding: var(--apollo-space-4) var(--apollo-space-5);
    border: 0;
    border-bottom: 1px solid var(--apollo-line-soft);
    background: none;
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-sm);
    font-weight: 600;
    text-align: left;
}

.apollo-list-find {
    padding: var(--apollo-space-5);
    border-bottom: 1px solid var(--apollo-line-soft);
}

.apollo-list {
    max-height: 560px;
    margin: 0;
    padding: var(--apollo-space-2);
    overflow: auto;
    list-style: none;
}

.apollo-list a {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--apollo-space-1) var(--apollo-space-4);
    padding: var(--apollo-space-4) var(--apollo-space-5);
    border-radius: var(--apollo-radius-control);
    color: var(--apollo-ink);
    text-decoration: none;
}

.apollo-list a:hover {
    background: var(--apollo-off-bg);
}

.apollo-list a[aria-current] {
    background: var(--apollo-accent-soft);
    box-shadow: inset 3px 0 0 var(--apollo-brand);
}

.apollo-list-name {
    font-weight: 600;
}

.apollo-list-count {
    grid-row: 1 / 3;
    grid-column: 2;
    align-self: center;
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-sm);
}

.apollo-code {
    color: var(--apollo-ink-2);
    font: 12px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* A report of the SSRS (ReportController): the bar of its pages above the page, which scrolls inside the sheet. */
.apollo-report-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--apollo-space-3);
    padding: var(--apollo-space-2) var(--apollo-space-3);
    border-bottom: 1px solid var(--apollo-line);
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-sm);
}

/* A field of many values grows as the user picks: the labels stay on one line at the top. */
.apollo-report-parameters {
    align-items: start;
}

.apollo-report-bar form {
    display: flex;
    align-items: center;
    gap: var(--apollo-space-2);
}

.apollo-report-bar input[type="number"] {
    width: 4.5rem;
}

.apollo-report-scroll {
    overflow: auto;
    padding: var(--apollo-space-4);
    background: var(--apollo-sheet-frame);
}

/* The page keeps the report's own fonts and sizes, from the server's stylesheet. */
.apollo-report {
    width: max-content;
    margin: 0 auto;
    padding: var(--apollo-space-5);
    color: var(--apollo-paper-ink);
    background: var(--apollo-paper);
    box-shadow: var(--apollo-panel-shadow);
}

.apollo-report-list a {
    font-weight: 600;
}

/* The log screen: the message on one line in the list, and a text as written in the detail. */
.apollo-log-message {
    max-width: 48ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.apollo-pre {
    margin: var(--apollo-space-5) var(--apollo-space-6);
    padding: var(--apollo-space-5) var(--apollo-space-6);
    max-height: 420px;
    overflow: auto;
    border-radius: var(--apollo-radius-control);
    background: var(--apollo-off-bg);
    font: 12px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.apollo-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--apollo-space-2);
}

.apollo-chip {
    padding: 1px var(--apollo-space-4);
    border: 1px solid var(--apollo-line);
    border-radius: var(--apollo-radius-pill);
    background: var(--apollo-surface);
    font-size: var(--apollo-text-sm);
    font-weight: 550;
}

.apollo-chip-added {
    border-color: transparent;
    background: var(--apollo-ok-bg);
    color: var(--apollo-ok);
}

.apollo-chip-removed {
    border-color: transparent;
    background: var(--apollo-err-bg);
    color: var(--apollo-err);
    text-decoration: line-through;
}

/* A choice from a long list: a button that opens a panel with a search and the list, by group. */
.apollo-picker {
    position: relative;
}

.apollo-picker > summary {
    list-style: none;
}

.apollo-picker > summary::-webkit-details-marker {
    display: none;
}

.apollo-picker-panel {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    width: min(520px, 90vw);
    padding: var(--apollo-space-4);
    border-radius: var(--apollo-radius-glass);
    background: var(--apollo-glass-solid);
}

.apollo-list-group {
    padding: var(--apollo-space-4) var(--apollo-space-5) var(--apollo-space-1);
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* "View as": above the page while the mode lasts, in a colour no project theme uses; its text is the
   pair Test-ApolloTheme.ps1 measures for the warning, in both appearances. */
.apollo-viewas-bar {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: var(--apollo-space-6);
    padding: var(--apollo-space-4) 16px;
    background: var(--apollo-warn);
    color: var(--apollo-warn-bg);
    font-weight: 600;
}

.apollo-viewas-bar form {
    margin-left: auto;
}

/* Floats under the top bar, so nothing on the page moves. */
.apollo-toast {
    position: fixed;
    top: var(--apollo-toast-top);
    left: 50%;
    z-index: 1060;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--apollo-space-3) var(--apollo-space-5);
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: var(--apollo-space-5) 14px;
    border-radius: var(--apollo-radius-glass);
    background: var(--apollo-brand);
    color: var(--apollo-on-brand);
    box-shadow: var(--apollo-shadow);
    transform: translateX(-50%);
}

.apollo-toast > span {
    flex: 1 1 auto;
}

/* A message's link, such as a field to fix or the record to open again. */
.apollo-toast a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.apollo-toast-danger {
    background: var(--apollo-err-bg);
    color: var(--apollo-err);
    box-shadow: inset 0 0 0 1px var(--apollo-err), var(--apollo-shadow);
}

.apollo-toast-danger > span {
    flex-basis: calc(100% - 40px);
}

.apollo-toast[hidden] {
    display: none;
}

/* The server's messages before apollo.js moves them to the toast: in the same place, never above the
   page. */
[data-apollo-live] {
    position: fixed;
    top: var(--apollo-toast-top);
    left: 50%;
    z-index: 1060;
    width: max-content;
    max-width: calc(100vw - 32px);
    transform: translateX(-50%);
}

/* A short pop, on what the user touches or what shows on the spot: a box pressed (by the mouse or the
   space bar), a field taking the focus, a message. One class, for any screen; never with the page. */
@keyframes apollo-pop {
    from {
        transform: scale(0.88);
    }
}

@keyframes apollo-pop-in {
    from {
        opacity: 0;
        transform: translate(-50%, -8px) scale(0.96);
    }
}

.apollo-pop:active,
.apollo-pop:not([type="checkbox"]):focus {
    animation: apollo-pop 0.18s ease-out;
}

.apollo-toast.apollo-pop {
    animation: apollo-pop-in 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .apollo-pop:active,
    .apollo-pop:not([type="checkbox"]):focus,
    .apollo-toast.apollo-pop {
        animation: none;
    }
}

/* A button that opens a small form beside it (a new role); a second click closes it. */
.apollo-inline-form > summary {
    list-style: none;
}

.apollo-inline-form > summary::-webkit-details-marker {
    display: none;
}

.apollo-inline-form > form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--apollo-space-3);
}

.apollo-inline-form .form-control {
    width: 150px;
}

/* A matrix of boxes: rows grouped by module, operations in columns, the actions of each row on a
   line below it. A thicker line separates the rows. */
.apollo-matrix .apollo-matrix-op {
    width: 76px;
    text-align: center;
}

.apollo-matrix .apollo-matrix-all {
    border-right: 1px solid var(--apollo-line);
}

/* A thin line above each module's band, so two folded modules one after the other stay apart. */
.apollo-matrix .apollo-matrix-module th {
    position: static;
    border-top: 1px solid var(--apollo-line);
    background: var(--apollo-accent-soft);
    color: var(--apollo-brand-ink);
}

/* The header of a group of rows that folds them (data-apollo-fold), with the triangles of a <summary>. */
.apollo-fold {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
}

.apollo-fold::before {
    content: "\25BC";
    display: inline-block;
    width: 1.1em;
    font-size: 0.8em;
}

.apollo-fold[aria-expanded="false"]::before {
    content: "\25B6";
}

.apollo-matrix .apollo-matrix-name {
    min-width: 180px;
    white-space: normal;
}

.apollo-matrix .apollo-matrix-name .apollo-code {
    display: block;
}

.apollo-matrix .form-check-input {
    margin: 0;
}

.apollo-matrix tr:has(+ .apollo-matrix-actions) td {
    border-bottom: 0;
}

.apollo-matrix .apollo-matrix-actions td {
    padding-top: var(--apollo-space-4);
    padding-bottom: var(--apollo-space-4);
    border-top: 1px dashed var(--apollo-line);
    border-bottom: 2px solid var(--apollo-control-line);
    background: #fbfbfc;
}

.apollo-matrix-actions summary {
    width: max-content;
    margin-bottom: var(--apollo-space-3);
    color: var(--apollo-ink-2);
    font-weight: 600;
    cursor: pointer;
}

.apollo-matrix-actions-count {
    margin-left: var(--apollo-space-5);
    font-weight: 400;
}

.apollo-matrix-actions details[open] .apollo-matrix-actions-count {
    display: none;
}

.apollo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--apollo-space-3);
}

.apollo-action {
    display: inline-grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: var(--apollo-space-4);
    padding: 3px 9px;
    border: 1px solid var(--apollo-line);
    border-radius: var(--apollo-radius-control);
    background: var(--apollo-surface);
    line-height: 1.25;
    cursor: pointer;
}

.apollo-action:has(:checked) {
    border-color: #b7dcc4;
    background: var(--apollo-ok-bg);
}

.apollo-action > span {
    display: grid;
}

.apollo-action b {
    font-size: var(--apollo-text-sm);
    font-weight: 600;
}

.apollo-action .apollo-code {
    font-size: var(--apollo-text-xs);
}

/* An entity's workflows (D17): a block per type, side by side while they fit, one under the other on
   a narrow screen. The section keeps to the visible width of the matrix, which scrolls sideways on a
   narrow screen, so no block is left out of sight. The revert of a transition is dashed. */
.apollo-table-wrap:has(> .apollo-matrix) {
    container-type: inline-size;
}

.apollo-matrix-workflows {
    position: sticky;
    left: var(--apollo-space-4);
    max-width: calc(100cqi - 2 * var(--apollo-space-4));
    margin-top: var(--apollo-space-5);
}

.apollo-matrix-workflows-count {
    margin-left: var(--apollo-space-2);
    font-weight: 400;
}

.apollo-workflows {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: var(--apollo-space-5);
}

.apollo-workflow {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: var(--apollo-space-3);
    padding: var(--apollo-space-5) var(--apollo-space-6);
    border: 1px solid var(--apollo-line);
    border-radius: var(--apollo-radius-section);
    background: var(--apollo-surface);
}

.apollo-workflow-name {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--apollo-space-4);
    margin: 0;
}

.apollo-workflow-label {
    margin: var(--apollo-space-2) 0 0;
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.apollo-action-revert {
    border-style: dashed;
}

/* The catalog on the screen: a grip drags a row to another module; a pencil beside a name opens its
   fields in the line; a manual action that nobody uses has a cross; "+" opens a new action at the
   end of the line. */
.apollo-grip {
    margin-right: var(--apollo-space-2);
    color: var(--apollo-ink-2);
    cursor: grab;
}

/* SortableJS's classes: where the row will land, in the pale brand, and the copy under the mouse, the
   whole row on a solid sheet. A row taken out of the flow is no longer a table row, so its copy lays
   its cells out as a table again (access-center.js gives them their widths). */
.apollo-matrix .sortable-ghost > td {
    background: var(--apollo-accent-soft);
}

.apollo-matrix .sortable-fallback {
    display: table;
    background: var(--apollo-surface);
    box-shadow: 0 10px 30px rgb(var(--apollo-brand-tint) / 0.25), 0 0 0 1px var(--apollo-line);
    cursor: grabbing;
}

.apollo-inline-edit {
    display: inline-block;
    vertical-align: middle;
}

.apollo-inline-edit > summary.apollo-icon-button {
    display: inline-grid;
    width: 24px;
    height: 24px;
    opacity: 0.55;
}

.apollo-inline-edit > summary.apollo-icon-button:hover,
.apollo-inline-edit > summary.apollo-icon-button:focus-visible {
    opacity: 1;
}

.apollo-inline-form > span {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--apollo-space-3);
    align-items: center;
}

.apollo-inline-form > span .form-control,
.apollo-inline-form > span .form-select {
    width: 190px;
}

.apollo-action-new > summary.apollo-action {
    min-width: 34px;
    border-style: dashed;
    color: var(--apollo-brand-ink);
    font-size: 16px;
    font-weight: 600;
    place-items: center;
}

.apollo-action-delete {
    padding: 0 var(--apollo-space-1);
    border: 0;
    background: none;
    color: var(--apollo-ink-2);
}

.apollo-action-delete:hover {
    color: var(--apollo-err);
}

/* A box that cannot change keeps a lock beside it. */
[data-access-center-locked] {
    opacity: 0.45;
    cursor: not-allowed;
}

.apollo-lock {
    margin-left: var(--apollo-space-2);
    color: var(--apollo-ink-2);
}

.apollo-footnote {
    margin: var(--apollo-space-3) var(--apollo-space-6) var(--apollo-space-5);
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-xs);
}

.apollo-mark-yes {
    color: var(--apollo-ok);
    font-weight: 700;
}

.apollo-mark-no {
    color: var(--apollo-ink-2);
}

/* Below lg: the menu opens as a panel, grids take two columns, minor columns hide. */
@media (max-width: 991.98px) {
    /* The page already takes the whole width. */
    [data-apollo-wide-toggle] {
        display: none;
    }

    /* The list goes above the item, full width; a wide item scrolls inside its own sheet and never
       widens the page. Folded, the toggle lies flat. */
    .apollo-split,
    .apollo-split-collapsed {
        grid-template-columns: minmax(0, 1fr);
    }

    .apollo-split-collapsed .apollo-list-toggle {
        height: auto;
        writing-mode: horizontal-tb;
        transform: none;
    }

    .apollo-list {
        max-height: 220px;
    }

    /* The menu opens as a panel over the page, just below the top bar, without pushing the page:
       nearly opaque glass, a strong shadow, a darker page behind it and its own scroll. Groups
       open inside it, one below the other (Bootstrap's collapse and dropdowns underneath). */
    .apollo-topbar .navbar-collapse {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: 0;
        z-index: 1030;
        max-height: calc(100vh - 90px);
        padding: var(--apollo-space-4);
        overflow-y: auto;
        border: 1px solid var(--apollo-brand);
        border-radius: var(--apollo-radius-glass);
        background: var(--apollo-glass-solid);
        box-shadow: var(--apollo-panel-shadow);
        -webkit-backdrop-filter: blur(26px) saturate(180%);
        backdrop-filter: blur(26px) saturate(180%);
    }

    /* A backdrop-filter inside another one blurs nothing, so the bar gives up its own while the
       panel is open. */
    .apollo-topbar:has(#apollo-menu.show, #apollo-menu.collapsing) {
        background: var(--apollo-glass-solid);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    body.apollo:has(#apollo-menu.show, #apollo-menu.collapsing)::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1010;
        background: var(--apollo-scrim);
    }

    .apollo-menu {
        gap: var(--apollo-space-1);
    }

    .apollo-menu .nav-link {
        width: 100%;
        padding: var(--apollo-space-5) 14px;
        text-align: left;
    }

    .apollo-menu .dropdown-menu {
        padding: var(--apollo-space-1) var(--apollo-space-6) var(--apollo-space-3);
        border: 0;
        background: none;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    /* In the panel a submenu opens in place, below its line, and its arrow turns down. */
    .apollo-menu .apollo-submenu > .dropdown-menu {
        position: static;
        padding: 0 0 var(--apollo-space-2) 14px;
    }

    .apollo-menu .apollo-submenu > .dropdown-menu::before {
        content: none;
    }

    .apollo-menu .apollo-submenu > .dropdown-item[aria-expanded="true"] > .apollo-submenu-arrow {
        transform: rotate(90deg);
    }

    :root {
        --apollo-cols-max: 2;
    }

    .apollo-grid:not(.apollo-dense) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .apollo-dl:not(.apollo-dense) > div:nth-child(3n) {
        border-right: 1px solid var(--apollo-off-bg);
    }

    .apollo-dl:not(.apollo-dense) > div:nth-child(2n) {
        border-right: 0;
    }

    .apollo-pagehead-meta,
    .apollo-client-logo {
        display: none;
    }

    .apollo-hide-sm {
        display: none;
    }

    /* The row being edited turns into a form with every field, the hidden columns too, the width of the
       sheet: the row has none of its own, so the columns stay those of the other rows while the table
       scrolls sideways. Save and Cancel come last, on the right. */
    .apollo-inline .apollo-table tr.apollo-editing {
        display: flex;
        position: sticky;
        left: 0;
        flex-direction: column;
        width: 0;
        padding: var(--apollo-space-3) 0;
        background: var(--apollo-accent-soft);
    }

    .apollo-inline .apollo-table tr.apollo-editing > td,
    .apollo-inline .apollo-table tr.apollo-editing > td.apollo-hide-sm {
        display: block;
        flex: none;
        width: calc(100vw - 2 * (var(--apollo-page-gutter) + var(--apollo-sheet-border)));
        padding: 3px 14px;
        border-bottom: 0;
        text-align: left;
    }

    .apollo-inline .apollo-table tr.apollo-editing td > .form-label {
        display: block;
        margin: 0 0 2px;
        text-align: left;
    }

    .apollo-inline .apollo-table tr.apollo-editing > td.apollo-row-actions {
        order: 99;
        padding-top: var(--apollo-space-2);
        text-align: right;
    }
}

@media (max-width: 575.98px) {
    :root {
        --apollo-cols-max: 1;
    }

    .apollo-grid:not(.apollo-dense) {
        grid-template-columns: 1fr;
    }

    .apollo-dl:not(.apollo-dense) > div,
    .apollo-dl:not(.apollo-dense) > div:nth-child(n) {
        border-right: 0;
    }

    /* One column. In the forms the label goes back above the field; in the read-only view it
       stays on the left of the value, with the bar. */
    .apollo-grid.apollo-dense:not(.apollo-dl) > div {
        display: block;
    }

    /* The label on its own line, so a checkbox goes under it as any other field. */
    .apollo-grid.apollo-dense .form-label {
        display: block;
        margin: 0 0 var(--apollo-space-1);
        text-align: left;
    }

    /* A child's row as a form: the remove button goes to the right of the first label. */
    .apollo-child-record > .apollo-row-actions {
        top: 6px;
        right: 14px;
        left: auto;
    }

    .apollo-child-record .apollo-grid > div:first-child .form-label {
        padding-left: 0;
    }

    /* A child's table turns into the same form: one field under the other, each with its title. */
    .apollo-child-grid .apollo-table thead {
        display: none;
    }

    .apollo-child-grid .apollo-table,
    .apollo-child-grid .apollo-table tbody,
    .apollo-child-grid .apollo-table tr,
    .apollo-child-grid .apollo-table td {
        display: block;
    }

    .apollo-child-grid .apollo-table tr {
        position: relative;
        padding: var(--apollo-space-3) 0;
        border-bottom: 1px solid var(--apollo-line-soft);
    }

    .apollo-child-grid .apollo-table td,
    .apollo-child-grid .apollo-table:not(:has(.apollo-row-actions)) td:first-child {
        width: auto;
        padding: 3px 14px;
        border-bottom: 0;
        text-align: left;
        white-space: normal;
    }

    .apollo-child-grid .apollo-table td.apollo-spacer {
        display: none;
    }

    .apollo-child-grid .apollo-table td > .form-label {
        display: block;
    }

    /* The short fields keep their width, the others take the line. */
    .apollo-child-grid .apollo-table {
        --apollo-child-field: 100%;
    }

    .apollo-child-grid .apollo-table .apollo-row-actions {
        position: absolute;
        top: 6px;
        right: 14px;
        width: auto;
        padding: 0;
    }

}

/* The dark appearance of the surfaces that mix white or black into the page: the same layers, with
   the light taken out, so the glass stays glass and the data stays on a solid sheet. */
[data-bs-theme="dark"] body.apollo {
    background:
        linear-gradient(180deg, rgb(var(--apollo-brand-tint) / 0.42), transparent 55%),
        linear-gradient(180deg, #15181c, #0e1013);
    background-attachment: fixed;
}

[data-bs-theme="dark"] .apollo-glass {
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 0.16),
        inset 0 -1px 0 rgb(255 255 255 / 0.04),
        var(--apollo-shadow);
}

[data-bs-theme="dark"] .apollo-pill {
    background: rgb(255 255 255 / 0.06);
}

/* The outline takes the light brand ink, which the theme keeps 4.5:1 or more on the dark glass;
   the fill lightens under the pointer. */
[data-bs-theme="dark"] .apollo .btn-light {
    --bs-btn-bg: rgb(255 255 255 / 0.05);
    --bs-btn-hover-bg: rgb(255 255 255 / 0.10);
    --bs-btn-active-bg: rgb(255 255 255 / 0.12);
    --bs-btn-border-color: var(--apollo-brand-ink);
    --bs-btn-hover-border-color: var(--apollo-brand-ink);
    --bs-btn-active-border-color: var(--apollo-brand-ink);
    box-shadow: none;
}

/* The strong brand is the brand itself in the dark appearance, so under the pointer the button
   darkens, which only raises the white text's contrast. */
[data-bs-theme="dark"] .apollo .btn-primary {
    --bs-btn-hover-bg: color-mix(in srgb, var(--apollo-brand), #000 18%);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--apollo-brand), #000 18%);
    --bs-btn-active-bg: color-mix(in srgb, var(--apollo-brand), #000 18%);
    --bs-btn-active-border-color: color-mix(in srgb, var(--apollo-brand), #000 18%);
}

/* The fields a step darker than the sheet, so they read as places to write. */
[data-bs-theme="dark"] .apollo .form-control,
[data-bs-theme="dark"] .apollo .form-select {
    background-color: #111418;
}

/* The brand alone is under 3:1 on the dark surfaces: an empty box's line takes some of the brand's ink. */
[data-bs-theme="dark"] .apollo .form-check-input:not(:checked):not(:indeterminate):not(.is-invalid) {
    border-color: color-mix(in srgb, var(--apollo-brand) 70%, var(--apollo-brand-ink));
}

/* A switch that is off keeps the control line, 3:1 and more on the dark surfaces, on the fields' background. */
[data-bs-theme="dark"] .apollo-grid .form-check-input:not(:checked):not(:indeterminate):not(.is-invalid),
[data-bs-theme="dark"] :where(.apollo-child-grid) .apollo-table .form-check-input:not(:checked):not(:indeterminate):not(.is-invalid) {
    border-color: var(--apollo-control-line);
    background-color: #111418;
}

[data-bs-theme="dark"] .apollo-matrix .apollo-matrix-actions td {
    background: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .apollo-action:has(:checked) {
    border-color: var(--apollo-ok);
}

/* Last, so it wins over every surface above: no transparency at all. */
@media (prefers-reduced-transparency: reduce) {
    .apollo-glass,
    .apollo-topbar .navbar-collapse,
    .apollo-toolbar .dropdown-menu,
    .apollo-menu .dropdown-menu {
        --bs-dropdown-bg: var(--apollo-surface);
        background: var(--apollo-surface);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* The text sits on the band's solid part and the fade takes at least 96px, so no word stands on the
   light end. The fade has many eased stops, so it shows no steps. A logo with its own white
   background reads as part of the glass plate. */
.apollo-signin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    margin-top: var(--apollo-space-5);
}

.apollo-signin-band {
    display: flex;
    flex: 0 1 50%;
    min-height: 48px;
}

.apollo-signin-band::after {
    content: "";
    flex: 1 0 96px;
    background: linear-gradient(90deg,
        rgb(var(--apollo-brand-tint) / 1) 0%,
        rgb(var(--apollo-brand-tint) / 0.86) 14%,
        rgb(var(--apollo-brand-tint) / 0.66) 30%,
        rgb(var(--apollo-brand-tint) / 0.44) 48%,
        rgb(var(--apollo-brand-tint) / 0.24) 66%,
        rgb(var(--apollo-brand-tint) / 0.09) 84%,
        rgb(var(--apollo-brand-tint) / 0) 100%);
}

.apollo-signin-text {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--apollo-space-1) var(--apollo-space-6);
    padding: var(--apollo-space-4) var(--apollo-space-2) var(--apollo-space-4) var(--apollo-space-5);
    border-radius: var(--apollo-radius-glass) 0 0 var(--apollo-radius-glass);
    background: var(--apollo-brand);
    color: var(--apollo-on-brand);
}

.apollo-signin-name {
    display: flex;
    align-items: center;
    gap: var(--apollo-space-4);
    font-size: 17px;
    font-weight: 650;
    white-space: nowrap;
}

.apollo-signin-text .apollo-mark {
    background: #fff;
    color: var(--apollo-brand-ink);
}

.apollo-signin-site {
    white-space: nowrap;
}

.apollo-signin-site::before {
    content: "·";
    margin-right: var(--apollo-space-6);
}

.apollo-signin-language {
    padding: 0 7px;
    border: 1px solid rgb(255 255 255 / 0.6);
    border-radius: var(--apollo-radius-pill);
    font-size: var(--apollo-text-xs);
    font-weight: 600;
    line-height: 18px;
}

.apollo-signin-client {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    height: 64px;
    max-width: 264px;
    padding: var(--apollo-space-2) var(--apollo-space-6);
    border-radius: var(--apollo-radius-control);
}

.apollo-signin-client img {
    width: auto;
    height: auto;
    max-width: 240px;
    max-height: 56px;
    object-fit: contain;
}

/* A project sets its photograph with .apollo-signin-photo { background-image: url("...") } and the
   side of the box with --apollo-signin-justify (flex-start or flex-end) in its theme. */
.apollo-signin {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: var(--apollo-signin-justify, flex-start);
    min-height: max(520px, calc(100vh - 190px));
    margin-top: var(--apollo-space-6);
    padding: 32px;
    overflow: hidden;
    border-radius: var(--apollo-radius-glass);
}

.apollo-signin-photo {
    position: absolute;
    inset: 6px;
    border-radius: calc(var(--apollo-radius-glass) - 6px);
    background: url("signin.svg") center / cover no-repeat;
}

.apollo-signin-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgb(var(--apollo-brand-tint) / 0.28), rgb(var(--apollo-brand-tint) / 0.08));
}

.apollo-signin-box {
    position: relative;
    width: 100%;
    max-width: 380px;
    padding: var(--apollo-space-4);
    border-radius: var(--apollo-radius-glass);
}

.apollo-signin-box > .apollo-sheet {
    border-width: 0;
    border-radius: calc(var(--apollo-radius-glass) - 6px);
}

.apollo-signin-form {
    display: grid;
    gap: var(--apollo-space-6);
    padding: 20px;
}

.apollo-signin-form h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.apollo-signin-form .btn {
    width: 100%;
}

/* The one message of a failed sign-in, from the validation summary, without its list. */
.apollo-signin-form .alert {
    margin: 0;
    padding: var(--apollo-space-5) var(--apollo-space-6);
}

.apollo-signin-form .alert ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.apollo-signin-notice {
    margin: var(--apollo-space-6) var(--apollo-space-2) 0;
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-sm);
}

@media (max-width: 767.98px) {
    .apollo-signin-head {
        flex-direction: column;
        align-items: stretch;
        gap: var(--apollo-space-4);
    }

    .apollo-signin-band::after {
        content: none;
    }

    .apollo-signin-text {
        flex: 1;
        padding-right: var(--apollo-space-6);
        border-radius: var(--apollo-radius-glass);
    }

    .apollo-signin-client {
        align-self: center;
        height: 48px;
    }

    .apollo-signin-client img {
        max-width: 180px;
        max-height: 40px;
    }

    .apollo-signin {
        display: block;
        min-height: 0;
        padding: var(--apollo-space-3);
    }

    .apollo-signin-photo {
        position: relative;
        inset: auto;
        height: 160px;
    }

    .apollo-signin-box {
        max-width: none;
        margin-top: var(--apollo-space-3);
        padding: 0;
        background: none;
        border: 0;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* The menu editor (T1.22): the tree on a solid sheet beside the entry's fields, one column below lg.
   Nested lists hang from a dashed line; an entry that does not show is in grey. */
.apollo-menu-editor {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: var(--apollo-space-6);
    align-items: start;
}

.apollo-menu-pane {
    display: grid;
    gap: var(--apollo-space-5);
    min-width: 0;
    padding: var(--apollo-space-6);
    border-radius: var(--apollo-radius-glass);
}

.apollo-menu-pane-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--apollo-space-4);
}

.apollo-menu-pane h2 {
    margin: 0;
    font-size: 15px;
}

.apollo-menu-tree-sheet {
    padding: var(--apollo-space-3);
}

.apollo-menu-tree {
    display: grid;
    gap: var(--apollo-space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.apollo-menu-tree .apollo-menu-tree {
    margin: var(--apollo-space-1) 0 0 9px;
    padding-left: 18px;
    border-left: 1px dashed var(--apollo-line);
}

/* An empty group still takes a drop. */
.apollo-menu-tree .apollo-menu-tree:empty {
    min-height: 8px;
}

/* The tags go under the name when the line has no room for them. */
.apollo-menu-node {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--apollo-space-2) var(--apollo-space-4);
    padding: 5px var(--apollo-space-4);
    border-radius: var(--apollo-radius-control);
}

.apollo-menu-node:hover {
    background: var(--apollo-off-bg);
}

.apollo-menu-node.apollo-menu-selected {
    background: var(--apollo-accent-soft);
    box-shadow: inset 3px 0 0 var(--apollo-brand);
}

.apollo-menu-icon {
    color: var(--apollo-ink-2);
}

.apollo-menu-link {
    display: grid;
    flex: 1 1 150px;
    min-width: 0;
    color: var(--apollo-ink);
    text-decoration: none;
}

.apollo-menu-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.apollo-menu-link .apollo-code {
    overflow-wrap: anywhere;
}

.apollo-menu-off .apollo-menu-name {
    color: var(--apollo-ink-2);
    font-weight: 500;
}

.apollo-menu-tree mark {
    padding: 0 1px;
    border-radius: 3px;
    background: var(--apollo-accent-soft);
    color: var(--apollo-ink);
}

.apollo-menu-tree .sortable-ghost > .apollo-menu-node,
.apollo-menu-tree .sortable-ghost.apollo-menu-screen {
    outline: 1px dashed var(--apollo-brand);
    background: rgb(var(--apollo-brand-tint) / 0.06);
}

.apollo-menu-screens h2 {
    font-size: var(--apollo-text-md);
}

.apollo-menu-screen-list {
    display: grid;
    gap: var(--apollo-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Nothing left to place: a green bar, which also shows once the last screen is dragged to the tree. */
.apollo-menu-screen-list:not(:has(li)) {
    height: 12px;
    border-radius: var(--apollo-radius-control);
    background: var(--apollo-ok-bg);
}

.apollo-menu-screen-list li,
.apollo-menu-tree [data-menu-editor-screen] {
    display: flex;
    align-items: center;
    gap: var(--apollo-space-4);
    padding: var(--apollo-space-3) var(--apollo-space-5);
    border: 1px dashed var(--apollo-line);
    border-radius: var(--apollo-radius-control);
    background: var(--apollo-surface);
}

/* The actions of an entry, at the mouse; the dropdown look of Bootstrap without its script. */
.apollo-context-menu {
    position: fixed;
    z-index: 1080;
    display: block;
    min-width: 230px;
    font-size: var(--bs-body-font-size);
}

.apollo-context-menu[hidden] {
    display: none;
}

.apollo-context-menu .dropdown-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.apollo-context-menu kbd {
    padding: 0;
    background: none;
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-xs);
}

.apollo-menu-form {
    display: grid;
    gap: var(--apollo-space-5);
    padding: var(--apollo-space-6);
}

.apollo-menu-fields {
    display: grid;
    gap: var(--apollo-space-5);
}

.apollo-menu-field {
    display: grid;
    gap: var(--apollo-space-2);
}

.apollo-menu-field .form-label {
    margin: 0;
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-sm);
    font-weight: 600;
}

.apollo-menu-field .apollo-footnote {
    margin: 0;
}

.apollo-menu-proposed {
    color: var(--apollo-ok);
    font-size: var(--apollo-text-sm);
}

.apollo-menu-icon-pick {
    position: relative;
}

.apollo-menu-icon-button {
    display: flex;
    align-items: center;
    gap: var(--apollo-space-5);
    text-align: left;
}

.apollo-menu-icons {
    position: absolute;
    z-index: 15;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    display: grid;
    gap: var(--apollo-space-4);
    padding: var(--apollo-space-5);
    border: 1px solid var(--apollo-line);
    border-radius: 12px;
    background: var(--apollo-surface);
    box-shadow: var(--apollo-shadow);
}

.apollo-menu-icons[hidden] {
    display: none;
}

.apollo-menu-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: var(--apollo-space-2);
    max-height: 240px;
    overflow-y: auto;
}

.apollo-menu-icon-grid button {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-radius: var(--apollo-radius-control);
    background: none;
    color: var(--apollo-ink);
    font-size: 18px;
}

.apollo-menu-icon-grid button:hover,
.apollo-menu-icon-grid button:focus-visible {
    background: var(--apollo-accent-soft);
}

.apollo-menu-icon-grid button[hidden] {
    display: none;
}

/* The sheet keeps its corners; the icons open over what follows it. */
.apollo-menu-form:has(.apollo-menu-icons:not([hidden])) {
    overflow: visible;
}

.apollo-menu-who {
    display: grid;
    gap: var(--apollo-space-4);
    padding: var(--apollo-space-6);
}

.apollo-menu-who h3 {
    margin: 0;
    color: var(--apollo-ink-2);
    font-size: var(--apollo-text-sm);
    font-weight: 600;
}

.apollo-menu-who .apollo-footnote {
    margin: 0;
}

.apollo-menu-roles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--apollo-space-3);
}

.apollo-menu-role {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--apollo-space-4);
    padding: 7px var(--apollo-space-5);
    border: 1px solid var(--apollo-line);
    border-radius: var(--apollo-radius-control);
    background: var(--apollo-surface);
}

.apollo-menu-role-locked {
    background: var(--apollo-off-bg);
    color: var(--apollo-ink-2);
}

.apollo-menu-show-all {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--apollo-space-2) var(--apollo-space-6);
    font-weight: 600;
}

.apollo-menu-show-all .apollo-footnote {
    margin: 0;
    font-weight: 400;
}

@media (max-width: 991.98px) {
    .apollo-menu-editor {
        grid-template-columns: minmax(0, 1fr);
    }
}
