html[data-theme="light"],
html[data-theme="dark"],
:root {
    /* The brand tokens of EduFinance mapped onto the variables of the Django admin. Mixes go
       through oklab: oklch interpolation shifts the hue. html[data-theme="dark"] is listed too:
       dark_mode.css sets the Django variables on that selector, which outranks :root, so this
       mapping must match it; the dark tokens further down then replace the light ones. */
    --ef-radius: 0.5rem;
    --ef-radius-lg: 0.75rem;
    --ef-font-sans: "Figtree", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
    --ef-font-display: "Outfit", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
    --ef-brand: oklch(0.44 0.088 222);
    --ef-brand-soft: oklch(0.94 0.024 225);
    --ef-accent: oklch(0.76 0.135 72);
    --ef-accent-fg: oklch(0.26 0.05 60);
    --ef-chrome: oklch(0.26 0.036 247);
    --ef-chrome-raised: oklch(0.32 0.04 247);
    --ef-chrome-border: oklch(0.34 0.036 247);
    --ef-chrome-fg: oklch(0.9 0.014 240);
    --ef-surface: oklch(1 0 0);
    --ef-background: oklch(0.982 0.006 240);
    --ef-foreground: oklch(0.24 0.028 249);
    --ef-muted-fg: oklch(0.52 0.022 248);
    --ef-border: oklch(0.9 0.011 240);
    --ef-row-alt: oklch(0.975 0.007 240);
    --ef-row-hover: oklch(0.955 0.02 225);
    --ef-head-bg: oklch(0.94 0.012 240);
    --ef-on-brand: oklch(0.985 0.005 240);
    --ef-success: oklch(0.58 0.115 158);
    --ef-warning: oklch(0.79 0.14 78);
    --ef-destructive: oklch(0.56 0.19 25);
    --ef-info: oklch(0.6 0.1 240);
    --ef-shadow: 0 1px 2px oklch(0.24 0.028 249 / 6%), 0 8px 24px -16px oklch(0.24 0.028 249 / 18%);

    --primary: var(--ef-brand);
    --secondary: var(--ef-chrome);
    --accent: var(--ef-accent);
    --primary-fg: oklch(0.985 0.005 240);

    --body-fg: var(--ef-foreground);
    --body-bg: var(--ef-background);
    --body-quiet-color: var(--ef-muted-fg);
    --body-medium-color: oklch(0.32 0.03 245);
    --body-loud-color: oklch(0.18 0.03 249);

    --header-color: var(--ef-chrome-fg);
    --header-branding-color: var(--ef-accent);
    --header-bg: var(--ef-chrome);
    --header-link-color: oklch(0.97 0.008 240);

    --breadcrumbs-fg: var(--ef-muted-fg);
    --breadcrumbs-link-fg: var(--ef-brand);
    --breadcrumbs-bg: var(--ef-surface);

    --link-fg: var(--ef-brand);
    --link-hover-color: color-mix(in oklab, var(--ef-brand) 75%, black);
    --link-selected-fg: var(--ef-brand);

    --hairline-color: var(--ef-border);
    --border-color: var(--ef-border);

    --error-fg: var(--ef-destructive);

    --message-debug-bg: oklch(0.955 0.008 240);
    --message-info-bg: color-mix(in oklab, var(--ef-info) 14%, white);
    --message-success-bg: color-mix(in oklab, var(--ef-success) 14%, white);
    --message-warning-bg: color-mix(in oklab, var(--ef-warning) 22%, white);
    --message-error-bg: color-mix(in oklab, var(--ef-destructive) 12%, white);

    --darkened-bg: oklch(0.965 0.008 240);
    --selected-bg: var(--ef-brand-soft);
    --selected-row: color-mix(in oklab, var(--ef-accent) 18%, white);

    --button-fg: var(--primary-fg);
    --button-bg: var(--ef-brand);
    --button-hover-bg: color-mix(in oklab, var(--ef-brand) 85%, black);
    --default-button-bg: var(--ef-brand);
    --default-button-hover-bg: color-mix(in oklab, var(--ef-brand) 85%, black);
    --close-button-bg: oklch(0.52 0.022 248);
    --close-button-hover-bg: oklch(0.42 0.022 248);
    --delete-button-bg: var(--ef-destructive);
    --delete-button-hover-bg: color-mix(in oklab, var(--ef-destructive) 85%, black);

    --object-tools-fg: var(--button-fg);
    --object-tools-bg: var(--close-button-bg);
    --object-tools-hover-bg: var(--close-button-hover-bg);

    --font-family-primary: var(--ef-font-sans);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ef-brand: oklch(0.72 0.1 222);
        --ef-brand-soft: oklch(0.3 0.04 225);
        --ef-chrome: oklch(0.2 0.03 247);
        --ef-chrome-raised: oklch(0.27 0.036 247);
        --ef-chrome-border: oklch(0.3 0.034 247);
        --ef-surface: oklch(0.24 0.026 249);
        --ef-background: oklch(0.18 0.022 249);
        --ef-foreground: oklch(0.93 0.01 240);
        --ef-muted-fg: oklch(0.72 0.02 245);
        --ef-border: oklch(0.32 0.026 248);
        --ef-row-alt: oklch(0.22 0.025 249);
        --ef-row-hover: oklch(0.29 0.04 235);
        --ef-head-bg: oklch(0.28 0.028 249);
        --ef-on-brand: oklch(0.16 0.02 249);
        --ef-shadow: 0 1px 2px oklch(0 0 0 / 30%), 0 8px 24px -16px oklch(0 0 0 / 60%);

        --primary-fg: oklch(0.16 0.02 249);
        --body-medium-color: oklch(0.86 0.014 240);
        --body-loud-color: oklch(0.98 0.005 240);
        --link-hover-color: color-mix(in oklab, var(--ef-brand) 75%, white);
        --message-debug-bg: oklch(0.28 0.02 249);
        --message-info-bg: color-mix(in oklab, var(--ef-info) 30%, var(--ef-background));
        --message-success-bg: color-mix(in oklab, var(--ef-success) 30%, var(--ef-background));
        --message-warning-bg: color-mix(in oklab, var(--ef-warning) 26%, var(--ef-background));
        --message-error-bg: color-mix(in oklab, var(--ef-destructive) 30%, var(--ef-background));
        --darkened-bg: oklch(0.21 0.024 249);
        --selected-row: color-mix(in oklab, var(--ef-accent) 22%, var(--ef-background));
        --button-hover-bg: color-mix(in oklab, var(--ef-brand) 85%, white);
        --default-button-hover-bg: color-mix(in oklab, var(--ef-brand) 85%, white);
        --close-button-bg: oklch(0.36 0.02 248);
        --close-button-hover-bg: oklch(0.46 0.02 248);

        color-scheme: dark;
    }
}

