/*
 * Van Hoorne Studios brand colours on top of Bootstrap 5.
 * The logo greens are used for accents; buttons and links use a darker
 * green from the same family so white text stays readable (WCAG AA).
 */
:root {
    --vh-green: #7ab648;
    --vh-green-light: #a8c73f;
    --vh-lime: #cfd832;
    --vh-green-dark: #3f7a20;
    --vh-green-darker: #326219;
    --vh-accent-height: 4px;
    --vh-on-primary: #fff;
    --vh-focus-rgb: 122, 182, 72;
    --vh-title-font: var(--bs-body-font-family);
    --vh-body-font: var(--bs-body-font-family);
    --vh-radius: 0.75rem;

    --bs-primary: var(--vh-green-dark);
    --bs-primary-rgb: 63, 122, 32;
    --bs-link-color: var(--vh-green-dark);
    --bs-link-color-rgb: 63, 122, 32;
    --bs-link-hover-color: var(--vh-green-darker);
    --bs-link-hover-color-rgb: 50, 98, 25;
}

[data-bs-theme="dark"] {
    --bs-link-color: var(--vh-green);
    --bs-link-color-rgb: 122, 182, 72;
    --bs-link-hover-color: var(--vh-green-light);
    --bs-link-hover-color-rgb: 168, 199, 63;
}

.btn-primary {
    --bs-btn-color: var(--vh-on-primary);
    --bs-btn-hover-color: var(--vh-on-primary);
    --bs-btn-active-color: var(--vh-on-primary);
    --bs-btn-disabled-color: var(--vh-on-primary);
    --bs-btn-bg: var(--vh-green-dark);
    --bs-btn-border-color: var(--vh-green-dark);
    --bs-btn-hover-bg: var(--vh-green-darker);
    --bs-btn-hover-border-color: var(--vh-green-darker);
    --bs-btn-active-bg: var(--vh-green-darker);
    --bs-btn-active-border-color: var(--vh-green-darker);
    --bs-btn-disabled-bg: var(--vh-green-dark);
    --bs-btn-disabled-border-color: var(--vh-green-dark);
    --bs-btn-focus-shadow-rgb: var(--vh-focus-rgb);
}

.brand-accent {
    height: var(--vh-accent-height);
    background: linear-gradient(90deg, var(--vh-green) 0 40%, var(--vh-green-light) 40% 75%, var(--vh-lime) 75% 100%);
}


.card-brand {
    border-top: 4px solid var(--vh-green);
}

/* Sidebar layout: fixed on large screens, an offcanvas drawer below that. */
.topbar,
.sidebar-brand {
    min-height: 64px;
}

