:root {
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, sans-serif;
    --bs-body-font-size: 1rem;
}

@supports (font-variation-settings: normal) {
    :root {
        font-family: "Inter var", sans-serif;
    }
}

:root {
    --bs-border-radius: 3px;
}

/* Admin shell tokens. base/surround.html.j2 puts .umesh-admin on <body>, so these apply to the
   mesh admin (including modals, dropdowns and flyouts appended to <body>) and leave the member
   portal on the :root values above. Rules elsewhere in this file read the --umesh-* tokens with
   a fallback, so the same rule works inside and outside the admin. */
.umesh-admin {
    /* Controls: buttons, inputs, selects, input groups, nav pills, badges */
    --umesh-radius-control: 6px;
    /* Surfaces: cards, table wrappers, dropdowns, modals, alerts, flyouts */
    --umesh-radius-surface: 10px;

    --umesh-shadow-rest: 0 1px 2px rgb(0 0 0 / 0.05);
    --umesh-shadow-raise: 0 2px 6px -2px rgb(0 0 0 / 0.08);
    --umesh-shadow-float: 0 8px 16px -4px rgb(0 0 0 / 0.12), 0 2px 4px -2px rgb(0 0 0 / 0.06);

    /* Bootstrap resolves each component's radius from these on the component itself, so
       setting them here reaches every control below. Small and large controls share the
       same radius so mixed-size rows look alike. */
    --bs-border-radius: var(--umesh-radius-control);
    --bs-border-radius-sm: var(--umesh-radius-control);
    --bs-border-radius-lg: var(--umesh-radius-control);
}

/* Bootstrap declares its component variables on the component class, so surfaces are set there. */
.umesh-admin .card {
    --bs-card-border-radius: var(--umesh-radius-surface);
    --bs-card-inner-border-radius: calc(var(--umesh-radius-surface) - var(--bs-border-width));
    box-shadow: var(--umesh-shadow-rest);
}

.umesh-admin .dropdown-menu {
    --bs-dropdown-border-radius: var(--umesh-radius-surface);
    --bs-dropdown-inner-border-radius: calc(var(--umesh-radius-surface) - var(--bs-border-width));
    --bs-dropdown-box-shadow: var(--umesh-shadow-float);
    /* Bootstrap's build only applies its shadow variables when shadows are enabled */
    box-shadow: var(--bs-dropdown-box-shadow);
}

.umesh-admin .modal {
    --bs-modal-border-radius: var(--umesh-radius-surface);
    --bs-modal-inner-border-radius: calc(var(--umesh-radius-surface) - var(--bs-border-width));
}

.umesh-admin .alert {
    --bs-alert-border-radius: var(--umesh-radius-surface);
}

.umesh-admin .popover {
    --bs-popover-border-radius: var(--umesh-radius-surface);
    --bs-popover-inner-border-radius: calc(var(--umesh-radius-surface) - var(--bs-border-width));
    --bs-popover-box-shadow: var(--umesh-shadow-float);
    box-shadow: var(--bs-popover-box-shadow);
}

/* Solid primary and danger buttons sit slightly raised. Focused buttons keep Bootstrap's
   focus ring, which also uses box-shadow. */
.umesh-admin :is(.btn-primary, .btn-danger):not(:focus-visible, :disabled, .disabled) {
    box-shadow: var(--umesh-shadow-raise);
}

/* A field's "post button" (an action at the end of its input group, such as "Generate From
   Name") shares the group's height, radius and border, but keeps a plain background and
   primary text so it reads as clickable, unlike the grey text add-ons beside it. */