html[data-theme="dark"] {
    --ef-brand: oklch(0.72 0.1 222);
    --ef-brand-soft: oklch(0.3 0.04 225);
    --ef-chrome: oklch(0.2 0.03 247);
    --ef-chrome-raised: oklch(0.27 0.036 247);
    --ef-chrome-border: oklch(0.3 0.034 247);
    --ef-surface: oklch(0.24 0.026 249);
    --ef-background: oklch(0.18 0.022 249);
    --ef-foreground: oklch(0.93 0.01 240);
    --ef-muted-fg: oklch(0.72 0.02 245);
    --ef-border: oklch(0.32 0.026 248);
    --ef-row-alt: oklch(0.22 0.025 249);
    --ef-row-hover: oklch(0.29 0.04 235);
    --ef-head-bg: oklch(0.28 0.028 249);
    --ef-on-brand: oklch(0.16 0.02 249);
    --ef-shadow: 0 1px 2px oklch(0 0 0 / 30%), 0 8px 24px -16px oklch(0 0 0 / 60%);

    --primary-fg: oklch(0.16 0.02 249);
    --body-medium-color: oklch(0.86 0.014 240);
    --body-loud-color: oklch(0.98 0.005 240);
    --link-hover-color: color-mix(in oklab, var(--ef-brand) 75%, white);
    --message-debug-bg: oklch(0.28 0.02 249);
    --message-info-bg: color-mix(in oklab, var(--ef-info) 30%, var(--ef-background));
    --message-success-bg: color-mix(in oklab, var(--ef-success) 30%, var(--ef-background));
    --message-warning-bg: color-mix(in oklab, var(--ef-warning) 26%, var(--ef-background));
    --message-error-bg: color-mix(in oklab, var(--ef-destructive) 30%, var(--ef-background));
    --darkened-bg: oklch(0.21 0.024 249);
    --selected-row: color-mix(in oklab, var(--ef-accent) 22%, var(--ef-background));
    --button-hover-bg: color-mix(in oklab, var(--ef-brand) 85%, white);
    --default-button-hover-bg: color-mix(in oklab, var(--ef-brand) 85%, white);
    --close-button-bg: oklch(0.36 0.02 248);
    --close-button-hover-bg: oklch(0.46 0.02 248);

    color-scheme: dark;
}

/* The skeleton of every page: one wrapper holding the header and the body grid, so that no
   helper node of the page (the icon sprite, the skip link) becomes a row of the grid. */
html,
body {
    height: auto;
    margin: 0;
}

body {
    background: var(--ef-background);
    color: var(--ef-foreground);
    font-family: var(--ef-font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-family: var(--ef-font-display);
    letter-spacing: -0.01em;
}

a:link,
a:visited {
    color: var(--ef-brand);
}

/* Django underlines every link outside a few places with a rule of id weight; the panel
   underlines a link on hover only. */
body #ef-app a:link,
body #ef-app a:visited {
    text-decoration: none;
}