@media (min-width: 992px) {
    .sidebar {
        width: 260px;
        flex-shrink: 0;
        position: sticky;
        top: var(--vh-accent-height);
        height: calc(100vh - var(--vh-accent-height));
        border-right: var(--bs-border-width) solid var(--bs-border-color);
        display: flex;
        flex-direction: column;
    }

    .sidebar .offcanvas-body {
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

.sidebar-brand {
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
}

.sidebar-heading {
    margin: 0.875rem 0 0.25rem;
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.sidebar-nav {
    gap: 1px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.75rem;
    color: var(--bs-body-color);
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link .bi {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

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

.sidebar-nav .nav-link.active {
    color: var(--vh-on-primary);
    background-color: var(--vh-green-dark);
    border-left-color: var(--vh-lime);
}

.min-w-0 {
    min-width: 0;
}

/* The green line runs across the full width and stays on top while scrolling. */
.brand-accent-top {
    position: sticky;
    top: 0;
    z-index: 1040;
}

/* Opening hours month calendar. Day colours come from Bootstrap theme colours
   (bg-*-subtle plus a coloured bar via --day-color), so dark mode works. */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.375rem;
}

.calendar-weekday {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    color: var(--bs-secondary-color);
}

.calendar-day {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-height: 5.5rem;
    padding: 0.375rem 0.5rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-left: 4px solid var(--day-color, var(--bs-border-color));
    border-radius: var(--bs-border-radius);
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: 0.8125rem;
    overflow: hidden;
}

a.calendar-day:hover {
    outline: 2px solid var(--vh-green);
}

.calendar-day-blank {
    border-color: transparent;
    background: none;
}

.calendar-day-unknown {
    color: var(--bs-secondary-color);
    border-style: dashed;
}

.calendar-day-today {
    box-shadow: inset 0 0 0 2px var(--vh-lime);
}

.calendar-day-number {
    font-weight: 700;
}

.calendar-day-hours {
    font-weight: 600;
}

.calendar-day-source {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-legend-swatch {
    display: inline-block;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 0.2rem;
    vertical-align: middle;
}

@media (max-width: 575.98px) {
    .calendar-day {
        min-height: 4rem;
        padding: 0.25rem;
        font-size: 0.6875rem;
    }

    .calendar-day-source {
        display: none;
    }
}

/* Locations with their modules in the sidebar. */
.sidebar-location {
    margin-bottom: 0.25rem;
}

.sidebar-location-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.3125rem 0.75rem;
    border: 0;
    border-radius: var(--bs-border-radius);
    background: none;
    color: var(--bs-body-color);
    font-weight: 600;
    text-align: left;
}

.sidebar-location-name:hover {
    background-color: var(--bs-secondary-bg);
}

.sidebar-location-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.sidebar-location-name.collapsed .sidebar-location-chevron {
    transform: rotate(-90deg);
}

/* Headings at the bottom (Beheer, Toegang, …) that fold their list. */
.sidebar-section-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: calc(100% - 1.5rem);
    margin-left: 0.75rem;
    margin-right: 0.75rem;
    padding: 0.125rem 0;
    border: 0;
    background: none;
    text-align: left;
}

.sidebar-section-toggle:hover,
.sidebar-section-toggle:focus-visible {
    color: var(--bs-body-color);
}

.sidebar-section-toggle .sidebar-location-chevron {
    font-size: 0.6875rem;
}

.sidebar-section-toggle.collapsed .sidebar-location-chevron {
    transform: rotate(-90deg);
}

/* The heading's counter only shows while its list is folded. */
.sidebar-section-badge {
    font-size: 0.6875rem;
    letter-spacing: 0;
}

.sidebar-section-toggle:not(.collapsed) .sidebar-section-badge {
    display: none;
}

.sidebar-section-nav.collapsing {
    transition-duration: 0.25s;
}

.sidebar-nav-nested .nav-link {
    padding-left: 2.25rem;
    font-size: 0.9375rem;
}

.sidebar-nav .nav-link.disabled {
    color: var(--bs-secondary-color);
}

.calendar-day {
    position: relative;
}

.calendar-day-icon {
    position: absolute;
    right: 0.3rem;
    bottom: 0.3rem;
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
}

/*
 * The look of the portal: rounder, lighter and a touch of the organisation's
 * colours everywhere. Colours only come from the variables above (and the
 * organisation's theme over them), so dark mode and every organisation work.
 */
body {
    font-family: var(--vh-body-font);
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
    font-family: var(--vh-title-font);
    letter-spacing: -0.01em;
}

/* A faint tint of the accent colour behind the content, white cards on it. */
main {
    background-color: color-mix(in srgb, var(--vh-green) 5%, var(--bs-body-bg));
}

[data-bs-theme="dark"] main {
    background-color: var(--bs-body-bg);
}

.card {
    --bs-card-border-radius: var(--vh-radius);
    --bs-card-inner-border-radius: calc(var(--vh-radius) - 1px);
    --bs-card-border-color: color-mix(in srgb, var(--vh-green) 18%, var(--bs-border-color));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-header {
    background-color: color-mix(in srgb, var(--vh-green) 8%, var(--bs-body-bg));
}

.btn {
    --bs-btn-border-radius: 0.5rem;
    font-weight: 500;
}

.form-control,
.form-select {
    border-radius: 0.5rem;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--vh-green);
    box-shadow: 0 0 0 0.2rem rgba(var(--vh-focus-rgb), 0.25);
}

.form-check-input:checked {
    background-color: var(--vh-green-dark);
    border-color: var(--vh-green-dark);
}

/* Tables that are not in a card get a card look of their own. */
main > .table-responsive,
main > .table,
main > div > .table-responsive {
    background-color: var(--bs-body-bg);
    border: var(--bs-border-width) solid color-mix(in srgb, var(--vh-green) 18%, var(--bs-border-color));
    border-radius: var(--vh-radius);
    overflow: hidden;
}

main > .table-responsive > .table,
main > div > .table-responsive > .table {
    margin-bottom: 0;
}

.table > thead th {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    background-color: color-mix(in srgb, var(--vh-green) 6%, var(--bs-body-bg));
    border-bottom-color: color-mix(in srgb, var(--vh-green) 30%, var(--bs-border-color));
}

.table-hover > tbody > tr:hover > *,
.table > tbody > tr:hover > * {
    --bs-table-bg-state: color-mix(in srgb, var(--vh-green) 7%, transparent);
}

.badge {
    border-radius: 999px;
    font-weight: 600;
}

/* Tabs and pills in the organisation's colour. */
.nav-tabs .nav-link.active {
    border-top: 3px solid var(--vh-green);
    font-weight: 600;
}

.nav-pills .nav-link.active {
    background-color: var(--vh-green-dark);
    color: var(--vh-on-primary);
}

/* The sidebar: rounded menu items, the active one in the main colour. */
.sidebar-nav .nav-link {
    border-radius: 0.5rem;
}

.sidebar-nav .nav-link.active {
    box-shadow: 0 2px 6px rgba(var(--bs-primary-rgb), 0.35);
}

.topbar {
    background-color: var(--bs-body-bg);
}

/* An organisation's own logo keeps its proportions next to the name. */
.brand-logo {
    max-width: 140px;
    object-fit: contain;
}

/* The GuestIO logo when the organisation has none: black lettering on a light
   page, white on a dark one (pages forced light, like a ticket, keep black). */
.guestio-logo {
    width: auto;
    max-width: 100%;
}

.guestio-icon,
.guestio-on-dark {
    display: none;
}

[data-bs-theme="dark"] .guestio-logo.guestio-on-light,
[data-bs-theme="dark"] [data-bs-theme="light"] .guestio-logo.guestio-on-dark {
    display: none;
}

[data-bs-theme="dark"] .guestio-logo.guestio-on-dark,
[data-bs-theme="dark"] [data-bs-theme="light"] .guestio-logo.guestio-on-light {
    display: inline;
}

/* In the collapsed sidebar only the "io" mark fits. */
@media (min-width: 992px) {
    .sidebar-collapsed .sidebar-brand .guestio-logo.guestio-logo {
        display: none;
    }

    .sidebar-collapsed .sidebar-brand .guestio-icon.guestio-on-light {
        display: inline;
    }

    [data-bs-theme="dark"] .sidebar-collapsed .sidebar-brand .guestio-icon.guestio-on-light {
        display: none;
    }

    [data-bs-theme="dark"] .sidebar-collapsed .sidebar-brand .guestio-icon.guestio-on-dark {
        display: inline;
    }
}

/* Dashboard: a welcome card in the organisation's colours, figures with an
   icon in a soft circle, and charts of a fixed height. */
.dashboard-hero {
    background: linear-gradient(120deg, color-mix(in srgb, var(--vh-green) 14%, var(--bs-body-bg)), var(--bs-body-bg) 70%);
}

.dashboard-hero-number {
    color: var(--bs-link-color);
}

.dashboard-stat .card-body {
    position: relative;
}

.dashboard-stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--bs-link-color);
    background-color: color-mix(in srgb, var(--vh-green) 15%, var(--bs-body-bg));
}

.dashboard-chart {
    position: relative;
    height: 260px;
}

.dashboard-chart-small {
    height: 240px;
}

.dashboard-scroll {
    max-height: 320px;
    overflow-y: auto;
}

.dashboard-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--vh-on-primary);
    background-color: var(--vh-green-dark);
    flex-shrink: 0;
}