.umesh-admin .input-group > .inputpostbutton {
    --bs-btn-font-weight: 500;
    --bs-btn-color: var(--bs-primary);
    --bs-btn-bg: var(--bs-body-bg);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-primary-text-emphasis);
    --bs-btn-hover-bg: var(--bs-primary-bg-subtle);
    --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-active-color: var(--bs-primary-text-emphasis);
    --bs-btn-active-bg: color-mix(in srgb, var(--bs-primary-bg-subtle), var(--bs-primary) 15%);
    --bs-btn-active-border-color: var(--bs-border-color);
    --bs-btn-disabled-color: var(--bs-secondary-color);
    --bs-btn-disabled-bg: var(--bs-tertiary-bg);
    --bs-btn-disabled-border-color: var(--bs-border-color);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
    cursor: pointer;
}

/* The focused button sits above its neighbours so its whole ring shows */
.umesh-admin .input-group > .inputpostbutton:focus-visible {
    z-index: 5;
}

/* A date field's clear button looks like the grey calendar add-on beside it, with a darker
   icon on hover. adminbuilder gives it an inline light-mode border colour, which the
   !important replaces so it also matches in dark mode. */
.umesh-admin .input-group > .btn[data-clear] {
    --bs-btn-color: var(--bs-secondary-color);
    --bs-btn-bg: var(--bs-tertiary-bg);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-body-color);
    --bs-btn-hover-bg: var(--bs-secondary-bg);
    --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-active-color: var(--bs-body-color);
    --bs-btn-active-bg: var(--bs-secondary-bg);
    --bs-btn-active-border-color: var(--bs-border-color);
    border-color: var(--bs-border-color) !important;
}

.umesh-admin .input-group > .btn[data-clear]:focus-visible {
    z-index: 5;
}

.flatpickr input[readonly],
input[readonly].flatpickr-input {
    background-color: var(--bs-body-bg);
}

/* Make intl phone number fields full width */
.iti {
    width: 100%;
}

/* Make the switches bigger */
.form-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
    margin-top: 0;
}

.form-check-label {
    padding-top: 0.2rem;
    padding-left: 0.4rem;
}

.clearable {
    cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.03em;
}

h6 {
    font-size: 1.2rem;
}

.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    letter-spacing: -0.03em;
}

h1 {
    font-weight: 700;
    font-size: 2.25rem;
}

h2 {
    font-weight: 700;
    font-size: 2rem;
}

.h6 {
    font-size: 1.2rem;
}

.border-transparent {
    --bs-border-opacity: 1;
    border-color: transparent !important;
}

.stat-icon {
    width: 5rem;
    height: 5rem;
    font-size: 2rem;
    background-color: var(--bs-tertiary-bg);
}

/* Bootstrap gives .table-responsive overflow-x: auto, which also clips the table (header
   background and last row included) to the rounded corners. */
.table-responsive {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--umesh-radius-surface, var(--bs-border-radius));
    box-shadow: var(--umesh-shadow-rest, none);
}

.table-responsive table {
    margin-bottom: 0;
}

.table-responsive tbody tr:last-of-type>* {
    border-bottom: 0;
}

.table-responsive th:first-of-type,
.table-responsive td:first-of-type {
    padding-left: 1rem;
}

.table-responsive th:last-of-type,
.table-responsive td:last-of-type {
    padding-right: 1rem;
}

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

.nav-tabs {
    margin-bottom: 1rem;
}

.nav-breadcrumb {
    font-size: 0.9rem;
}

.umesh-navbar {
    border-bottom: 1px solid #e5e5e5;
}

.jumbotron {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--umesh-radius-surface, var(--bs-border-radius));
    padding: 2rem;
}

.unselectable {
    user-select: none;
}

#map {
    height: 400px;
}

.filepond--item {
    width: calc(25% - 0.5em);
}

.filepond--root.form-control {
    border: none;
}

input[type="color"] {
    height: 3rem;
}

.copy-button {
    cursor: pointer;
}

.dev-banner {
    background-color: #e0035d;
    color: white;
    text-align: center;
    padding: 0.188rem;
}

#rsvp-loading {
    display: none;
}

#rsvp-loading.htmx-request {
    display: block;
}