body #ef-app a:hover {
    text-decoration: underline;
}

body #ef-app a.ef-btn:hover {
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--ef-accent);
    outline-offset: 2px;
}

.ef-i {
    width: 18px;
    height: 18px;
    flex: none;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#ef-app {
    display: grid;
    grid-template-rows: 3.5rem minmax(0, 1fr);
    height: 100vh;
}

/* Header: the chrome of the panel across the whole width. */
#header.ef-header {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    height: 3.5rem;
    padding: 0 1.25rem 0 0;
    background: var(--ef-chrome);
    color: var(--ef-chrome-fg);
    border-bottom: 1px solid var(--ef-chrome-border);
    box-shadow: none;
    overflow: hidden;
}

.ef-brand,
.ef-brand:link,
.ef-brand:visited {
    display: flex;
    flex: none;
    align-items: center;
    gap: 0.7rem;
    width: 16rem;
    height: 100%;
    padding: 0 1.25rem;
    color: var(--ef-chrome-fg);
    text-decoration: none;
}

.ef-brand img {
    width: 34px;
    height: 34px;
    padding: 2px;
    border-radius: 6px;
    background: #fff;
}

.ef-brand b {
    display: block;
    color: #fff;
    font-family: var(--ef-font-display);
    font-size: 1.05rem;
    line-height: 1.1;
}

.ef-brand small {
    display: block;
    color: var(--ef-chrome-fg);
    font-size: 0.72rem;
    opacity: 0.85;
}

.ef-lock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--ef-chrome-fg);
    font-size: 0.8rem;
    opacity: 0.9;
}

.ef-lock .ef-i {
    width: 14px;
    height: 14px;
}

.ef-spacer {
    flex: 1;
}

#header #user-tools,
.ef-user-tools {
    margin: 0;
    line-height: 1.4;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0;
    color: var(--ef-chrome-fg);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.ef-user-tools strong {
    color: #fff;
    font-weight: 600;
}

#logout-form {
    display: inline;
}

#header #logout-form button {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--ef-chrome-border);
    border-radius: 4px;
    background: var(--ef-chrome-raised);
    color: var(--ef-chrome-fg);
    font: inherit;
    font-size: 0.8rem;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

#header #logout-form button:hover {
    color: #fff;
    border-color: var(--ef-accent);
}

#header .theme-toggle svg {
    fill: var(--ef-chrome-fg);
}

.ef-menu {
    display: none;
    align-items: center;
    gap: 0.4rem;
    height: 100%;
    padding: 0 1rem;
    border: 0;
    background: transparent;
    color: var(--ef-chrome-fg);
    font: inherit;
    cursor: pointer;
}

/* Inside, because the header hides its overflow and the brand and the menu button fill its
   height. */
#header :focus-visible {
    outline-offset: -2px;
}

/* Body: the sidebar at the left edge, the content in the rest, each scrolling on its own. */
#main.ef-main {
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr);
    min-height: 0;
}

#main.ef-main:not(:has(> #nav-sidebar)) {
    grid-template-columns: minmax(0, 1fr);
}

#nav-sidebar {
    display: block;
    position: static;
    width: auto;
    height: auto;
    padding: 0.6rem 0 2rem;
    overflow-y: auto;
    border-right: 1px solid var(--ef-chrome-border);
    border-radius: 0;
    background: var(--ef-chrome);
    color: var(--ef-chrome-fg);
}

#nav-sidebar a,
#nav-sidebar summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.5rem;
    padding: 0.62rem 1.25rem 0.62rem calc(1.25rem - 3px);
    border-left: 3px solid transparent;
    border-radius: 0;
    color: var(--ef-chrome-fg);
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
}

#nav-sidebar summary::-webkit-details-marker {
    display: none;
}

#nav-sidebar summary > span {
    flex: 1;
}

#nav-sidebar a:hover,
#nav-sidebar summary:hover {
    background: var(--ef-chrome-raised);
    color: #fff;
    text-decoration: none;
}

#nav-sidebar a[aria-current="page"] {
    background: var(--ef-chrome-raised);
    color: #fff;
    border-left-color: var(--ef-accent);
}

#nav-sidebar .ef-chev {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: transform 0.15s;
}

#nav-sidebar details[open] > summary .ef-chev {
    transform: rotate(90deg);
}

#nav-sidebar details.has-active > summary {
    color: #fff;
}

/* Less the 3px of the left border every link has, current or not, so the text never moves. The
   height counts the padding: on the content box the min-height came on top of the padding of a
   top row, and every entry of a group stood 54px high, far looser than the labels around it. Now
   an entry of one line is 2.15rem high, and one of two lines grows by its second line: about
   0.95rem between the texts of two entries either way. */