/* Device connection grid: 7 days × 24 hours, filled by minutes online. */
.uptime-grid {
    display: grid;
    grid-template-columns: 6.5rem repeat(24, minmax(0, 1fr));
    gap: 3px;
    align-items: center;
    font-size: 0.7rem;
}

.uptime-hour {
    color: var(--bs-secondary-color);
}

.uptime-day {
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.uptime-cell {
    height: 1.1rem;
    border-radius: 3px;
    background-color: color-mix(in srgb, var(--vh-green-dark) calc(var(--uptime) * 100%), var(--bs-secondary-bg));
}

.uptime-cell-future {
    background-color: transparent;
    border: 1px dashed var(--bs-border-color);
}

/* Pages opened in a modal (public/js/portal.js): use the modal's width. */
.modal-page [style*="max-width"] {
    max-width: none !important;
}

/*
 * The page's buttons (<x-slot:actions>): top right next to the title, in view
 * while scrolling, the main button rightmost. In a modal they are moved to
 * its footer (public/js/portal.js).
 */
.page-actions {
    position: sticky;
    top: .75rem;
    z-index: 1010;
    float: right;
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 .75rem 1rem;
    padding: .25rem;
    border-radius: var(--bs-border-radius-lg);
    background: var(--bs-body-bg);
}

.modal-footer .page-actions {
    position: static;
    float: none;
    margin: 0;
    padding: 0;
    background: none;
}

/* The confirmation can open on top of a page in a modal. */
#confirm-modal {
    z-index: 1065;
}

