:root {
    --omni-primary: #045282;
    --omni-primary-hover: #05699F;
    --omni-primary-active: #023D61;
    --omni-primary-rgb: 4, 82, 130;
    --omni-dark: #023546;
    --omni-background: #F7FAFC;
    --omni-surface: #FFFFFF;
    --tblr-primary: var(--omni-primary);
    --tblr-primary-rgb: var(--omni-primary-rgb);
    --tblr-body-bg: var(--omni-background);
    --tblr-bg-surface: var(--omni-surface);
    --tblr-link-color: var(--omni-primary);
    --tblr-link-hover-color: var(--omni-primary-hover);
}

body {
    background: var(--omni-background);
}

.omni-seo-landing {
    background: var(--omni-background);
    color: var(--omni-dark);
}

.omni-seo-landing h1 {
    font-size: 2.5rem;
    line-height: 1.1;
}

.omni-seo-logo {
    width: min(14rem, 70vw);
    height: auto;
}

.omni-seo-cover {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 8px;
}

.omni-seo-landing nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.omni-event-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-top-left-radius: var(--tblr-border-radius);
    border-top-right-radius: var(--tblr-border-radius);
    display: block;
    object-fit: cover;
}

.omni-cover-crop-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--tblr-border-radius);
    border: 1px solid var(--tblr-border-color);
    background: #000;
    cursor: grab;
    touch-action: none;
}

.omni-cover-crop-frame.omni-cover-crop-dragging {
    cursor: grabbing;
}

.omni-cover-crop-image {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

.omni-event-list-image {
    width: 64px;
    height: 64px;
    aspect-ratio: 1 / 1;
    border-radius: var(--tblr-border-radius);
    object-fit: cover;
    flex-shrink: 0;
}

.omni-event-hero-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: cover;
}

.card,
.modal-content,
.dropdown-menu {
    background-color: var(--omni-surface);
}

.navbar:not(.navbar-dark) .navbar-brand.omni-brand {
    color: var(--omni-dark);
}

.navbar-brand.omni-brand {
    display: inline-flex;
    gap: 0.625rem;
    align-items: center;
    font-weight: 700;
}

.omni-brand-logo {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    object-fit: contain;
}

.navbar-dark .omni-brand-logo {
    filter: brightness(0) invert(1);
}

.btn-primary {
    --tblr-btn-bg: var(--omni-primary);
    --tblr-btn-border-color: var(--omni-primary);
    --tblr-btn-hover-bg: var(--omni-primary-hover);
    --tblr-btn-hover-border-color: var(--omni-primary-hover);
    --tblr-btn-active-bg: var(--omni-primary-active);
    --tblr-btn-active-border-color: var(--omni-primary-active);
}

.btn-outline-primary {
    --tblr-btn-color: var(--omni-primary);
    --tblr-btn-border-color: var(--omni-primary);
    --tblr-btn-hover-bg: var(--omni-primary);
    --tblr-btn-hover-border-color: var(--omni-primary);
    --tblr-btn-active-bg: var(--omni-primary-active);
    --tblr-btn-active-border-color: var(--omni-primary-active);
}

/* Workspace widgets: a collapsed row (title + one-line summary) that
   expands to the full widget. The summary truncates on one line; on
   phones it drops below the title instead of squeezing it. */
.workspace-widget-header {
    display: flex;
    align-items: stretch;
}

/* touch-action: none keeps a finger drag on the handle from scrolling
   the page instead of moving the row. */
.workspace-widget-handle {
    flex-shrink: 0;
    width: 2.5rem;
    padding: 0;
    background: none;
    border: 0;
    color: var(--tblr-secondary);
    font-size: 1.1rem;
    line-height: 1;
    cursor: grab;
    touch-action: none;
}

.workspace-widget-handle:active {
    cursor: grabbing;
}

.workspace-widget.is-dragging {
    position: relative;
    z-index: 2;
    box-shadow: 0 0.5rem 1.5rem rgba(29, 39, 59, 0.18);
    opacity: 0.95;
}

body.workspace-is-dragging {
    user-select: none;
    cursor: grabbing;
}