#nav-sidebar .ef-sub a {
    box-sizing: border-box;
    min-height: 2.15rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    padding-left: calc(3.4rem - 3px);
    font-size: 0.9rem;
    font-weight: 400;
}

#nav-sidebar .ef-sub-label {
    padding: 0.55rem 1.25rem 0.15rem 3.4rem;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.6;
}

#nav-sidebar .ef-sep {
    height: 1.2rem;
    background: linear-gradient(var(--ef-chrome-border), var(--ef-chrome-border)) center / calc(100% - 2.5rem) 1px no-repeat;
}

/* Inside, because the sidebar scrolls and clips whatever is drawn past its edges. */
#nav-sidebar :focus-visible {
    outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
    #nav-sidebar .ef-chev {
        transition: none;
    }
}

/* Content: the whole width at the right of the sidebar. */
.ef-content {
    min-width: 0;
    overflow-y: auto;
}

.ef-breadcrumbs {
    padding: 0.65rem 1.75rem;
    border-bottom: 1px solid var(--ef-border);
    background: var(--ef-surface);
    color: var(--ef-muted-fg);
    font-size: 0.82rem;
}

.ef-breadcrumbs .breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    background: none;
    color: var(--ef-muted-fg);
    list-style: none;
}

.ef-breadcrumbs .breadcrumbs li {
    padding: 0;
    list-style: none;
}

#ef-app .breadcrumbs li::after {
    content: none;
}

.ef-breadcrumbs .breadcrumbs li + li::before {
    content: "/";
    padding: 0 0.4rem;
    opacity: 0.6;
}

.ef-breadcrumbs .breadcrumbs a:link,
.ef-breadcrumbs .breadcrumbs a:visited {
    color: var(--ef-brand);
}

.ef-page {
    padding: 1.5rem 1.75rem 3rem;
}

#content.colM,
#content {
    width: auto;
    padding: 0;
    float: none;
}

#content-main {
    float: none;
    width: auto;
}

.ef-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ef-head h1 {
    margin: 0;
    color: var(--ef-foreground);
    font-size: 1.6rem;
    font-weight: 600;
}

.ef-head h2,
.ef-lead {
    margin: 0.2rem 0 0;
    color: var(--ef-muted-fg);
    font-family: var(--ef-font-sans);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0;
}

.ef-footer {
    margin-top: 2rem;
    color: var(--ef-muted-fg);
    font-size: 0.75rem;
}

/* Buttons. */
.ef-btns,
.ef-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.ef-actions {
    margin: 1.25rem 0;
}

.ef-btn,
a.ef-btn:link,
a.ef-btn:visited {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: var(--ef-brand);
    color: var(--ef-on-brand);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.ef-btn:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

.ef-btn.ef-ghost,
a.ef-btn.ef-ghost:link,
a.ef-btn.ef-ghost:visited {
    border-color: var(--ef-border);
    background: transparent;
    color: var(--ef-brand);
}

/* Lists of rows. */
#changelist {
    border: 0;
    background: none;
    box-shadow: none;
}

#changelist .changelist-form-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15rem;
    gap: 1.25rem;
    align-items: start;
}

#changelist .changelist-form-container:not(:has(> #changelist-filter)) {
    grid-template-columns: minmax(0, 1fr);
}

#changelist .changelist-form-container > div {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

/* Django's changelists.css keeps this column 270px narrower than itself, room for a filter that
   here has a column of its own: the table takes the whole column. Same selector, so this rule,
   loaded later, wins. */
#changelist .changelist-form-container:has(#changelist-filter) > div {
    max-width: none;
}

.ef-toolbar,
#changelist #toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding: 0;
    border: 0;
    background: none;
}

#changelist-search {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

#changelist #toolbar input[type="search"],
.ef-toolbar input[type="search"] {
    box-sizing: border-box;
    min-height: 2.3rem;
    width: 22rem;
    max-width: 100%;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-surface);
    color: var(--ef-foreground);
    font: inherit;
}

.ef-count {
    margin-left: auto;
    color: var(--ef-muted-fg);
    font-size: 0.85rem;
}

/* Django gives the box of a list width: 100%; with its border inside, it never passes its column. */
#changelist .results,
.ef-result {
    box-sizing: border-box;
    overflow-x: auto;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-surface);
}

#result_list,
.ef-result table {
    width: 100%;
    border: 0;
    border-collapse: collapse;
}

#changelist #result_list th,
#changelist #result_list td,
.ef-result th,
.ef-result td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--ef-border);
    font-size: 0.875rem;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.ef-result td.ef-wrap {
    white-space: normal;
}

/* A column of numbers, right-aligned in figures of one width. */
.ef-result th.ef-num,
.ef-result td.ef-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* On a narrow screen the count of rows stays beside the name: the group is already in the menu. */
@media (max-width: 560px) {
    .ef-catalogs .ef-result th:nth-child(2),
    .ef-catalogs .ef-result td:nth-child(2) {
        display: none;
    }
}

