/*
 * AIP-NP on top of Bootstrap 5.3.
 *
 * Identity comes from the logo: the night blue of its outline for the chrome, the
 * blue-to-violet of its disc for primary actions, and its horizon stripes as the one
 * decorative motif. Every colour goes through a CSS variable so that both themes work.
 */

/* IBM Plex Sans, latin subset (OFL, see fonts/ibm-plex-sans/OFL.txt). Served from /css so
   that anonymous pages such as the sign-in page can load it. */
@font-face {
    font-family: "IBM Plex Sans";
    src: url("fonts/ibm-plex-sans/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("fonts/ibm-plex-sans/ibm-plex-sans-latin-400-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("fonts/ibm-plex-sans/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("fonts/ibm-plex-sans/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
    font-weight: 600 700;
    font-style: normal;
    font-display: swap;
}

/* ---------- Tokens ---------- */

:root,
[data-bs-theme="light"] {
    --aip-night: #141a3d;
    --aip-night-raised: #1e2655;
    --aip-accent: #5b4bdb;
    --aip-accent-rgb: 91, 75, 219;
    --aip-accent-strong: #4636c2;
    --aip-horizon: linear-gradient(90deg, #1e8fff 0%, #5b4bdb 55%, #9b3cf5 100%);
    --aip-surface: #ffffff;
    --aip-sky: #05070f;
    --aip-radius: .625rem;
    --aip-measure: 46rem;

    --bs-body-font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-line-height: 1.55;
    --bs-body-bg: #f4f5fa;
    --bs-body-bg-rgb: 244, 245, 250;
    --bs-body-color: #1c2038;
    --bs-body-color-rgb: 28, 32, 56;
    --bs-emphasis-color: #0d1027;
    --bs-secondary-color: rgba(28, 32, 56, .66);
    --bs-tertiary-bg: #eceef6;
    --bs-secondary-bg: #e3e6f2;
    --bs-border-color: #d8dbea;
    --bs-border-color-translucent: rgba(20, 26, 61, .12);
    --bs-primary: #5b4bdb;
    --bs-primary-rgb: 91, 75, 219;
    --bs-primary-text-emphasis: #3a2da3;
    --bs-primary-bg-subtle: #e9e6fb;
    --bs-primary-border-subtle: #c7c0f4;
    --bs-link-color: #4636c2;
    --bs-link-color-rgb: 70, 54, 194;
    --bs-link-hover-color: #33278f;
    --bs-link-hover-color-rgb: 51, 39, 143;
    --bs-focus-ring-color: rgba(91, 75, 219, .3);
}

[data-bs-theme="dark"] {
    --aip-surface: #151933;
    --aip-accent-strong: #a69cf6;

    --bs-body-bg: #0d1024;
    --bs-body-bg-rgb: 13, 16, 36;
    --bs-body-color: #dde0ef;
    --bs-body-color-rgb: 221, 224, 239;
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: rgba(221, 224, 239, .66);
    --bs-tertiary-bg: #191e3b;
    --bs-secondary-bg: #222849;
    --bs-border-color: #2b3156;
    --bs-border-color-translucent: rgba(221, 224, 239, .12);
    --bs-primary: #8d80f1;
    --bs-primary-rgb: 141, 128, 241;
    --bs-primary-text-emphasis: #c3bcf8;
    --bs-primary-bg-subtle: #221d4d;
    --bs-primary-border-subtle: #3f3690;
    --bs-link-color: #a69cf6;
    --bs-link-color-rgb: 166, 156, 246;
    --bs-link-hover-color: #c7c0fa;
    --bs-link-hover-color-rgb: 199, 192, 250;
}

body {
    background-color: var(--bs-body-bg);
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1 0 auto;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--bs-emphasis-color);
    letter-spacing: -.005em;
}

code {
    color: var(--bs-primary-text-emphasis);
}

/* ---------- Bootstrap components in the accent colour ---------- */

.btn-primary {
    --bs-btn-bg: var(--aip-accent);
    --bs-btn-border-color: var(--aip-accent);
    --bs-btn-hover-bg: #4a3bc4;
    --bs-btn-hover-border-color: #4a3bc4;
    --bs-btn-active-bg: #3f31ad;
    --bs-btn-active-border-color: #3f31ad;
    --bs-btn-disabled-bg: var(--aip-accent);
    --bs-btn-disabled-border-color: var(--aip-accent);
    --bs-btn-focus-shadow-rgb: var(--aip-accent-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--bs-link-color);
    --bs-btn-border-color: var(--bs-primary-border-subtle);
    --bs-btn-hover-bg: var(--aip-accent);
    --bs-btn-hover-border-color: var(--aip-accent);
    --bs-btn-active-bg: var(--aip-accent);
    --bs-btn-active-border-color: var(--aip-accent);
    --bs-btn-focus-shadow-rgb: var(--aip-accent-rgb);
}

.btn {
    --bs-btn-font-weight: 500;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(var(--aip-accent-rgb), .65);
    box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color);
}

.form-check-input:checked {
    background-color: var(--aip-accent);
    border-color: var(--aip-accent);
}

.form-label {
    font-weight: 500;
    margin-bottom: .35rem;
}

.form-control,
.form-select {
    background-color: var(--aip-surface);
}

.pagination {
    --bs-pagination-color: var(--bs-link-color);
    --bs-pagination-active-bg: var(--aip-accent);
    --bs-pagination-active-border-color: var(--aip-accent);
    --bs-pagination-focus-box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color);
}