.glightbox_single,
.glightbox_gallery {
    cursor: pointer;
}

/* Sidebar */
:root {
    --sidebar-expanded: 220px;
    --sidebar-collapsed: 72px;
}

.umesh-layout {
    display: flex;
    min-height: 100dvh;
    background: var(--bs-body-bg);
}

.umesh-sidebar {
    width: var(--sidebar-expanded);
    min-width: var(--sidebar-expanded);
    max-width: var(--sidebar-expanded);
    flex-shrink: 0;
    transition:
        width 0.2s ease,
        min-width 0.2s ease,
        max-width 0.2s ease;
    background: var(--bs-body-bg);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100dvh;
    z-index: 1030;
    /* above content, below modal */
}

/* Tablet width sizing - Bootstrap doesn't handle this specific use case */
@media (min-width: 576px) and (max-width: 991px) {
    .umesh-sidebar {
        width: var(--sidebar-collapsed);
        min-width: var(--sidebar-collapsed);
        max-width: var(--sidebar-collapsed);
    }
}

.umesh-sidebar .sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* The rule under the top bar runs unbroken across the brand row and the top bar. It is a thin
   grey line, and on a mesh's pages a thicker line in the mesh's primary colour (set on
   <body> as --umesh-mesh-rule), or the admin's primary when the mesh has no colour. */
:root {
    --umesh-topbar-rule: 1px solid var(--bs-border-color);
}

.umesh-mesh-page {
    --umesh-topbar-rule: 3px solid var(--umesh-mesh-rule, var(--bs-primary));
}

/* The sidebar's right-hand divider starts below the brand row, so nothing divides the logo
   from the top bar. Without the brand row (the collapsed sidebar) it runs the full height. */
.umesh-sidebar::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: var(--bs-border-color);
    pointer-events: none;
}

@media (min-width: 992px) {
    .umesh-sidebar::after {
        top: 58px;
    }
}

.umesh-sidebar .brand {
    height: 58px;
    border-bottom: var(--umesh-topbar-rule);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.umesh-sidebar nav {
    overflow-y: auto;
    padding: 0.75rem;
    flex-grow: 1;
}

/* Scroll shadows on the sidebar menu (and the mobile offcanvas body). Two layers move with the
   content ("local") and two stay fixed to the box edges ("scroll"). The moving layers are
   covers in the menu's own background; at the top or bottom of the scroll they sit over the
   fixed shadows and hide them, and once content scrolls past an edge they move away and the
   shadow there shows. Links paint above the background, so their hover and active states are
   never covered. The mesh switcher sits outside the scrolling nav, so it stays pinned. */
:root {
    --umesh-scroll-shadow: rgb(0 0 0 / 0.18);
}

.umesh-sidebar nav,
.umesh-offcanvas .offcanvas-body {
    --umesh-scroll-cover: var(--bs-body-bg);
    background:
        linear-gradient(var(--umesh-scroll-cover) 30%, transparent) top / 100% 2rem no-repeat local,
        linear-gradient(transparent, var(--umesh-scroll-cover) 70%) bottom / 100% 2rem no-repeat local,
        linear-gradient(var(--umesh-scroll-shadow), transparent) top / 100% 1rem no-repeat scroll,
        linear-gradient(transparent, var(--umesh-scroll-shadow)) bottom / 100% 1.25rem no-repeat scroll,
        var(--umesh-scroll-cover);
}

/* Sections. Expanded, a section is a quiet uppercase label with its icon, and its links
   underneath start at the same left edge as the icon. In the collapsed sidebar only the
   icon shows, and it opens the section's flyout. */
.umesh-sidebar .menu-section + .menu-section,
.umesh-offcanvas .menu-section + .menu-section {
    margin-top: 1rem;
}

.umesh-sidebar .menu-header,
.umesh-offcanvas .menu-header {
    padding: 0 0.75rem 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--bs-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--umesh-radius-control, 0.375rem);
    transition: background-color 0.15s ease;
}