#changelist #result_list thead th,
.ef-result thead th {
    background: var(--ef-head-bg);
    color: var(--ef-muted-fg);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#changelist #result_list thead th a:link,
#changelist #result_list thead th a:visited,
#changelist #result_list thead th span {
    padding: 0;
    color: var(--ef-muted-fg);
}

#result_list tbody tr,
.ef-result tbody tr {
    background: var(--ef-surface);
}

#result_list tbody tr:nth-child(even),
.ef-result tbody tr:nth-child(even) {
    background: var(--ef-row-alt);
}

#result_list tbody tr:hover,
.ef-result tbody tr:hover {
    background: var(--ef-row-hover);
}

#result_list tbody tr:last-child td,
#result_list tbody tr:last-child th,
.ef-result tbody tr:last-child td {
    border-bottom: 0;
}

#result_list code,
.ef-detail code {
    padding: 0.06rem 0.3rem;
    border-radius: 4px;
    background: var(--ef-head-bg);
    font-size: 0.82rem;
}

/* States: colour plus the word, never colour alone. */
.ef-pill {
    display: inline-block;
    padding: 0.08rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.5;
}

.ef-pill.ok {
    border-color: color-mix(in oklab, var(--ef-success) 40%, transparent);
    background: color-mix(in oklab, var(--ef-success) 12%, transparent);
    color: color-mix(in oklab, var(--ef-success) 80%, var(--ef-foreground));
}

.ef-pill.pause {
    border-color: color-mix(in oklab, var(--ef-warning) 55%, transparent);
    background: color-mix(in oklab, var(--ef-warning) 20%, transparent);
    color: oklch(0.45 0.11 70);
}

html[data-theme="dark"] .ef-pill.pause {
    color: var(--ef-warning);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .ef-pill.pause {
        color: var(--ef-warning);
    }
}

.ef-pill.bad {
    border-color: color-mix(in oklab, var(--ef-destructive) 40%, transparent);
    background: color-mix(in oklab, var(--ef-destructive) 12%, transparent);
    color: color-mix(in oklab, var(--ef-destructive) 85%, var(--ef-foreground));
}

.ef-pill.info {
    border-color: color-mix(in oklab, var(--ef-info) 40%, transparent);
    background: color-mix(in oklab, var(--ef-info) 12%, transparent);
    color: color-mix(in oklab, var(--ef-info) 75%, var(--ef-foreground));
}

.ef-pill.off {
    border-color: var(--ef-border);
    background: var(--ef-head-bg);
    color: var(--ef-muted-fg);
}

/* Filters at the right, the chosen one marked by the amber bar. */
#changelist-filter {
    grid-column: 2;
    grid-row: 1;
    position: static;
    width: auto;
    margin: 0;
    padding: 0 0 0.4rem;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-surface);
}

#changelist-filter h2 {
    margin: 0;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--ef-border);
    background: var(--ef-head-bg);
    color: var(--ef-muted-fg);
    font-family: var(--ef-font-sans);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#changelist-filter h3 {
    margin: 0.8rem 0.9rem 0.3rem;
    color: var(--ef-foreground);
    font-family: var(--ef-font-sans);
    font-size: 0.85rem;
    font-weight: 600;
}

/* The title of a filter starts where the text of its options starts (0.9rem in), without the
   arrow Django's changelists.css draws before it; the group still folds when clicked. */
#changelist-filter details > summary {
    margin: 0.8rem 0.9rem 0.3rem;
    padding: 0;
    color: var(--ef-foreground);
    font-family: var(--ef-font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

#changelist-filter details > summary::before,
#changelist-filter details[open] > summary::before {
    content: none;
}

#changelist-filter ul {
    margin: 0 0 0.6rem;
    padding: 0;
    border: 0;
    list-style: none;
}

#changelist-filter li {
    margin: 0;
    padding: 0;
    list-style: none;
}

#changelist-filter li a:link,
#changelist-filter li a:visited {
    display: block;
    padding: 0.28rem 0.9rem 0.28rem calc(0.9rem - 3px);
    border-left: 3px solid transparent;
    color: var(--ef-foreground);
}

#changelist-filter li.selected a:link,
#changelist-filter li.selected a:visited {
    border-left-color: var(--ef-accent);
    background: var(--ef-brand-soft);
    color: var(--ef-brand);
    font-weight: 600;
}

/* Pagination chips. */
.ef-pager,
#changelist .paginator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 0.2rem;
    border: 0;
    background: none;
    color: var(--ef-muted-fg);
    font-size: 0.85rem;
}