.progress {
    --bs-progress-bar-bg: var(--aip-accent);
}

.dropdown-menu {
    --bs-dropdown-link-active-bg: var(--aip-accent);
}

.card {
    --bs-card-bg: var(--aip-surface);
    --bs-card-border-color: var(--bs-border-color);
    --bs-card-border-radius: var(--aip-radius);
    --bs-card-inner-border-radius: calc(var(--aip-radius) - 1px);
    --bs-card-cap-bg: transparent;
    --bs-card-cap-padding-y: .75rem;
    --bs-card-cap-padding-x: 1.25rem;
    --bs-card-spacer-y: 1.25rem;
    --bs-card-spacer-x: 1.25rem;
}

.card-header .card-title,
.card-header h5 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* ---------- Chrome ---------- */

.aip-navbar {
    background-color: var(--aip-night);
    --bs-navbar-padding-y: .5rem;
    --bs-navbar-color: rgba(232, 234, 246, .78);
    --bs-navbar-hover-color: #fff;
    --bs-navbar-active-color: #fff;
}

/* The horizon of the logo, as a line under the bar */
.aip-navbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--aip-horizon);
}

.aip-navbar .navbar-brand img {
    height: 32px;
    width: auto;
}

.aip-navbar .nav-link {
    font-weight: 500;
    padding: .45rem .75rem;
    border-radius: .375rem;
}

.aip-navbar .nav-link.active,
.aip-navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, .09);
}

.aip-navbar .dropdown-item.active {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-emphasis-color);
}

/* Content width: wide enough for working pages on large screens, with real margins */
.shell {
    width: 100%;
    max-width: 105rem;
    margin-inline: auto;
    padding-inline: clamp(1rem, 2.5vw, 2.5rem);
}

.shell-full {
    max-width: none;
}

/* Text-heavy content and forms keep a readable width */
.measure {
    max-width: var(--aip-measure);
}

.footer {
    font-size: .8125rem;
    border-top: 1px solid var(--bs-border-color-translucent);
}

/* ---------- Page header ---------- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem 1.5rem;
    margin: .5rem 0 1.5rem;
}

.page-header h1 {
    font-size: 1.625rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.page-header .page-lead {
    color: var(--bs-secondary-color);
    margin: .35rem 0 0;
    max-width: 72ch;
}

.page-header .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 .75rem;
}

/* ---------- Panels and the work layout ---------- */

.panel {
    background-color: var(--aip-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--aip-radius);
    padding: 1.25rem;
}

.panel + .panel {
    margin-top: 1rem;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.panel-title .panel-aside {
    margin-left: auto;
    font-size: .8125rem;
    font-weight: 400;
    color: var(--bs-secondary-color);
}

.panel-danger {
    border-color: var(--bs-danger-border-subtle);
}

/* A decision between a few paths, as large radio cards (input.btn-check + label.choice-card) */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: .75rem;
}