.umesh-sidebar .menu-header .icon,
.umesh-offcanvas .menu-header .icon {
    width: 1rem;
    font-size: 1rem;
    line-height: 1;
    text-align: center;
}

/* Links sit flush with their section header: same left padding, no indent, so link text
   starts where the header icon does. */
.umesh-sidebar .sub-menu,
.umesh-offcanvas .sub-menu {
    margin-left: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.umesh-sidebar .nav-link,
.umesh-offcanvas .nav-link {
    border-radius: var(--umesh-radius-control, 0.375rem);
    padding: 0.375rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

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

.umesh-sidebar .nav-link .icon,
.umesh-offcanvas .nav-link .icon {
    font-size: 1.1rem;
    line-height: 1;
    min-width: 1.1rem;
}

.umesh-sidebar .nav-link.active,
.umesh-offcanvas .nav-link.active {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.umesh-sidebar .nav-link .badge,
.umesh-offcanvas .nav-link .badge {
    font-weight: 600;
}

/* Collapsed sidebar (tablet): sections become icon buttons that open a flyout, and
   standalone links show only their icon. */
@media (min-width: 576px) and (max-width: 991px) {
    .umesh-sidebar nav {
        padding: 0.5rem;
    }

    .umesh-sidebar .menu-section + .menu-section {
        margin-top: 0.25rem;
    }

    .umesh-sidebar .menu-header {
        justify-content: center;
        padding: 0.75rem;
        cursor: pointer;
        color: var(--bs-body-color);
    }

    .umesh-sidebar .menu-header:hover {
        background: var(--bs-secondary-bg);
    }

    .umesh-sidebar .menu-header .icon {
        width: auto;
        font-size: 1.5rem;
    }

    .umesh-sidebar .nav-link {
        justify-content: center;
        padding: 0.75rem;
    }

    .umesh-sidebar .nav-link .icon {
        font-size: 1.5rem;
    }
}

/* Mesh switcher: a raised block at the top of the sidebar (and the offcanvas menu) naming the
   current mesh, opening a Bootstrap dropdown panel of the user's other meshes. */
.sidebar-switcher {
    padding: 0.75rem 0.75rem 0;
}

.offcanvas-switcher {
    margin-bottom: 1rem;
}

.mesh-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--umesh-radius-surface, var(--bs-border-radius));
    background: var(--bs-body-bg);
    box-shadow: var(--umesh-shadow-rest, none);
    color: var(--bs-body-color);
    text-align: start;
    transition: border-color 0.15s ease;
}

.mesh-switcher-toggle:hover,
.mesh-switcher-toggle[aria-expanded="true"] {
    border-color: var(--bs-secondary-color);
}

.mesh-switcher-toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.mesh-monogram {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--umesh-radius-control, var(--bs-border-radius));
    background: var(--bs-emphasis-color);
    color: var(--bs-body-bg);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.mesh-monogram-sm {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.875rem;
}

.mesh-switcher-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.mesh-switcher-name,
.mesh-switcher-host {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mesh-switcher-name {
    font-weight: 600;
}

.mesh-switcher-host {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
}

.mesh-switcher-chevron {
    flex: 0 0 auto;
    color: var(--bs-secondary-color);
}

.mesh-switcher-panel {
    width: max(100%, 17rem);
    max-width: calc(100vw - 2rem);
    padding: 0.375rem;
}

/* Matches the sidebar section headers */
.mesh-switcher-title {
    padding: 0.375rem 0.5rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--bs-secondary);
}

.mesh-switcher-search {
    padding: 0 0.25rem 0.5rem;
}

.mesh-switcher-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: min(22rem, 60vh);
    margin: 0;
    overflow-y: auto;
}

.mesh-switcher-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.5rem;
    border-radius: var(--umesh-radius-control, var(--bs-border-radius));
    white-space: normal;
}

