html, body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.app-title {
    color: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    margin-left: 12px;
    text-decoration: none;
}

.app-environment {
    background: var(--mud-palette-warning);
    border-radius: 4px;
    color: var(--mud-palette-warning-text);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-left: 8px;
    padding: 1px 6px;
    vertical-align: 2px;
}

.centered-spinner {
    left: 50%;
    position: fixed;
    top: 40%;
}

.login-overlay {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 380px;
    padding: 40px 32px;
    width: 100%;
}

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

/* Area "Runs": comparison runs, comparisons, runs without benchmark. */
.page-header {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.list-filters,
.new-run-selection,
.new-run-thresholds,
.run-target-picker,
.new-run-testing-target {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.list-filters > *,
.new-run-selection > *,
.new-run-thresholds > *,
.run-target-picker > * {
    flex: 1 1 220px;
    max-width: 420px;
}

.new-run-testing-target > .run-target-picker {
    flex: 1 1 auto;
    margin-bottom: 0;
}

.list-filters > .mud-button-root {
    flex: 0 0 auto;
}

.run-progress {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 260px;
}

.run-progress-bar {
    flex: 1 1 120px;
}

.run-progress-text,
.run-author,
.comparison-metadata,
.route-status {
    color: var(--mud-palette-text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.route-status {
    white-space: normal;
}

.run-progress-failed {
    color: var(--mud-palette-warning-darken);
}

.run-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    margin-bottom: 12px;
}

.run-failed-item {
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.result-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.comparison-sort {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
    white-space: nowrap;
}

.comparison-sort-active {
    font-weight: 700;
}

.route-compare-map {
    height: 520px;
    width: 100%;
}

.route-compare-legend {
    display: flex;
    font-size: 0.85rem;
    gap: 16px;
    margin-top: 4px;
}

.route-legend-benchmark {
    color: #1e6fd9;
}

.route-legend-testing {
    color: #d92d20;
}

/* The id of the compared route under the provider and map of its column. */
.comparison-route {
    font-size: 0.8rem;
    font-weight: 400;
}

/* A route that a page names but that is not stored any more (RouteLink): text, not a link. */
.route-missing {
    color: var(--mud-palette-text-secondary);
    text-decoration: line-through;
}

/* Area Routing: Calculate and Tools pages. */
.route-map {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.route-swatch {
    border-radius: 3px;
    display: inline-block;
    height: 14px;
    vertical-align: middle;
    width: 14px;
}

.route-number {
    text-align: right;
    white-space: nowrap;
}

.route-actions {
    text-align: right;
    white-space: nowrap;
}

.route-map-name,
.target-version,
.target-kind {
    color: var(--mud-palette-text-secondary);
    font-size: 0.8rem;
    margin-left: 8px;
}

.route-alternatives {
    border-collapse: collapse;
    margin-top: 4px;
}

.route-alternatives th,
.route-alternatives td {
    border-bottom: 1px solid var(--mud-palette-lines-default);
    font-size: 0.8rem;
    padding: 2px 12px 2px 0;
}

.route-alternatives th {
    text-align: left;
}

.route-alternatives th.route-number {
    text-align: right;
}

/* Engines and Maps pages: filter row above the list. */
.list-toolbar {
    gap: 16px;
}

.list-toolbar > .list-search {
    flex: 1 1 280px;
    max-width: 420px;
}

/* Maps page: the table has to fit a window of 1600 pixels without horizontal scrolling. */
.maps-table .mud-table-cell {
    padding-left: 8px;
    padding-right: 8px;
}

.map-name-cell {
    max-width: 280px;
    overflow-wrap: anywhere;
}

.map-identifier {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
}

.map-error {
    font-size: 0.75rem;
    max-width: 200px;
    overflow-wrap: anywhere;
}

.map-license-cell .mud-select {
    max-width: 200px;
    min-width: 150px;
}

/* Two lines of the notes; the whole text is the tooltip of the cell. */
.map-notes {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    max-width: 220px;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.map-actions {
    white-space: nowrap;
}

/* Map layer control (Components/MapLayers/MapLayerControl.razor): a panel in the top right corner of
   a map. The element that holds the map carries .map-with-layers. */
.map-with-layers {
    position: relative;
}

.map-layer-control {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
    color: #222;
    font-size: 0.8rem;
    line-height: 1.5;
    max-width: 220px;
    padding: 4px 8px;
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
}

.map-layer-control summary {
    cursor: pointer;
    font-weight: 600;
}

.map-layer-control label {
    cursor: pointer;
    display: block;
    white-space: nowrap;
}

.map-layer-control input {
    margin-right: 4px;
    vertical-align: middle;
}

.map-layer-control-group + .map-layer-control-group {
    border-top: 1px solid #ccc;
    margin-top: 4px;
    padding-top: 4px;
}

.map-layer-control label.map-layer-unavailable {
    color: #888;
    cursor: not-allowed;
}

.map-layer-control-notice {
    border-top: 1px solid #ccc;
    color: #8a4b00;
    margin-top: 4px;
    padding-top: 4px;
    white-space: normal;
}

/* Routes page and the view of one route (Pages/Routes/). The list has to fit a laptop window with a
   whole input hash in it: narrow cell padding (the selector has to outweigh the one of the dense table
   of the component library), short cells on one line, the hash set smaller. */
.routes-list.mud-table-dense * .mud-table-row .mud-table-cell {
    padding-left: 8px;
    padding-right: 8px;
}

.routes-table .route-cell-short {
    white-space: nowrap;
}

.routes-table .route-hash {
    font-size: 0.8rem;
}

.routes-table .route-success,
.routes-table .route-failed {
    vertical-align: middle;
}

.route-facts-table th {
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}

.route-facts-table code {
    word-break: break-all;
}

/* Legend of a map with more than one line (Components/Legend/RouteLegend.razor): a button per route in
   the colour of its lines and, for a route with alternatives, a button per line. A hidden line is an
   outlined, struck-through button. */
.route-legend {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
}

.route-legend-group {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.route-legend-chip {
    background: var(--route-color);
    border: 2px solid var(--route-color);
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 2px 10px;
}

.route-legend-chip.route-legend-line {
    font-size: 0.72rem;
    padding: 1px 8px;
}

.route-legend-chip.route-legend-alternative {
    border-color: rgba(255, 255, 255, 0.85);
    border-style: dashed;
}

.route-legend-chip[aria-pressed="false"] {
    background: transparent;
    border-color: var(--route-color);
    color: var(--route-color);
    text-decoration: line-through;
}

.route-legend-chip:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35);
    outline: 2px solid #fff;
}

.route-legend-spacer {
    flex: 1 1 auto;
}

/* Report detail: the routes table (nine columns with a whole input hash) has to fit its card in a window
   of 1366 pixels. Narrow cell padding (the selector has to outweigh the one of the dense table of the
   component library), the hash set smaller, short cells on one line. */
.report-routes-table.mud-table-dense * tr td,
.report-routes-table.mud-table-dense * tr th {
    padding-left: 6px;
    padding-right: 6px;
}

.report-routes-table code {
    font-size: 0.75rem;
}

.report-routes-table th {
    white-space: nowrap;
}

/* Comparison lists: the values of the main route and of both alternatives as groups of three columns
   (the old _Comparisons.cshtml). Narrow cells, so the list with alternatives fits a window of 1366 pixels. */
.comparison-values-table .mud-table-head th.comparison-group {
    border-left: 1px solid var(--mud-palette-table-lines);
    text-align: center;
}

.comparison-values-table th.comparison-group-start,
.comparison-values-table td.comparison-group-start {
    border-left: 1px solid var(--mud-palette-table-lines);
}

.comparison-values-table td.comparison-value {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.comparison-values-table.comparison-values-wide.mud-table-dense * tr td,
.comparison-values-table.comparison-values-wide.mud-table-dense * tr th {
    font-size: 0.8rem;
    padding: 4px;
}

/* With nine value columns the texts of a row may break: coordinates, the metadata of the input, the name of the run. */
.comparison-values-table.comparison-values-wide .comparison-points,
.comparison-values-table.comparison-values-wide .comparison-metadata,
.comparison-values-table.comparison-values-wide .comparison-run-link {
    overflow-wrap: anywhere;
    white-space: normal;
}

.comparison-values-table.comparison-values-wide .mud-chip {
    font-size: 0.7rem;
    margin: 0;
    padding: 0 6px;
}

/* A header of a comparison list that cannot sort here: text with the reason as its title. */
.comparison-sort-off {
    cursor: help;
    white-space: nowrap;
}

/* The buttons of a page header keep their text on one line; a header with many buttons breaks into two rows. */
.page-header {
    flex-wrap: wrap;
}

.page-header .mud-button-root {
    white-space: nowrap;
}

/* Comparison detail: "Next difference" next to the legend, the copy buttons of the polylines. */
.route-compare-legend {
    align-items: flex-start;
    flex-wrap: wrap;
}

.comparison-difference {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    margin-left: auto;
}

.comparison-difference-position {
    color: var(--mud-palette-text-secondary);
}

.copy-text.mud-icon-button {
    padding: 2px;
}

.copy-text .mud-icon-root {
    font-size: 1rem;
}

/* The sign of a broken restriction on a map (BrokenRestrictionLayers). */
.broken-restriction-icon {
    cursor: pointer;
}