.choice-card {
    display: flex;
    gap: .875rem;
    align-items: flex-start;
    height: 100%;
    padding: 1rem 1.125rem;
    border: 2px solid var(--bs-border-color);
    border-radius: var(--aip-radius);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.choice-card:hover {
    border-color: rgba(var(--bs-primary-rgb), .5);
}

.btn-check:checked + .choice-card {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), .1);
}

.btn-check:focus-visible + .choice-card {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.choice-icon {
    font-size: 1.75rem;
    line-height: 1;
    color: var(--bs-secondary-color);
}

.btn-check:checked + .choice-card .choice-icon {
    color: var(--bs-primary);
}

.choice-title {
    display: block;
    font-weight: 600;
    font-size: 1.0625rem;
}

.choice-text {
    display: block;
    color: var(--bs-secondary-color);
    font-size: .875rem;
}

/* Setups to assign as imagers, with the tags of each request (fragments/imager-table) */
.imager-choice {
    max-height: 22rem;
    overflow-y: auto;
}

.imager-choice td:last-child {
    min-width: 10rem;
}

.tag-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.tag-toggle {
    --bs-btn-padding-y: .0625rem;
    --bs-btn-padding-x: .5rem;
    --bs-btn-font-size: .8125rem;
}

.tag-creator {
    max-width: 24rem;
}

/* A working page: what you look at on the left, what you do on the right, always in view */
.workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 21rem;
    gap: 1.5rem;
    align-items: start;
}

.workbench-aside {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.workbench-aside .panel + .panel {
    margin-top: 0;
}

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

    .workbench-aside {
        position: static;
    }
}

/* Stacked action buttons in a side panel */
.action-stack {
    display: grid;
    gap: .5rem;
}

.action-stack form {
    margin: 0;
}

.action-stack .btn {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* The colour of a candidate state, as a dot in front of its name */
.state-dot {
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    flex: none;
}

.action-label {
    font-size: .8125rem;
    color: var(--bs-secondary-color);
    margin: 1rem 0 .4rem;
}

.action-label:first-child {
    margin-top: 0;
}

/* ---------- Sky images ---------- */

/* Few images get wide, many images wrap; none grows past a comfortable size */
.sky-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    gap: 1rem;
}

.sky-figure {
    margin: 0;
    max-width: 30rem;
}

.sky-figure a {
    position: relative;
    display: block;
    background-color: var(--aip-sky);
    border-radius: calc(var(--aip-radius) - 2px);
    overflow: hidden;
    aspect-ratio: 1;
}

.sky-figure img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sky-figure a:focus-visible {
    outline: 3px solid var(--aip-accent);
    outline-offset: 2px;
}

.sky-figure figcaption {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    font-size: .8125rem;
    color: var(--bs-secondary-color);
    margin-top: .4rem;
}

/* AIP-IA detection drawn over a composite. Green and pink do not occur in the
   red (H-alpha) and blue (O III) composites, so they stay readable on the sky. */
.sky-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sky-box {
    fill: none;
    stroke: #3df5a6;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.sky-mark {
    fill: none;
    stroke: #ff5c8a;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.sky-overlay-hidden .sky-overlay {
    display: none;
}

/* A small square thumbnail in a table */
.sky-thumb {
    width: 7.5rem;
}

.sky-thumb a {
    position: relative;
    display: block;
    aspect-ratio: 1;
    background-color: var(--aip-sky);
    border-radius: .375rem;
    overflow: hidden;
}

.sky-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Width set by the preview script from the picture's proportions, so that it fits 76vh */
.sky-preview-frame {
    position: relative;
    width: min(100%, 76vh);
    aspect-ratio: 1;
    margin-inline: auto;
    background-color: var(--aip-sky);
    border-radius: .375rem;
    overflow: hidden;
}

.sky-preview-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sky-legend-box,
.sky-legend-mark {
    display: inline-block;
    width: .9rem;
    height: .9rem;
    vertical-align: -.1rem;
    border: 2px solid #3df5a6;
}