.mesh-switcher-item:hover,
.mesh-switcher-item:focus,
.mesh-switcher-item[aria-current="page"] {
    background: var(--bs-secondary-bg);
    color: var(--bs-emphasis-color);
}

.mesh-switcher-item-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-weight: 500;
}

.mesh-switcher-check {
    flex: 0 0 auto;
    color: var(--bs-success);
    font-size: 1.1rem;
}

.mesh-switcher-empty {
    margin: 0;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

.mesh-switcher-footer {
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid var(--bs-border-color);
}

.mesh-switcher-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: var(--umesh-radius-control, var(--bs-border-radius));
}

/* Collapsed sidebar (tablet): only the monogram shows, and the panel opens beside it */
@media (min-width: 576px) and (max-width: 991px) {
    .sidebar-switcher {
        padding: 0.5rem 0.5rem 0;
    }

    .sidebar-switcher .mesh-switcher-toggle {
        justify-content: center;
        padding: 0.375rem;
    }

    .sidebar-switcher .mesh-switcher-toggle > .mesh-switcher-text,
    .sidebar-switcher .mesh-switcher-chevron {
        display: none;
    }
}

/* Appearance switch in the user menus (base/appearance_switch.html.j2): a label and a
   three-part segmented control. The active segment (aria-pressed="true", set by
   theme_switcher.js) gets the primary-subtle background. */
.user-menu {
    min-width: 15rem;
}

.appearance-row {
    padding: 0.375rem 1rem 0.5rem;
}

.appearance-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

.appearance-switch {
    display: flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--umesh-radius-control, var(--bs-border-radius));
    background: var(--bs-tertiary-bg);
}

.appearance-option {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    border: 0;
    border-radius: calc(var(--umesh-radius-control, var(--bs-border-radius)) - 2px);
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    cursor: pointer;
}

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

.appearance-option[aria-pressed="true"] {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-weight: 500;
}

.appearance-option:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 1px;
}

/* Content */
.umesh-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    /* Also read by parts that sit over the content and need its colour (theme-preview.css) */
    --umesh-content-bg: #f3f5f6;
    background-color: var(--umesh-content-bg);
}

.content-title {
    background-color: var(--bs-body-bg);
    margin-left: -0.8rem;
    padding-left: 1rem;
    margin-right: -0.7rem;
    padding-right: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    margin-bottom: 1rem;
    margin-top: -0.5rem;
    padding-top: 1rem;
}

/* Top bar across the content area. Its height and border match the sidebar brand row, so
   the two bottom borders form one line. */
.umesh-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 58px;
    padding: 0 1rem;
    border-bottom: var(--umesh-topbar-rule);
    background: var(--bs-body-bg);
}

/* Mobile menu toggle, sized and bordered to match the user pill beside it */
.umesh-topbar-toggle {
    --bs-btn-padding-y: 0.3rem;
    --bs-btn-border-color: var(--bs-border-color);
}

/* Breadcrumbs stay on one line and are cut short with an ellipsis when space runs out */
.umesh-topbar-bread {
    min-width: 0;
    flex: 1 1 auto;
}

.umesh-topbar-bread .breadcrumb {
    flex-wrap: nowrap;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
}

/* Extra specificity keeps these muted over dark.css's link colour */
.umesh-topbar .umesh-topbar-bread .breadcrumb-item a {
    color: var(--bs-secondary-color);
    text-decoration: none;
}

.umesh-topbar .umesh-topbar-bread .breadcrumb-item a:hover {
    color: var(--bs-body-color);
    text-decoration: underline;
}

.umesh-topbar-bread .breadcrumb-item.active {
    color: var(--bs-body-color);
    font-weight: 500;
}