.modal-backdrop + .modal-backdrop {
    z-index: 1060;
}

/*
 * Sidebar motion: hover and active states that move a little, a ripple
 * on click (public/js/portal.js) and modules that slide in when a
 * location opens. Nothing moves for people who ask for less motion.
 */
.sidebar-nav .nav-link,
.sidebar-location-name {
    position: relative;
    overflow: hidden;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

/* A bar in the accent colour grows on the left on hover. */
.sidebar-nav .nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 3px;
    background: var(--vh-lime);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.sidebar-nav .nav-link:hover::before,
.sidebar-nav .nav-link:focus-visible::before {
    transform: scaleY(1);
}

.sidebar-nav .nav-link .bi,
.sidebar-location-name .bi-geo-alt {
    transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-nav .nav-link:not(.disabled):hover .bi,
.sidebar-location-name:hover .bi-geo-alt {
    transform: translateX(3px) scale(1.12);
    color: var(--vh-green);
}

.sidebar-nav .nav-link:not(.active):not(.disabled):hover {
    transform: translateX(2px);
}

/* The page you are on: a gradient in the main colour with a soft glow. */
.sidebar-nav .nav-link.active {
    background-image: linear-gradient(120deg, var(--vh-green-dark), var(--vh-green));
    box-shadow: 0 4px 14px rgba(var(--bs-primary-rgb), 0.35);
}

.sidebar-nav .nav-link.active::before {
    transform: scaleY(1);
}

.sidebar-nav .nav-link.active .bi {
    color: inherit;
}

/* Ripple from where you click. */
.sidebar-ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: currentColor;
    opacity: 0.25;
    transform: scale(0);
    animation: sidebar-ripple 0.55s ease-out forwards;
}

@keyframes sidebar-ripple {
    to {
        transform: scale(1);
        opacity: 0;
    }
}

/* A location's modules: a thin tree line, and they slide in one by one when it opens. */
.sidebar-nav-nested {
    position: relative;
}

.sidebar-nav-nested::after {
    content: "";
    position: absolute;
    left: 1.2rem;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 1px;
    background: var(--bs-border-color);
}

/* In a location the hover bar lights up its piece of the tree line. */
.sidebar-nav-nested .nav-link::before {
    left: calc(1.2rem - 1px);
}

.sidebar-location-chevron {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-nav-nested.sidebar-opening .nav-item {
    animation: sidebar-slide-in 0.3s ease both;
}

.sidebar-nav-nested .nav-item:nth-child(2) { animation-delay: 0.04s; }
.sidebar-nav-nested .nav-item:nth-child(3) { animation-delay: 0.08s; }
.sidebar-nav-nested .nav-item:nth-child(4) { animation-delay: 0.12s; }
.sidebar-nav-nested .nav-item:nth-child(5) { animation-delay: 0.16s; }
.sidebar-nav-nested .nav-item:nth-child(6) { animation-delay: 0.2s; }
.sidebar-nav-nested .nav-item:nth-child(7) { animation-delay: 0.24s; }

@keyframes sidebar-slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
}

.sidebar-nav-nested.collapsing {
    transition-duration: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-nav .nav-link,
    .sidebar-nav .nav-link::before,
    .sidebar-nav .nav-link .bi,
    .sidebar-location-name,
    .sidebar-location-chevron {
        transition: none;
    }

    .sidebar-nav .nav-link:not(.active):not(.disabled):hover,
    .sidebar-nav .nav-link:not(.disabled):hover .bi,
    .sidebar-location-name:hover .bi-geo-alt {
        transform: none;
    }

    .sidebar-ripple,
    .sidebar-nav-nested .nav-item {
        animation: none !important;
    }
}

/* One highlight that glides to the item under the mouse (public/js/portal.js). */
.sidebar-menu {
    position: relative;
}

.sidebar-indicator {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 0.5rem;
    background-color: var(--bs-secondary-bg);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s ease, height 0.28s ease, opacity 0.2s ease;
}

.sidebar-indicator.is-visible {
    opacity: 1;
}

.sidebar-menu.has-indicator .nav-link,
.sidebar-menu.has-indicator .sidebar-location-name {
    z-index: 1;
}

.sidebar-menu.has-indicator .nav-link:not(.active):hover,
.sidebar-menu.has-indicator .sidebar-location-name:hover {
    background-color: transparent;
}

/* Counters next to a menu item. */
.nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
}