.sky-legend-mark {
    border-color: #ff5c8a;
    border-radius: 50%;
}

/* Charts and maps drawn on white */
.chart {
    width: 100%;
    max-width: 44rem;
    height: auto;
    display: block;
}

[data-bs-theme="dark"] .img-on-light,
[data-bs-theme="dark"] .chart {
    background-color: #fff;
    border-radius: .375rem;
}

/* ---------- Verdict buttons (visual evaluation) ---------- */

.verdict-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

.verdict-grid form {
    margin: 0;
}

.verdict-grid .btn {
    width: 100%;
    padding-block: .55rem;
}

.reason-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.reason-row form {
    margin: 0;
}

kbd {
    font-family: inherit;
    font-size: .75rem;
    padding: .1rem .35rem;
    color: var(--bs-body-color);
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .25rem;
}

/* ---------- Sign-in and other anonymous pages ---------- */

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.auth-identity {
    position: relative;
    overflow: hidden;
    background-color: var(--aip-night);
    color: rgba(232, 234, 246, .82);
    padding: clamp(2rem, 5vw, 4.5rem);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.auth-identity img {
    width: min(15rem, 70%);
    height: auto;
}

.auth-identity h1 {
    color: #fff;
    font-size: clamp(1.75rem, 2.6vw, 2.5rem);
    font-weight: 600;
    line-height: 1.15;
    max-width: 14ch;
    margin: auto 0 0;
}

.auth-identity p {
    max-width: 36ch;
    font-size: 1.0625rem;
    margin: 0;
}

.auth-identity a {
    color: #fff;
}

/* The horizon stripes of the logo, thinning towards the bottom */
.auth-horizon {
    display: grid;
    gap: .75rem;
    margin-top: 1rem;
}

.auth-horizon span {
    display: block;
    border-radius: 999px;
    background: var(--aip-horizon);
}

.auth-horizon span:nth-child(1) { height: 1.25rem; opacity: .95; }
.auth-horizon span:nth-child(2) { height: .8rem; opacity: .8; width: 92%; }
.auth-horizon span:nth-child(3) { height: .45rem; opacity: .65; width: 80%; }
.auth-horizon span:nth-child(4) { height: .25rem; opacity: .5; width: 64%; }

.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem clamp(1.25rem, 4vw, 3rem);
}

.auth-form {
    width: 100%;
    max-width: 23rem;
}

.auth-form h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

.auth-form .auth-intro {
    color: var(--bs-secondary-color);
    margin-bottom: 2rem;
}

.auth-form .form-control {
    padding: .6rem .8rem;
}

.auth-form .btn-primary {
    width: 100%;
    padding-block: .65rem;
    margin-top: .5rem;
}

.auth-alt {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
}

.auth-tools {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

@media (max-width: 767.98px) {
    .auth {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .auth-identity {
        gap: 1rem;
        padding: 1.5rem;
    }

    .auth-identity h1 {
        font-size: 1.5rem;
        max-width: none;
        margin-top: .5rem;
    }

    .auth-identity p,
    .auth-horizon {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
    }
}

/* Tables */
.table {
    --bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), .035);
    margin-bottom: .5rem;
}

.table > thead {
    --bs-table-bg: var(--bs-tertiary-bg);
}

.table > thead > tr > th {
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: bottom;
    color: var(--bs-emphasis-color);
}

.table > tbody > tr > td {
    vertical-align: middle;
}

/* table-sm is too tight for long rows: keep it dense but let cells breathe */
.table-sm > :not(caption) > * > * {
    padding: .45rem .6rem;
}

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

.table > tbody > tr.dt-odd > * {
    --bs-table-bg-type: var(--bs-table-striped-bg);
}

.table-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

/* Predictions page: the run id is long, the pre-screeners' notes need room to be read. */
.predictions-table .col-campaign {
    min-width: 8rem;
    max-width: 12rem;
    overflow-wrap: anywhere;
}

.predictions-table .col-reviews {
    min-width: 13rem;
}

/* Data tables (datatable.js) */
.dt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin-bottom: .5rem;
}