.umesh-topbar-bread .breadcrumb-item:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.umesh-user-pill {
    --bs-btn-padding-x: 0.75rem;
    --bs-btn-padding-y: 0.3rem;
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-bg: var(--bs-secondary-bg);
    --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-active-bg: var(--bs-secondary-bg);
    --bs-btn-active-border-color: var(--bs-border-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 16rem;
    font-weight: 500;
}

/* Quiet pill buttons that sit beside the user pill at the same height; below md only their
   icon shows (the title and visible label give the name). */
.umesh-topbar-button {
    --bs-btn-padding-x: 0.75rem;
    --bs-btn-padding-y: 0.3rem;
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-body-color);
    --bs-btn-hover-bg: var(--bs-secondary-bg);
    --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-active-bg: var(--bs-secondary-bg);
    --bs-btn-active-border-color: var(--bs-border-color);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    white-space: nowrap;
}

.umesh-topbar-button .bi {
    font-size: 1.05rem;
    line-height: 1;
}

/* Top bar buttons and the user pill keep one height, with or without their text */
.umesh-topbar-button,
.umesh-user-pill {
    min-height: 2.25rem;
}

@media (max-width: 767.98px) {
    .umesh-topbar-button__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

.umesh-user-pill .bi-person-circle {
    font-size: 1.15rem;
    line-height: 1;
}

.umesh-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 359.98px) {
    .umesh-user-name {
        display: none;
    }
}

/* Mobile: hide sidebar (Bootstrap also handles with d-none d-sm-block) */
@media (max-width: 575px) {
    .umesh-sidebar {
        display: none;
    }
}

/* Offcanvas menu (mobile); shares the section and link styles above */
.umesh-offcanvas .offcanvas-body {
    padding-top: 0.5rem;
}

/* Flyout menu positioning */
.flyout-menu {
    position: fixed;
    left: 72px;
    margin-left: 0.5rem;
    width: 220px;
    max-width: 220px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--umesh-radius-surface, 0.5rem);
    box-shadow: var(--umesh-shadow-float, 0 0.5rem 1rem rgba(0, 0, 0, 0.15));
    z-index: 1040;
    display: none;
    padding: 0.5rem;
    box-sizing: border-box;
}

.flyout-menu.show {
    display: block;
}

.flyout-menu .nav-link {
    border-radius: var(--umesh-radius-control, 0.375rem);
    margin-bottom: 0.25rem;
    padding: 0.3rem 1rem;
    transition: all 0.15s ease;
    border: none;
    font-weight: 500;
}

.flyout-menu .nav-link:last-child {
    margin-bottom: 0;
}

.flyout-menu .nav-link:hover {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    transform: translateX(0.25rem);
}

.flyout-menu .nav-link.active {
    background: var(--bs-primary);
    color: white;
}

.flyout-menu .nav-link .icon {
    font-size: 1.1rem;
    margin-right: 0.75rem;
}

/* Account for debug bar height */
.dev-banner+.umesh-layout .umesh-sidebar {
    height: calc(100dvh - var(--debug-bar-height, 0px));
}

/* Disabled button styling */
.btn.disabled,
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-outline-secondary.disabled,
.btn-outline-secondary:disabled {
    opacity: 0.5;
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-secondary);
}

.section-header h2.card-title {
    font-weight: 700;
    font-size: 2rem;
}

.delete-button {
    --bs-btn-color: #fff;
    --bs-btn-bg: #dc3545;
    --bs-btn-border-color: #dc3545;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #bb2d3b;
    --bs-btn-hover-border-color: #b02a37;
    --bs-btn-focus-shadow-rgb: 225, 83, 97;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #b02a37;
    --bs-btn-active-border-color: #a52834;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #dc3545;
    --bs-btn-disabled-border-color: #dc3545;
}

.mt-not-first:not(:first-of-type) {
    margin-top: 2rem;
}

.row-is-header td {
    background-color: #cfe2ff;
    font-weight: bold;
}
/* Gallery-mode list view images (first used by the Photos admin page) */
.gallery-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.375rem;
}

