.form-control:read-only {
    background-color: var(--bs-secondary-bg);
    opacity: 1;
}

.id-level-circle {
    width: 1em;
    aspect-ratio: 1;
}

/* Limit scrolling to the list, keeping headings and paging controls visible. */
.table-view {
    min-width: 0;
    max-width: 100%;
}

.table-view > .table-scroll {
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    max-height: 70dvh;
    overflow: auto;
    overscroll-behavior: contain;
}

.table-scroll > table > thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--bs-body-bg);
}

/* Bootstrap extensions */
@media (min-width: 768px) {
    .table-md-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .text-md-no-break {
        word-break: normal !important;
        overflow-wrap: normal !important;
        white-space: nowrap !important;
    }

    .w-md-260px {
        width: 260px !important;
    }
}

[data-bs-toggle="collapse"] .fa-chevron-down {
    transition: transform 0.2s ease;
}

[data-bs-toggle="collapse"][aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* OpenLayers */
.ol-control.map-legend {
    background-color: var(--ol-background-color);
    color: var(--ol-subtle-foreground-color);
}

/* Same as .ol-control button:hover and .ol-control button:focus */
.ol-control button.active {
    text-decoration: none;
    outline: 1px solid var(--ol-subtle-foreground-color);
    color: var(--ol-foreground-color);
}

/* Dark theme for OpenLayers */
[data-bs-theme="dark"] .ol-control {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ol-control button {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ol-control button:hover,
[data-bs-theme="dark"] .ol-control button:focus,
[data-bs-theme="dark"] .ol-control button.active {
    background-color: var(--bs-secondary-bg-subtle);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ol-attribution {
    background-color: var(--bs-body-bg) !important;
}

[data-bs-theme="dark"] .ol-attribution ul {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ol-attribution a {
    color: var(--bs-secondary-color);
}

/* GLightBox */
.glightbox-clean .gslide-description {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

.glightbox-clean .gslide-title {
    color: var(--bs-body-color) !important;
}

/* Native popovers stay above the horizontally scrolling table container. */
.table-filter-popover {
    position: fixed;
    inset: auto;
    margin: 0;
    width: 18rem;
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-weight: normal;
    text-align: left;
}