.dt-search {
    width: 18rem;
    max-width: 100%;
}

.dt-reset {
    padding: 0;
    text-decoration: none;
}

.dt-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
}

.dt-pager .dt-size {
    display: flex;
    align-items: center;
    gap: .375rem;
    margin-right: auto;
}

.dt-pager .dt-size select {
    width: auto;
}

.dt-filters > th {
    padding: .3rem .6rem .45rem;
    font-weight: normal;
}

.dt-filters .form-control,
.dt-filters .form-select {
    font-size: .8125rem;
    min-width: 6rem;
    padding-top: .15rem;
    padding-bottom: .15rem;
}

.dt-active {
    border-color: var(--aip-accent) !important;
    box-shadow: 0 0 0 .1rem rgba(var(--aip-accent-rgb), .25);
}

th.dt-sortable {
    cursor: pointer;
    user-select: none;
}

th.dt-sortable:hover,
th.dt-sorted {
    color: var(--aip-accent) !important;
}

.dt-sort-icon {
    margin-left: .3rem;
    font-size: .75em;
    opacity: .45;
}

th.dt-sorted .dt-sort-icon {
    opacity: 1;
}

/* Neutral chips (names, setups), readable in both themes */
.chip {
    display: inline-block;
    padding: .15em .5em;
    margin: .1em .15em .1em 0;
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.4;
    border-radius: .375rem;
    color: var(--bs-body-color);
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color-translucent);
    white-space: nowrap;
}

/* Compact progress with its label next to it */
.mini-progress {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 7rem;
}

.mini-progress .progress {
    flex: 1 1 auto;
    height: .4rem;
}

.mini-progress small {
    white-space: nowrap;
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
}

/* Key / value lists */
.kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .25rem 1rem;
    margin: 0;
}

.kv dt {
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.kv dd {
    margin: 0;
}

/* Upload drop zone */
/* The upload page's reminder that only the raw stack is wanted: hard to miss */
.raw-stack-notice {
    border-width: 2px;
    border-color: var(--bs-warning);
}

.raw-stack-notice .alert-heading {
    font-size: 1.25rem;
    font-weight: 700;
}

.drop-zone {
    border: 2px dashed var(--bs-border-color);
    border-radius: .75rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--bs-secondary-color);
}

.drop-zone.dragover {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--aip-accent);
}

.progressWrapper {
    width: 100%;
    background-color: var(--bs-secondary-bg);
    margin-top: .75rem;
    border-radius: .25rem;
    overflow: hidden;
}

.progressBar {
    width: 0;
    height: .75rem;
    background-color: var(--bs-success);
}

.fileStatus {
    margin-top: .25rem;
    font-size: .85rem;
}

/* Selectable lists (bulk assignment) */
.select-list {
    max-height: 26rem;
    overflow-y: auto;
}

.select-list .list-group-item {
    padding: .4rem .65rem;
}

/* bootstrap-duallistbox in the dark theme */
.bootstrap-duallistbox-container select {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* Anything htmx posts on click looks clickable */
[hx-post]:not(button):not(form),
[hx-delete]:not(button):not(form) {
    cursor: pointer;
}

/* Absolutely positioned descendants (.visually-hidden labels) must not escape the scroll box */
.table-responsive {
    position: relative;
}

/* The analysts' opt-in AIP-IA hint */
.hint-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    padding-block: .75rem;
    margin-bottom: 1rem;
}

/* The administrators' monitoring page (011): tiles, meters, a sparkline */
.monitor-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.monitor-tiles .panel + .panel {
    margin-top: 0;
}

.monitor-label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    margin: 0 0 .25rem;
}

.monitor-value {
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--bs-emphasis-color);
    margin: 0 0 .5rem;
}

/* The fill carries the state; the track is a light step of the same hue */
.meter {
    height: 8px;
    border-radius: 999px;
    background-color: var(--bs-primary-bg-subtle);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    min-width: 4px;
    border-radius: 999px;
    background-color: var(--bs-primary);
}

.meter.warning {
    background-color: var(--bs-warning-bg-subtle);
}