/* Arrange Photos: one row per photo, with a drag handle and Move up/down buttons */
.photo-arrange-thumbnail {
    width: 48px;
    height: 48px;
    flex: none;
    object-fit: cover;
    border-radius: 0.25rem;
}

.photo-arrange-place {
    min-width: 1.5rem;
    text-align: end;
}

.photo-arrange-handle {
    cursor: grab;
}

.photo-arrange-list .sortable-ghost {
    opacity: 0.4;
}

/* Member post index and article presentation */
.post-meta {
    color: color-mix(in srgb, currentColor 62%, transparent);
}

.post-featured-image {
    display: block;
    width: 100%;
    object-fit: cover;
}

.post-pinned-card .post-featured-image {
    aspect-ratio: 16 / 9;
}

.post-list-image {
    min-height: 100%;
    aspect-ratio: 4 / 3;
}

.post-hero-image {
    max-height: 560px;
    aspect-ratio: 16 / 7;
    border-radius: 0.75rem;
}

.post-gallery-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.4rem;
}

.post-excerpt > :last-child,
.post-body > :last-child {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .post-list-image {
        aspect-ratio: 16 / 9;
    }

    .post-hero-image {
        aspect-ratio: 16 / 9;
    }
}

/* In a right-to-left page, arrows and the reply mark point the other way: back is to the
   right and forward to the left. */
[dir="rtl"] :is(.bi-arrow-left, .bi-arrow-right, .bi-reply, .bi-reply-fill)::before {
    transform: scaleX(-1);
}

/* The card form's live preview (page/card_preview_field.html.j2): inert_canvas.js stops clicks
   on the card, so its links and buttons don't look clickable, and embedded players, which
   scripts can't stop, ignore the pointer. (The Modern preview's are in modern-builder.css.) */
#card_preview_target :is(a, button, summary, label, [role="button"], [class*="glightbox"], [data-gallery]) {
    cursor: default;
}

#card_preview_target :is(iframe, video, audio, embed, object) {
    pointer-events: none;
}

/* Space selector between the People and Content sections of a mesh's admin menu. The
   Content section it swaps sits in a wrapper, so it gets the gap sections have between them. */
.umesh-sidebar .space-selector,
.umesh-offcanvas .space-selector,
.umesh-sidebar .space-content-menu > .menu-section,
.umesh-offcanvas .space-content-menu > .menu-section {
    margin-top: 1rem;
}

.space-selector-label {
    display: block;
    width: 100%;
    padding: 0 0.75rem;
}

.space-selector-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--bs-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.space-selector-title .icon {
    width: 1rem;
    font-size: 1rem;
    line-height: 1;
    text-align: center;
}

@media (min-width: 576px) and (max-width: 991px) {
    .umesh-sidebar .space-content-menu > .menu-section {
        margin-top: 0.25rem;
    }
}

/* Notification bell in the admin top bar (notifications/_admin_bell.html.j2): a quiet pill
   button like its neighbours, with the unread count in a badge on its corner. */
.admin-bell-button {
    position: relative;
}

.admin-bell .notification-badge {
    position: absolute;
    top: -0.35rem;
    inset-inline-end: -0.35rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--bs-danger);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25rem;
    text-align: center;
}

.admin-bell .notification-badge[data-unread-count="0"],
.admin-bell .notification-badge[data-unread-total="0"] {
    display: none;
}

.admin-bell-menu {
    width: min(24rem, calc(100vw - 2rem));
    padding: 0;
    overflow: hidden;
}

.admin-bell-header,
.admin-bell-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
}

.admin-bell-header {
    border-bottom: 1px solid var(--bs-border-color);
}

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

.admin-bell-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.admin-bell-message {
    margin: 0;
    padding: 1rem 0.9rem;
    font-size: 0.875rem;
}

.admin-bell-list {
    max-height: min(26rem, 60vh);
    overflow-y: auto;
}