/* Collapse button at the top of the sidebar. */
.sidebar-toggle {
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--bs-secondary-color);
    transition: background-color 0.2s ease, transform 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

/* The sidebar collapsed to icons (wide screens only; the choice is remembered). */
@media (min-width: 992px) {
    .sidebar {
        transition: width 0.25s ease;
    }

    .sidebar-collapsed .sidebar {
        width: 76px;
    }

    .sidebar-collapsed .sidebar-toggle {
        transform: rotate(180deg);
    }

    .sidebar-collapsed .sidebar .nav-label,
    .sidebar-collapsed .sidebar .sidebar-location-chevron,
    .sidebar-collapsed .sidebar .sidebar-version,
    .sidebar-collapsed .sidebar .sidebar-heading .bi {
        display: none;
    }

    .sidebar-collapsed .sidebar-brand {
        flex-direction: column;
        justify-content: center;
        gap: 0.25rem;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .sidebar-collapsed .sidebar-brand {
        padding-top: calc(var(--vh-accent-height, 4px) + 0.35rem);
    }

    .sidebar-collapsed .sidebar-brand img,
    .sidebar-collapsed .sidebar-brand svg {
        max-width: 44px;
        height: auto;
    }

    /* No scrollbar eating the narrow bar; the wheel still scrolls. */
    .sidebar-collapsed .sidebar .offcanvas-body {
        scrollbar-width: none;
    }

    .sidebar-collapsed .sidebar .offcanvas-body::-webkit-scrollbar {
        display: none;
    }

    .sidebar-collapsed .sidebar .offcanvas-body {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .sidebar-collapsed .sidebar-heading {
        margin: 0.75rem 0.5rem;
        padding: 0;
        height: 1px;
        background-color: var(--bs-border-color);
    }

    .sidebar-collapsed .sidebar-nav .nav-link,
    .sidebar-collapsed .sidebar-location-name {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar-collapsed .sidebar-nav-nested::after {
        display: none;
    }

    /* Narrow to icons, every heading's list shows and the heading is a line. */
    .sidebar-collapsed .sidebar-section-nav.collapse:not(.show) {
        display: flex;
    }

    .sidebar-collapsed .sidebar-section-toggle {
        width: auto;
        pointer-events: none;
    }

    .sidebar-collapsed .sidebar-section-badge {
        display: none;
    }

    .sidebar-collapsed .sidebar-nav .nav-link .bi {
        font-size: 1.2rem;
    }

    /* A counter becomes a small dot on the icon. */
    .sidebar-collapsed .sidebar .nav-badge {
        position: absolute;
        top: 0.3rem;
        right: 0.6rem;
        min-width: 0.6rem;
        height: 0.6rem;
        padding: 0;
        font-size: 0;
    }
}

/* Search window (Ctrl+K). */
.command-palette-button kbd,
#command-palette kbd {
    font-size: 0.7rem;
    background-color: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    border: 1px solid var(--bs-border-color);
}

#command-palette .modal-dialog {
    margin-top: 12vh;
}

.command-result a {
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--bs-body-color);
    transition: background-color 0.12s ease;
}

.command-result.is-selected a {
    background-color: var(--vh-green-dark);
    color: var(--vh-on-primary);
}

.command-result.is-selected a .text-body-secondary {
    color: inherit !important;
    opacity: 0.8;
}

/* Soft page changes: the sidebar and top bar stay, the content fades (browsers with View Transitions). */
@view-transition {
    navigation: auto;
}

.sidebar {
    view-transition-name: sidebar;
}

.topbar {
    view-transition-name: topbar;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.18s;
}

@media (prefers-reduced-motion: reduce) {
    @view-transition {
        navigation: none;
    }

    .sidebar,
    .sidebar-indicator,
    .sidebar-toggle {
        transition: none;
    }
}

/* Pages in a modal get room: 1000px wide (a bit less on smaller screens), instead of Bootstrap's 800px. */
@media (min-width: 768px) {
    #page-modal .modal-dialog {
        --bs-modal-width: min(1000px, calc(100vw - 3rem));
    }
}

/* A licence plate, shaped like a Dutch one: yellow, bold, letters spaced, never broken over two lines. */
.license-plate {
    display: inline-block;
    padding: 0.1em 0.45em;
    margin: 0.1em 0.25em 0.1em 0;
    border: 1px solid rgba(var(--bs-black-rgb), 0.35);
    border-radius: 0.25rem;
    background: var(--bs-warning);
    color: var(--bs-black);
    font-family: var(--bs-font-monospace);
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