.ef-pager ul {
    display: flex;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ef-pager li {
    padding: 0;
    list-style: none;
}

.ef-pager a:link,
.ef-pager a:visited,
.ef-pager span[aria-disabled],
.ef-pager .this-page {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-surface);
    color: var(--ef-brand);
}

.ef-pager .this-page {
    border-color: var(--ef-brand);
    background: var(--ef-brand);
    color: var(--ef-on-brand);
    font-weight: 600;
}

.ef-pager span[aria-disabled] {
    color: var(--ef-muted-fg);
    opacity: 0.6;
}

/* Boxes, the page of a row and notes. */
.ef-box {
    margin-bottom: 1.25rem;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-surface);
}

.ef-box > h2 {
    margin: 0;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--ef-border);
    background: var(--ef-head-bg);
    color: var(--ef-foreground);
    font-family: var(--ef-font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.ef-detail {
    max-width: 56rem;
}

.ef-detail dl {
    margin: 0;
}

.ef-row {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--ef-border);
}

.ef-row:last-child {
    border-bottom: 0;
}

.ef-row dt {
    color: var(--ef-muted-fg);
    font-weight: 400;
}

.ef-row dd {
    margin: 0;
}

.ef-note {
    max-width: 56rem;
    margin: 0 0 1.25rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--ef-border);
    border-left: 3px solid var(--ef-info);
    border-radius: 4px;
    background: var(--ef-surface);
    color: var(--ef-muted-fg);
}

.ef-note strong {
    color: var(--ef-foreground);
}

/* Under the table of events, which has no margin of its own: the space between boxes. */
.ef-security .ef-note {
    margin-top: 1.25rem;
}

.ef-empty {
    margin: 0;
    padding: 0.9rem 1rem;
    color: var(--ef-muted-fg);
}

.ef-muted {
    color: var(--ef-muted-fg);
}

.ef-box-foot {
    margin: 0;
    padding: 0.6rem 1rem 0.9rem;
    color: var(--ef-muted-fg);
    font-size: 0.85rem;
}

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

.ef-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--ef-border);
    list-style: none;
}

.ef-list li:last-child {
    border-bottom: 0;
}

.ef-list small {
    display: block;
    color: var(--ef-muted-fg);
}

/* Tabs of the page of a row, for the pages that have several parts. On a narrow screen the strip
   scrolls sideways instead of widening the page; overflow-y stays hidden so the tabs, which sit
   1px over the border of the bar, add no vertical scroll. */
.ef-tabs {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--ef-border);
}