/* One notification: icon, text with its time underneath, and a dot while unread */
.admin-notification {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.9rem;
    color: var(--bs-body-color);
    text-decoration: none;
}

.admin-notification:hover,
.admin-notification:focus-visible {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.admin-bell-list li + li .admin-notification,
.admin-notification-list li + li .admin-notification {
    border-top: 1px solid var(--bs-border-color-translucent);
}

.admin-notification-icon {
    flex: none;
    margin-top: 0.1rem;
    color: var(--bs-secondary-color);
}

.admin-notification-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    font-size: 0.875rem;
}

.admin-notification.is-unread .admin-notification-text {
    font-weight: 600;
}

.admin-notification-dot {
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.4rem;
    border-radius: 50%;
    background: var(--bs-primary);
}

/* Phineas repeat fields: the handle that drags a row, and the row while it's dragged. */
.ab-repeat-handle {
    cursor: grab;
}

.ab-repeat-dragging {
    opacity: 0.5;
}

/* Automations: "Check a member" shows the condition tree as nested lists, each level
   indented beside a rule (app/templates/automation/check_result.html.j2) */
.automation-check-tree {
    list-style: none;
    margin: 0.25rem 0 0 0.35rem;
    padding-inline-start: 1rem;
    border-inline-start: 2px solid var(--bs-border-color);
}

.automation-check-tree > li {
    margin: 0.35rem 0;
}

.automation-check-tree.automation-check-root {
    margin-inline-start: 0;
    padding-inline-start: 0;
    border-inline-start: 0;
}

/* Automations: on phones each step's label and buttons share the first line, and its
   settings take the full width below, so long action names and pick-lists aren't cut short */
@media (max-width: 575.98px) {
    .ab-repeat.field-actions .ab-repeat-row {
        flex-wrap: wrap;
    }

    .ab-repeat.field-actions .ab-repeat-actions {
        margin-inline-start: auto;
    }

    .ab-repeat.field-actions .ab-repeat-fields {
        order: 1;
        flex: 1 1 100%;
        min-width: 0;
    }

    .ab-repeat.field-actions .ab-repeat-field {
        flex: 1 1 100%;
        min-width: 0;
    }

    .ab-repeat.field-actions .ab-repeat-field .form-select,
    .ab-repeat.field-actions .ab-repeat-field .form-control {
        width: 100%;
    }
}

/* Admin toasts (automation/_toast_stack.html.j2): bottom corner on wide screens, full
   width with a 16px gutter on phones. The stack lets clicks through around its toasts. */
.umesh-toasts {
    position: fixed;
    bottom: 0;
    inset-inline-end: 0;
    z-index: 1090;
    padding: 16px;
    max-height: 100vh;
    overflow-y: auto;
    pointer-events: none;
}

.umesh-toasts .toast {
    pointer-events: auto;
}

.umesh-automation-toast {
    width: 400px;
    max-width: 100%;
    background-color: var(--bs-body-bg);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.umesh-automation-toast .toast-header {
    gap: 0.5rem;
}

.umesh-automation-toast__icon {
    color: var(--bs-primary);
}

.umesh-automation-toast__lines {
    list-style: none;
    margin: 0;
    padding: 0;
}

.umesh-automation-toast__line + .umesh-automation-toast__line {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}

.umesh-automation-toast__text {
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

.umesh-automation-toast__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.umesh-automation-toast .htmx-indicator {
    display: none;
}

.umesh-automation-toast .htmx-request .htmx-indicator,
.umesh-automation-toast .htmx-request.htmx-indicator {
    display: inline-block;
}

.umesh-automation-toast__more {
    margin: 0.75rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}

@media (max-width: 575.98px) {
    .umesh-toasts {
        inset-inline-start: 0;
    }

    .umesh-automation-toast {
        width: 100%;
    }
}

/* A list column headed by a form question: at most two lines, the whole question on hover */
.list-question {
    display: -webkit-box;
    min-width: 8rem;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}