.workspace-widget-toggle {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.75rem 0;
    background: none;
    border: 0;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.workspace-widget-title {
    flex-shrink: 0;
    font-weight: 600;
}

.workspace-widget-summary {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.workspace-widget-chevron {
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.workspace-widget.is-expanded .workspace-widget-chevron {
    transform: rotate(180deg);
}

.workspace-widget-body {
    display: none;
    border-top: 1px solid var(--tblr-border-color);
}

.workspace-widget.is-expanded .workspace-widget-body {
    display: block;
}

@media (max-width: 575.98px) {
    .workspace-widget-toggle {
        flex-wrap: wrap;
        row-gap: 0.125rem;
    }

    .workspace-widget-title {
        flex: 1 1 auto;
    }

    .workspace-widget-summary {
        order: 3;
        flex-basis: 100%;
    }
}

.workspace-customize-menu {
    max-height: 60vh;
    overflow-y: auto;
}

/* Tabler's .btn sets position: relative, which hijacks .stretched-link's
   ::after anchor so it only covers the button instead of the card/row. */
.btn.stretched-link {
    position: static;
}


/* Tabler's container pads 0.5rem per side, but .g-4/.g-5 rows pull out
   0.75rem/1.5rem, so on phones the row sticks out of the viewport and
   the page scrolls sideways. Below sm the horizontal gutter matches the
   container padding; vertical gutters are unchanged. */
@media (max-width: 575.98px) {
    .row.g-4,
    .row.gx-4,
    .row.g-5,
    .row.gx-5 {
        --tblr-gutter-x: 1rem;
    }
}

/* Lets a flex child shrink below its content width so .text-truncate
   inside it can ellipsize instead of pushing siblings off-screen. */
.min-w-0 {
    min-width: 0 !important;
}

/* A table as a spreadsheet's sheet (the runs' leg times): a grid, filled
   cells, tight rows, the header, the first two columns and the last row
   in place while it scrolls. Separate borders: collapsed ones scroll
   away from under sticky cells. */
.omni-sheet {
    --omni-sheet-line: #d5d9df;
    --omni-sheet-head: #f1f3f5;
    --omni-sheet-rank-width: 4.5rem;
    --omni-sheet-name-width: 6.5rem;
    width: fit-content;
    max-width: 100%;
    max-height: 80vh;
    overflow: auto;
    border: 1px solid var(--omni-sheet-line);
    background: var(--tblr-bg-surface, #fff);
}

.omni-sheet table {
    width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.omni-sheet th,
.omni-sheet td {
    position: relative;
    height: 1.75rem;
    padding: 0.2rem 0.4rem;
    border-right: 1px solid var(--omni-sheet-line);
    border-bottom: 1px solid var(--omni-sheet-line);
    vertical-align: middle;
    white-space: nowrap;
    background: var(--tblr-bg-surface, #fff);
}

.omni-sheet thead th,
.omni-sheet tfoot td {
    position: sticky;
    z-index: 2;
    background: var(--omni-sheet-head);
}

.omni-sheet thead th {
    top: 0;
    font-weight: 600;
}

.omni-sheet tfoot td {
    bottom: 0;
    border-top: 1px solid var(--omni-sheet-line);
}

.omni-sheet .omni-sheet-rank,
.omni-sheet .omni-sheet-name {
    position: sticky;
    z-index: 1;
}

.omni-sheet .omni-sheet-rank {
    left: 0;
    width: var(--omni-sheet-rank-width);
    min-width: var(--omni-sheet-rank-width);
    max-width: var(--omni-sheet-rank-width);
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    background: var(--omni-sheet-head);
}

.omni-sheet .omni-sheet-name {
    left: var(--omni-sheet-rank-width);
    width: var(--omni-sheet-name-width);
    min-width: var(--omni-sheet-name-width);
    max-width: var(--omni-sheet-name-width);
    overflow-wrap: anywhere;
    white-space: normal;
}

.omni-sheet .omni-sheet-total {
    border-right-width: 2px;
}

/* the whole run's time stays beside the team; no room for it on a phone */
@media (min-width: 576px) {
    .omni-sheet .omni-sheet-total {
        position: sticky;
        left: calc(var(--omni-sheet-rank-width) + var(--omni-sheet-name-width));
        z-index: 1;
    }

    .omni-sheet thead .omni-sheet-total,
    .omni-sheet tfoot .omni-sheet-total {
        z-index: 3;
    }
}

.omni-sheet thead .omni-sheet-rank,
.omni-sheet thead .omni-sheet-name,
.omni-sheet tfoot .omni-sheet-rank,
.omni-sheet tfoot .omni-sheet-name {
    z-index: 3;
}

.omni-sheet tr.table-active td {
    background: #dbe7f7;
}

/* the colour fills the whole cell */
.omni-sheet .omni-sheet-cell {
    display: block;
    margin: -0.2rem -0.4rem;
    padding: 0.2rem 0.4rem;
}

.omni-sheet .omni-sheet-cell:hover,
.omni-sheet .omni-sheet-cell:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: -2px;
}

@media (max-width: 575.98px) {
    .omni-sheet {
        --omni-sheet-rank-width: 2.25rem;
        --omni-sheet-name-width: 4.5rem;
    }
}

[data-bs-theme="dark"] .omni-sheet {
    --omni-sheet-line: #3a4859;
    --omni-sheet-head: #223041;
}

/* Diagnostics: a participant on one line. Long values are cut (whole on
   hover) instead of broken letter by letter in a squeezed column. */
.omni-diagnostics-table {
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.omni-diagnostics-table.table > tbody > tr > td {
    height: 1.75rem;
    padding: 0.15rem 0.4rem;
    white-space: nowrap;
    line-height: 1.2;
}

.omni-diagnostics-table.table > thead > tr > th {
    padding: 0.3rem 0.4rem;
    line-height: 1.15;
    vertical-align: bottom;
}

.omni-diagnostics-table .diagnostics-sort {
    font-size: inherit;
    line-height: inherit;
    text-align: left;
    white-space: normal;
}

.omni-diagnostics-table .omni-diagnostics-who {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.omni-diagnostics-table .omni-diagnostics-tracker {
    width: 6.5rem;
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