.ef-tabs button {
    margin-bottom: -1px;
    padding: 0.6rem 1.1rem;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    color: var(--ef-muted-fg);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ef-tabs button[aria-selected="true"] {
    border-bottom-color: var(--ef-accent);
    color: var(--ef-brand);
}

/* The tabs of the page of an organization are links: each part is a page of its own. */
.ef-tabs a {
    margin-bottom: -1px;
    padding: 0.6rem 1.1rem;
    border-bottom: 3px solid transparent;
    color: var(--ef-muted-fg);
    font-weight: 600;
    text-decoration: none;
}

.ef-tabs a[aria-current="page"] {
    border-bottom-color: var(--ef-accent);
    color: var(--ef-brand);
}

/* The steps of the creation of an organization and the preview of the mail of its owner. */
.ef-steps {
    margin: 0;
    padding: 1rem 1rem 0 2.25rem;
}

.ef-steps li {
    margin-bottom: 0.6rem;
}

.ef-mail-subject {
    margin: 0;
    padding: 0.75rem 1rem 0;
    font-weight: 600;
}

.ef-mail-body {
    margin: 0;
    padding: 0.75rem 1rem;
    color: var(--ef-foreground);
    font: inherit;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ef-tabpanel {
    display: none;
}

.ef-tabpanel.ef-on {
    display: block;
}

/* The summary of the platform. */
.ef-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ef-kpi {
    padding: 0.9rem 1rem;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-surface);
}

.ef-kpi-label,
.ef-kpi-hint {
    color: var(--ef-muted-fg);
    font-size: 0.82rem;
}

.ef-kpi-value {
    color: var(--ef-foreground);
    font-family: var(--ef-font-display);
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.ef-two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.ef-section-title {
    margin: 0 0 0.6rem;
    color: var(--ef-foreground);
    font-size: 1rem;
}

.ef-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 10.5rem;
    padding: 2rem 1rem 0;
    border-bottom: 1px solid var(--ef-border);
}

.ef-bar {
    position: relative;
    flex: 1;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    background: var(--ef-brand);
}

/* The height of a bar in steps of 5 and the share of a part of the bar of states in twentieths
   (admin/nucleo/site.py): no page carries an inline style. */
.ef-h-0 {
    height: 0%;
}

.ef-h-5 {
    height: 5%;
}

.ef-h-10 {
    height: 10%;
}

.ef-h-15 {
    height: 15%;
}

.ef-h-20 {
    height: 20%;
}

.ef-h-25 {
    height: 25%;
}

.ef-h-30 {
    height: 30%;
}

.ef-h-35 {
    height: 35%;
}

.ef-h-40 {
    height: 40%;
}

.ef-h-45 {
    height: 45%;
}

.ef-h-50 {
    height: 50%;
}

.ef-h-55 {
    height: 55%;
}

.ef-h-60 {
    height: 60%;
}

.ef-h-65 {
    height: 65%;
}

.ef-h-70 {
    height: 70%;
}

.ef-h-75 {
    height: 75%;
}

.ef-h-80 {
    height: 80%;
}

.ef-h-85 {
    height: 85%;
}

.ef-h-90 {
    height: 90%;
}

.ef-h-95 {
    height: 95%;
}

.ef-h-100 {
    height: 100%;
}

.ef-flex-1 {
    flex: 1;
}

.ef-flex-2 {
    flex: 2;
}

.ef-flex-3 {
    flex: 3;
}

.ef-flex-4 {
    flex: 4;
}

.ef-flex-5 {
    flex: 5;
}

.ef-flex-6 {
    flex: 6;
}

.ef-flex-7 {
    flex: 7;
}

.ef-flex-8 {
    flex: 8;
}

.ef-flex-9 {
    flex: 9;
}

.ef-flex-10 {
    flex: 10;
}

.ef-flex-11 {
    flex: 11;
}

.ef-flex-12 {
    flex: 12;
}

.ef-flex-13 {
    flex: 13;
}

.ef-flex-14 {
    flex: 14;
}

.ef-flex-15 {
    flex: 15;
}

.ef-flex-16 {
    flex: 16;
}

.ef-flex-17 {
    flex: 17;
}

.ef-flex-18 {
    flex: 18;
}

.ef-flex-19 {
    flex: 19;
}

.ef-flex-20 {
    flex: 20;
}

.ef-bar span {
    position: absolute;
    top: -1.35rem;
    right: 0;
    left: 0;
    color: var(--ef-foreground);
    font-size: 0.78rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.ef-bar-labels {
    display: flex;
    gap: 2px;
    padding: 0.35rem 1rem 0;
    color: var(--ef-muted-fg);
    font-size: 0.72rem;
}

.ef-bar-labels span {
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.ef-stack {
    display: flex;
    gap: 2px;
    height: 14px;
    margin: 1rem;
    border-radius: 4px;
    background: var(--ef-head-bg);
}

.ef-stack i {
    display: block;
    height: 100%;
    border-radius: 4px;
}

.ef-tone-ok {
    --ef-tone: var(--ef-success);
}

.ef-tone-pause {
    --ef-tone: var(--ef-warning);
}

.ef-tone-bad {
    --ef-tone: var(--ef-destructive);
}

.ef-stack i,
.ef-legend li::before {
    background: var(--ef-tone);
}

.ef-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin: 0;
    padding: 0 1rem 0.4rem;
    list-style: none;
    font-size: 0.85rem;
}

.ef-legend li {
    padding: 0;
    list-style: none;
}

.ef-legend li::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 0.4rem;
    border-radius: 2px;
    vertical-align: -1px;
}

/* The filters of the security events. */
.ef-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-surface);
}

.ef-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 11rem;
}

.ef-field label {
    color: var(--ef-muted-fg);
    font-size: 0.85rem;
}

.ef-field input,
.ef-field select {
    min-height: 2.3rem;
    padding: 0.45rem 0.7rem;
    line-height: 1.3;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-background);
    color: var(--ef-foreground);
    font: inherit;
}

.ef-field .errorlist {
    margin: 0;
}

.ef-field-actions {
    display: flex;
    gap: 0.6rem;
}

/* The form that creates an account and the actions of the page of an account. */
.ef-form,
.ef-action-list {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.ef-form .ef-field input {
    max-width: 28rem;
}

.ef-field-label {
    color: var(--ef-muted-fg);
    font-size: 0.85rem;
}

.ef-action {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ef-border);
}

.ef-action:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ef-action h3 {
    margin: 0 0 0.35rem;
    font-size: 0.9rem;
}

.ef-action p {
    margin: 0 0 0.6rem;
    color: var(--ef-muted-fg);
}

.ef-btn.ef-danger {
    background: var(--ef-destructive);
    color: var(--ef-on-brand);
}

summary.ef-btn {
    list-style: none;
}

summary.ef-btn::-webkit-details-marker {
    display: none;
}

.ef-confirm form {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid color-mix(in oklab, var(--ef-destructive) 40%, transparent);
    border-radius: 4px;
}

.ef-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1.25rem;
}

/* Messages of the admin, inside the content. */
ul.messagelist li {
    border-radius: 4px;
}

/* The login: no sidebar, a card on the background of the panel. */
body.login #main.ef-main {
    display: block;
}