.meter.warning .meter-fill {
    background-color: var(--bs-warning);
}

.meter.critical {
    background-color: var(--bs-danger-bg-subtle);
}

.meter.critical .meter-fill {
    background-color: var(--bs-danger);
}

.monitor-state {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .8125rem;
    font-weight: 600;
    margin: .5rem 0 0;
}

.monitor-state.ok .bi {
    color: var(--bs-success);
}

.monitor-state.warning .bi {
    color: var(--bs-warning);
}

.monitor-state.critical .bi {
    color: var(--bs-danger);
}

.monitor-detail,
.monitor-device,
.monitor-footer,
.monitor-empty {
    font-size: .8125rem;
    color: var(--bs-secondary-color);
}

.monitor-detail {
    margin: .5rem 0 0;
}

.monitor-facts {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: .125rem 1rem;
    font-size: .8125rem;
    margin: .75rem 0 0;
}

.monitor-facts dt {
    font-weight: 400;
    color: var(--bs-secondary-color);
}

.monitor-facts dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.monitor-spark {
    margin: 1rem 0 0;
}

.monitor-spark figcaption {
    font-size: .75rem;
    color: var(--bs-secondary-color);
    margin-bottom: .25rem;
}

.monitor-spark svg {
    display: block;
    width: 100%;
    height: 48px;
}

.spark-grid {
    stroke: var(--bs-border-color);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.spark-line {
    fill: none;
    stroke: var(--bs-primary);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.spark-hit {
    fill: transparent;
}

.spark-hit:hover {
    fill: rgba(var(--bs-primary-rgb), .15);
}

.monitor-disk-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .75rem;
    margin-bottom: .5rem;
}

.monitor-disk-head .monitor-state,
.monitor-disk-head .monitor-detail {
    margin: 0;
}

.monitor-disk-figure {
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--bs-emphasis-color);
}

.monitor-dirs {
    list-style: none;
    padding: 0;
    margin: .5rem 0 0;
    font-size: .875rem;
    overflow-wrap: anywhere;
}

.monitor-device {
    margin: .125rem 0 0;
}

.monitor-buffer {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem 1rem;
}

.monitor-footer {
    margin: 1rem 0 0;
}

/* The super-admins' storages page (010) */
.storage-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.storage-list .panel + .panel {
    margin-top: 0;
}

/* Paths and key fingerprints are long words */
.storage-card {
    overflow-wrap: anywhere;
    min-width: 0;
}

/* The active storage: first, full width, an accent edge and a banner saying what it is */
.storage-active-section {
    margin: 0 0 1.5rem;
}

.storage-active {
    border-color: var(--bs-primary-border-subtle);
    border-left: 6px solid var(--bs-primary);
    background-color: var(--aip-surface);
    background-color: color-mix(in srgb, var(--bs-primary-bg-subtle) 45%, var(--aip-surface));
}

.storage-active-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .75rem;
    margin: -1.25rem -1.25rem 1rem;
    padding: .625rem 1.25rem;
    border-bottom: 1px solid var(--bs-primary-border-subtle);
    border-top-right-radius: var(--aip-radius);
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

.storage-active-banner #active-storage-title .bi {
    font-size: 1.125rem;
    margin-right: .25rem;
    color: var(--bs-primary);
}

.storage-health {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin-left: auto;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.storage-health.ok .bi {
    color: var(--bs-success);
}

.storage-health.critical .bi {
    color: var(--bs-danger);
}

.storage-active-name {
    font-size: 1.25rem;
}

.storage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* The candidate page's "Images des imageurs" panel (010) */
.archive-panel {
    border-color: var(--bs-primary-border-subtle);
}

.archive-pending {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .75rem;
    border-radius: var(--aip-radius);
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

.archive-pending .spinner-border {
    flex: none;
    margin-top: .2rem;
}

/* Promotion: a pre-screener ticked, and the analysis recorded for them */
.prescreener-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .35rem 1rem;
    padding: .4rem 0;
    border-top: 1px solid var(--bs-border-color);
}

.prescreener-verdict {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.prescreener-verdict .form-select {
    width: auto;
}