body.login .ef-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem;
}

body.login #content {
    width: min(26rem, 100%);
    padding: 1.75rem;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-surface);
}

.ef-login-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ef-login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 0 auto 0.5rem;
    font-family: var(--ef-font-display);
    font-size: 1.35rem;
    font-weight: 700;
}

.ef-login-logo {
    flex: none;
    width: 3rem;
    height: 3rem;
    padding: 2px;
    border-radius: 8px;
    background: #fff;
}

.ef-login-title {
    margin: 0;
    font-size: 1.375rem;
    text-align: center;
}

.ef-login-lead,
.ef-login-note {
    margin: 0;
    color: var(--ef-muted-fg);
    text-align: center;
}

.ef-login-note {
    margin-top: 0.75rem;
    font-size: 0.78rem;
}

body.login .form-row {
    padding: 0.4rem 0;
    border: 0;
}

body.login .form-row label {
    display: block;
    padding: 0 0 0.25rem;
    color: var(--ef-muted-fg);
    font-weight: 600;
}

body.login .form-row input {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-background);
    color: var(--ef-foreground);
}

body.login .submit-row {
    margin: 0;
    padding: 1rem 0 0;
    border: 0;
    background: none;
}

body.login .submit-row input {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    background: var(--ef-brand);
    color: var(--ef-on-brand);
    font-weight: 600;
}

body.login .ef-footer {
    display: none;
}

/* Narrow screens: the sidebar opens from the menu button of the header once the script marks the
   html element with ef-js; without the script it stays above the content, 22rem at most. */
@media (max-width: 1100px) {
    .ef-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ef-two {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 960px) {
    #ef-app {
        display: block;
        height: auto;
    }

    html.ef-js .ef-menu {
        display: flex;
    }

    .ef-brand,
    .ef-brand:link,
    .ef-brand:visited {
        width: auto;
        padding: 0 0.5rem 0 0;
    }

    .ef-lock,
    .ef-user-tools strong {
        display: none;
    }

    #main.ef-main {
        display: block;
    }

    #nav-sidebar {
        max-height: 22rem;
        border-right: 0;
        border-bottom: 1px solid var(--ef-chrome-border);
    }

    html.ef-js #nav-sidebar {
        display: none;
        max-height: none;
    }

    html.ef-js #nav-sidebar.ef-open {
        display: block;
    }

    .ef-content {
        overflow: visible;
    }

    #changelist .changelist-form-container {
        grid-template-columns: minmax(0, 1fr);
    }

    #changelist-filter {
        grid-column: 1;
        grid-row: 2;
    }

    .ef-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem;
    }

    .ef-page {
        padding: 1.25rem 1rem 2rem;
    }

    .ef-breadcrumbs {
        padding: 0.6rem 1rem;
    }
}

@media (max-width: 560px) {
    .ef-kpis {
        grid-template-columns: minmax(0, 1fr);
    }

    .ef-bar-labels small,
    .ef-brand small {
        display: none;
    }

    #header.ef-header {
        gap: 0.5rem;
        padding-right: 0.75rem;
    }

    .ef-menu {
        padding: 0 0.6rem;
    }

    .ef-menu span {
        display: none;
    }

    #header #user-tools,
    .ef-user-tools {
        gap: 0.5rem;
    }

    #changelist #toolbar input[type="search"],
    .ef-toolbar input[type="search"] {
        width: 100%;
    }

    #changelist-search {
        width: 100%;
    }

    .ef-count {
        margin-left: 0;
    }

    #header #logout-form button {
        padding: 0.3rem 0.5rem;
    }
}

/* The page of an organization: the reason of a change of state and the form of the invitation. */
.ef-field textarea {
    min-height: 4.5rem;
    max-width: 36rem;
    padding: 0.45rem 0.7rem;
    line-height: 1.4;
    border: 1px solid var(--ef-border);
    border-radius: 4px;
    background: var(--ef-background);
    color: var(--ef-foreground);
    font: inherit;
}

.ef-organization .ef-action form {
    display: grid;
    gap: 0.75rem;
    justify-items: start;
}

.ef-organization .ef-action .ef-field {
    width: 100%;
    max-width: 36rem;
}

.ef-organization .ef-action-list .errornote {
    margin: 0;
}

/* What a client uses: each option beside its name, in a group of its own. */
.ef-choices {
    margin: 0;
    padding: 0;
    border: 0;
}

.ef-choices legend {
    margin-bottom: 0.25rem;
    padding: 0;
    color: var(--ef-muted-fg);
    font-size: 0.85rem;
}

.ef-field .ef-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ef-foreground);
    font-size: 0.95rem;
}

.ef-field .ef-option input {
    min-height: 0;
    margin: 0;
    padding: 0;
    accent-color: var(--ef-brand);
}
