/*
 * Shopfloor wallboard. Everything is sized in rem and the root font size follows the screen (16px at 1920x1080, 32px at
 * 3840x2160), so a board looks the same on a 1080p TV and a 4K one. No scrollbars anywhere: lanes page their cards instead.
 * Light and dark: follows the screen (prefers-color-scheme) unless the url / theme button forces one (data-theme).
 *
 * The area, priority, status and red / amber / green colours are the shared --wm-* tokens (wm-tokens.css, linked first).
 * This file only adds the kiosk theme (--wb-*: surfaces, text, borders) and the dark-theme values of the shared tokens
 * the board needs to be legible on a dark screen.
 */

:root {
    --wb-bg: #e9edf2;
    --wb-surface: #ffffff;
    --wb-surface-2: #f3f6fa;
    --wb-text: #14202e;
    --wb-muted: #5b6978;
    --wb-border: #cfd7e1;

    --wb-green: var(--wm-rag-green-ink);
    --wb-green-bg: var(--wm-rag-green-tint);
    --wb-amber: var(--wm-rag-amber-ink);
    --wb-amber-bg: var(--wm-rag-amber-tint);
    --wb-red: var(--wm-rag-red-ink);
    --wb-red-bg: var(--wm-rag-red-tint);
    --wb-blue: var(--wm-colour-status-assigned);

    --wb-shadow: 0 1px 2px rgba(20, 32, 46, .12);

    --wb-card-h: 5.2rem;
    --wb-card-gap: .4rem;

    /* the spacing of the board: one gap between the small blocks, a larger one between the top row, the metric tiles and the lanes */
    --wb-gap: .5rem;
    --wb-gap-lanes: .5rem;
    --wb-gap-section: 1rem;
    --wb-top-h: 6.6rem;

    /* the five columns of the lanes; the top row uses the same ones, so a figure sits over the lane it describes */
    --wb-lane-columns: 1fr 1fr 1.1fr 1fr 1.05fr;

    /* the colour of each lane (the top row borrows it) */
    --wb-lane-created: var(--wm-colour-status-created);
    --wb-lane-assigned: var(--wm-colour-status-assigned);
    --wb-lane-inprogress: var(--wm-colour-status-active);
    --wb-lane-completed: var(--wm-colour-status-completed);

    /* the leaderboard medals */
    --wb-gold: #c9a227;
    --wb-silver: #8d99a6;
    --wb-bronze: #b0743d;

    /* the kiosk theme for the shared dashboard components (Sparkline, KpiTile in its board size) */
    --wm-chart-accent: var(--wb-blue);
    --wm-chart-track: var(--wb-border);
    --wm-chart-text: var(--wb-text);
    --wm-chart-muted: var(--wb-muted);

    --kpi-surface: var(--wb-surface);
    --kpi-border: var(--wb-border);
    --kpi-muted: var(--wb-muted);
    --kpi-text: var(--wb-text);
    --kpi-shadow: var(--wb-shadow);
}

:root[data-theme="dark"] {
    --wb-bg: #0b1017;
    --wb-surface: #151d28;
    --wb-surface-2: #1b2532;
    --wb-text: #e8eef5;
    --wb-muted: #98a7b8;
    --wb-border: #2a3646;

    --wm-rag-green-ink: #4cc27a;
    --wm-rag-green-tint: #123a24;
    --wm-rag-amber-ink: #ffc53d;
    --wm-rag-amber-tint: #4a3a0a;
    --wm-rag-red-ink: #ff6b6b;
    --wm-rag-red-tint: #4d1a1a;
    --wb-blue: #6aa8f0;

    /* app-level overrides of the shared priority colours: the light-theme blues are too dark on a dark screen */
    --wm-colour-priority-high: #4f86c0;
    --wm-colour-priority-medium: #5f87a8;
    --wm-colour-priority-low: #7e97a9;

    --wb-shadow: none;
    --wb-lane-created: #8a949e;
    --wb-lane-assigned: #4f8fd6;
    --wb-lane-inprogress: #d9a620;
    --wb-gold: #e0b93b;
    --wb-silver: #aab6c3;
    --wb-bronze: #cf8d52;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --wb-bg: #0b1017;
        --wb-surface: #151d28;
        --wb-surface-2: #1b2532;
        --wb-text: #e8eef5;
        --wb-muted: #98a7b8;
        --wb-border: #2a3646;

        --wm-rag-green-ink: #4cc27a;
        --wm-rag-green-tint: #123a24;
        --wm-rag-amber-ink: #ffc53d;
        --wm-rag-amber-tint: #4a3a0a;
        --wm-rag-red-ink: #ff6b6b;
        --wm-rag-red-tint: #4d1a1a;
        --wb-blue: #6aa8f0;

        --wm-colour-priority-high: #4f86c0;
        --wm-colour-priority-medium: #5f87a8;
        --wm-colour-priority-low: #7e97a9;

        --wb-shadow: none;
        --wb-lane-created: #8a949e;
        --wb-lane-assigned: #4f8fd6;
        --wb-lane-inprogress: #d9a620;
        --wb-gold: #e0b93b;
        --wb-silver: #aab6c3;
        --wb-bronze: #cf8d52;
    }
}

html {
    font-size: clamp(8px, min(calc(100vw / 120), calc(100vh / 67.5)), 44px);
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    background: var(--wb-bg);
    color: var(--wb-text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.25;
    -webkit-font-smoothing: antialiased;
    cursor: default;
}

a {
    color: var(--wb-blue);
}

h1 {
    margin: 0;
}

.wb-app {
    height: 100vh;
}

.wb-mono {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.wb-muted {
    color: var(--wb-muted);
}

/* ---------- messages: setup, awaiting approval, errors ---------- */

.wb-message, .wb-setup {
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.wb-message h1, .wb-setup h1 {
    font-size: 3rem;
    font-weight: 700;
}

.wb-message p, .wb-setup p {
    margin: 0;
    max-width: 60rem;
    font-size: 1.6rem;
    color: var(--wb-muted);
}

.wb-message-sub {
    font-size: 1.2rem !important;
}

.wb-message-icon {
    font-size: 7rem;
    color: var(--wb-amber);
    line-height: 1;
}

.wb-bad {
    color: var(--wb-red);
}

.wb-spinner {
    width: 5rem;
    height: 5rem;
    border-width: .5rem;
    color: var(--wb-blue);
}

/* the spinner and the screen-reader text (no bootstrap on a wallboard) */
.spinner-border {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    vertical-align: -.15em;
    border: .18em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: wb-spin .75s linear infinite;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

@keyframes wb-spin {
    to { transform: rotate(360deg); }
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.wb-pulse {
    animation: wb-pulse 2s ease-in-out infinite;
}

@keyframes wb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.wb-setup-form {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    width: 34rem;
    text-align: left;
}

.wb-setup-form label {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: .4rem;
}

.wb-input {
    font-size: 1.6rem;
    padding: .5rem .8rem;
    border: 2px solid var(--wb-border);
    border-radius: .5rem;
    background: var(--wb-surface);
    color: var(--wb-text);
}

.wb-input:focus {
    outline: none;
    border-color: var(--wb-blue);
}

.wb-button {
    margin-top: 1rem;
    font-size: 1.6rem;
    font-weight: 700;
    padding: .7rem 1rem;
    border: 0;
    border-radius: .5rem;
    background: var(--wb-blue);
    color: #fff;
    cursor: pointer;
}

.wb-button:disabled {
    opacity: .6;
}

.wb-button-secondary {
    background: transparent;
    color: var(--wb-blue);
    border: 2px solid var(--wb-blue);
    margin-top: .4rem;
}

.wb-alert {
    padding: .6rem .8rem;
    border-radius: .5rem;
    font-size: 1.2rem;
}

.wb-alert-bad {
    background: var(--wb-red-bg);
    color: var(--wb-red);
}

.wb-setup-note, .wb-setup-current {
    font-size: 1.15rem !important;
}

/* ---------- the board ---------- */

.wb-board {
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--wb-gap);
    padding: .6rem .8rem .7rem;
}

.wb-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 2.6rem;
}

.wb-title {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.wb-title h1 {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: .01em;
}

.wb-title-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.wb-header-mid {
    display: flex;
    gap: 1.6rem;
    color: var(--wb-muted);
    font-size: 1.15rem;
}

.wb-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.15rem;
}

.wb-clock {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.wb-updated {
    color: var(--wb-muted);
    font-variant-numeric: tabular-nums;
}

.wb-live {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .7rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.wb-live-on { background: var(--wb-green-bg); color: var(--wb-green); }
.wb-live-wait { background: var(--wb-amber-bg); color: var(--wb-amber); }
.wb-live-off { background: var(--wb-red-bg); color: var(--wb-red); }

.wb-theme-button {
    border: 1px solid var(--wb-border);
    background: var(--wb-surface);
    color: var(--wb-muted);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
    cursor: pointer;
    opacity: .6;
}

.wb-theme-button:hover { opacity: 1; }

.wb-stale {
    flex: none;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem .9rem;
    border-radius: .5rem;
    background: var(--wb-amber-bg);
    color: var(--wb-amber);
    border: 2px solid var(--wb-amber);
    font-size: 1.2rem;
    font-weight: 700;
}

.wb-stale-bad {
    background: var(--wb-red-bg);
    color: var(--wb-red);
    border-color: var(--wb-red);
}

.wb-nodata {
    flex: none;
    padding: 1rem;
    text-align: center;
    color: var(--wb-muted);
    font-size: 1.4rem;
}

/* ---------- top row and metric tiles ---------- */

/* the whitespace: tiles of one row are --wb-gap apart, the three blocks of the board (top row, metric tiles, lanes) are
   --wb-gap-section apart */
.wb-kpis {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: var(--wb-gap-section);
    /* the board's own gap is added below this block as well, so the lanes are --wb-gap-section away too */
    margin-bottom: calc(var(--wb-gap-section) - var(--wb-gap));
}

/* the top row sits on the same five columns as the lanes, so every figure is over the lane it describes */
.wb-top {
    display: grid;
    grid-template-columns: var(--wb-lane-columns);
    gap: var(--wb-gap-lanes);
    height: var(--wb-top-h);
}

.wb-tile {
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: .35rem .8rem;
    background: var(--wb-surface);
    border: 1px solid var(--wb-border);
    border-radius: .6rem;
    box-shadow: var(--wb-shadow);
    overflow: hidden;
}

.wb-tile-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--wb-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-tile-value {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wb-tile-sub {
    font-size: .95rem;
    color: var(--wb-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* the value of the lane: tinted like the lane below it (the same colour-mix recipe as .wb-lane) with a border in the lane colour and a
   thicker bar on top, so the tile visibly belongs to its lane */
.wb-value-tile {
    background: color-mix(in srgb, var(--wb-value-colour, var(--wb-border)) 9%, var(--wb-surface-2));
    border: 1px solid color-mix(in srgb, var(--wb-value-colour, var(--wb-border)) 45%, var(--wb-border));
    border-top: .3rem solid var(--wb-value-colour, var(--wb-border));
}

.wb-value-tile:nth-child(1) { --wb-value-colour: var(--wb-lane-created); }
.wb-value-tile:nth-child(2) { --wb-value-colour: var(--wb-lane-assigned); }
.wb-value-tile:nth-child(3) { --wb-value-colour: var(--wb-lane-inprogress); }
.wb-value-tile:nth-child(4) { --wb-value-colour: var(--wb-lane-completed); }

.wb-value-done .wb-tile-value { color: var(--wb-green); }

/* the optional daily value target of the completed tile */
.wb-target {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.wb-target-bar {
    flex: 0 0 4rem;
    height: .5rem;
    border-radius: .3rem;
    background: var(--wb-border);
    overflow: hidden;
}

.wb-target-bar > span {
    display: block;
    height: 100%;
    background: var(--wb-blue);
}

.wb-target-hit > span { background: var(--wb-green); }

/* completed today: the number, and the graph on the operating hours (it sits over lane 5) */
.wb-tile-done {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: .9rem;
    align-items: stretch;
    justify-content: stretch;
    padding-top: .3rem;
    padding-bottom: .25rem;
}

.wb-tile-done .wb-tile-label {
    grid-column: 1 / -1;
}

.wb-tile-done .wb-tile-value {
    grid-column: 1;
    align-self: center;
}

/* the shared Sparkline (board size) sits in the second column of the completed tile */
.wb-spark {
    grid-column: 2;
    align-self: stretch;
    min-height: 0;
}

.wb-outside {
    margin-left: .5rem;
    padding: .02rem .45rem;
    border-radius: 2rem;
    font-size: .85rem;
    font-weight: 700;
    background: var(--wb-surface-2);
    border: 1px solid var(--wb-border);
    color: var(--wb-muted);
}

/* dashboard metric tiles, red / amber / green (the shared KpiTile in its board size): two rows of six */
.wb-rag {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--wb-gap);
}

/* ---------- lanes ---------- */

.wb-lanes {
    flex: 1 1 0;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--wb-lane-columns);
    gap: var(--wb-gap-lanes);
}

.wb-lane {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    /* the lane is tinted with its state colour */
    background: color-mix(in srgb, var(--wb-lane-colour, var(--wb-border)) 9%, var(--wb-surface-2));
    border: 1px solid color-mix(in srgb, var(--wb-lane-colour, var(--wb-border)) 45%, var(--wb-border));
    border-radius: .7rem;
    overflow: hidden;
}

.wb-lane-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .35rem .7rem;
    font-weight: 800;
    font-size: 1.3rem;
    /* solid header in the state colour */
    background: var(--wb-lane-colour, var(--wb-muted));
    color: #fff;
}

.wb-lane-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-lane-title i { margin-right: .25rem; color: #fff; }

.wb-lane-count {
    min-width: 2.2rem;
    text-align: center;
    padding: .05rem .6rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, .92);
    color: var(--wb-lane-colour, var(--wb-muted));
    font-size: 1.3rem;
    font-variant-numeric: tabular-nums;
}

.wb-lane-created { --wb-lane-colour: var(--wb-lane-created); }
.wb-lane-assigned { --wb-lane-colour: var(--wb-lane-assigned); }
.wb-lane-inprogress { --wb-lane-colour: var(--wb-lane-inprogress); }
.wb-lane-completed { --wb-lane-colour: var(--wb-lane-completed); }
/* the leaderboard header carries the exact workflow colour of its job type (pick = outbound purple, put = inbound orange), both with
   white text: every area colour carries white at 4.5:1 or better. The Shared workflow tokens do not change with the theme. */
.wb-lane-leaders-pick { --wb-lane-colour: var(--wm-colour-workflow-outbound); }
.wb-lane-leaders-put { --wb-lane-colour: var(--wm-colour-workflow-inbound); }

/* in progress is yellow in both themes (the warning yellow, #d9a620 on a dark screen): white does not read on it, so dark text and a
   dark count pill */
.wb-lane-inprogress .wb-lane-head,
.wb-lane-inprogress .wb-lane-title i { color: #1b1b1b; }
.wb-lane-inprogress .wb-lane-count { background: #1b1b1b; color: var(--wb-lane-inprogress); }

:root[data-theme="dark"] .wb-card { --wb-type-tint: 24%; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .wb-card { --wb-type-tint: 24%; }
}

/* ---------- lane 5: the leaderboard ---------- */

.wb-leader-body {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--wb-card-gap);
    padding: .4rem;
    overflow: hidden;
}

/* a row: position, short name, the jobs (small), the lines (big). Ten rows fit; they shrink a little before they would be cut. */
.wb-leader {
    --wb-medal: var(--wb-muted);
    flex: 1 1 0;
    min-height: 1.9rem;
    max-height: 3.7rem;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr) 3.6rem 4.4rem;
    align-items: center;
    column-gap: .7rem;
    padding: 0 .7rem 0 .5rem;
    background: var(--wb-surface);
    border: 1px solid var(--wb-border);
    border-left: .4rem solid var(--wb-medal);
    border-radius: .5rem;
    box-shadow: var(--wb-shadow);
}

.wb-leader-1 { --wb-medal: var(--wb-gold); }
.wb-leader-2 { --wb-medal: var(--wb-silver); }
.wb-leader-3 { --wb-medal: var(--wb-bronze); }

.wb-leader-1, .wb-leader-2, .wb-leader-3 {
    background: color-mix(in srgb, var(--wb-medal) 12%, var(--wb-surface));
    border-color: color-mix(in srgb, var(--wb-medal) 45%, var(--wb-border));
}

.wb-leader-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--wb-muted);
}

.wb-leader-1 .wb-leader-pos,
.wb-leader-2 .wb-leader-pos,
.wb-leader-3 .wb-leader-pos {
    background: var(--wb-medal);
    color: #fff;
}

.wb-leader-name {
    font-size: 1.35rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-leader-jobs {
    font-size: 1.1rem;
    color: var(--wb-muted);
    white-space: nowrap;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.wb-leader-lines {
    min-width: 0;
    text-align: right;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* failed and cancelled today: two small counts under the leaderboard, quiet at zero */
.wb-leader-foot {
    flex: none;
    display: flex;
    gap: .5rem;
    padding: 0 .4rem .4rem;
}

.wb-chip {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .2rem .5rem;
    border-radius: 2rem;
    border: 2px solid var(--wb-border);
    background: var(--wb-surface);
    color: var(--wb-muted);
    font-size: 1.05rem;
    white-space: nowrap;
}

.wb-chip strong {
    font-size: 1.3rem;
    font-variant-numeric: tabular-nums;
}

.wb-chip-on { font-weight: 700; }
.wb-chip-failed.wb-chip-on { background: var(--wb-red-bg); border-color: var(--wb-red); color: var(--wb-red); }
.wb-chip-cancelled.wb-chip-on { background: var(--wb-amber-bg); border-color: var(--wb-amber); color: var(--wb-amber); }
.wb-chip-timeouts.wb-chip-on { background: var(--wb-amber-bg); border-color: var(--wb-amber); color: var(--wb-amber); }

.wb-lane-body {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--wb-card-gap);
    padding: .4rem;
    overflow: hidden;
}

.wb-lane-empty {
    margin: auto;
    color: var(--wb-muted);
    font-size: 1.2rem;
    text-align: center;
}

.wb-lane-empty i { display: block; font-size: 2.2rem; margin-bottom: .2rem; opacity: .6; }

.wb-lane-foot {
    flex: none;
    min-height: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .7rem .3rem;
    font-size: .95rem;
    color: var(--wb-muted);
}

.wb-pager { display: inline-flex; align-items: center; gap: .25rem; }
.wb-pager-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--wb-border); }
.wb-pager-on { background: var(--wb-lane-colour, var(--wb-blue)); }
.wb-pager-text { margin-left: .3rem; font-variant-numeric: tabular-nums; }

/* ---------- job cards ---------- */

.wb-card {
    --wb-type: var(--wb-muted);
    --wb-type-tint: 13%;
    flex: none;
    height: var(--wb-card-h);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: .3rem .6rem .35rem .7rem;
    /* the card carries the tint of its job type until it has waited or run too long */
    background: color-mix(in srgb, var(--wb-type) var(--wb-type-tint), var(--wb-surface));
    border: 1px solid color-mix(in srgb, var(--wb-type) 35%, var(--wb-border));
    border-left: .4rem solid var(--wb-type);
    border-radius: .5rem;
    box-shadow: var(--wb-shadow);
    overflow: hidden;
}

.wb-type-outbound { --wb-type: var(--wm-colour-workflow-outbound); }
.wb-type-inbound { --wb-type: var(--wm-colour-workflow-inbound); }
.wb-type-move { --wb-type: var(--wm-colour-workflow-move); }
.wb-type-count { --wb-type: var(--wm-colour-workflow-count); }

/* the dark theme: the area colours are dark (they carry white text in the light apps), and on the dark surface the outbound purple (2.4:1) and the count
   fuchsia (2.6:1) were below the 3:1 a border or an icon needs. The card border, the type icon and the progress bar take a lighter variant of each area
   colour on a dark board (13 October 2026; 5:1 or better on --wb-surface). The leaderboard header keeps the area token itself: it carries white text. */
:root[data-theme="dark"] .wb-type-outbound { --wb-type: #9b7fd6; }
:root[data-theme="dark"] .wb-type-inbound { --wb-type: #e8853a; }
:root[data-theme="dark"] .wb-type-move { --wb-type: #26a69a; }
:root[data-theme="dark"] .wb-type-count { --wb-type: #d96aa9; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .wb-type-outbound { --wb-type: #9b7fd6; }
    :root:not([data-theme="light"]) .wb-type-inbound { --wb-type: #e8853a; }
    :root:not([data-theme="light"]) .wb-type-move { --wb-type: #26a69a; }
    :root:not([data-theme="light"]) .wb-type-count { --wb-type: #d96aa9; }
}

.wb-type-icon { color: var(--wb-type); }

.wb-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-width: 0;
}

.wb-card-ref {
    font-size: 1.3rem;
    font-weight: 800;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.wb-card-ref .wb-type-icon { margin-right: .2rem; font-size: 1.15rem; }

.wb-card-badges { display: inline-flex; gap: .3rem; align-items: center; flex: none; }

.wb-badge {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .02rem .45rem;
    border-radius: 2rem;
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap;
}

.wb-badge-paused { background: var(--wb-amber-bg); color: var(--wb-amber); border: 1px solid var(--wb-amber); }
.wb-badge-late { background: var(--wb-red); color: #fff; border-color: var(--wb-red); animation: wb-pulse 1.6s ease-in-out infinite; }

.wb-prio { color: #fff; }
.badge-wms-priority-urgent { background: var(--wm-colour-priority-urgent); }
.badge-wms-priority-high { background: var(--wm-colour-priority-high); }
.badge-wms-priority-medium { background: var(--wm-colour-priority-medium); }
.badge-wms-priority-low { background: var(--wm-colour-priority-low); }

.wb-card-who {
    justify-content: flex-start;
    gap: .9rem;
    font-size: 1.05rem;
    color: var(--wb-text);
    white-space: nowrap;
    overflow: hidden;
}

.wb-who-user { font-weight: 700; flex: none; }
.wb-who-device { color: var(--wb-muted); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wb-card-who i { color: var(--wb-muted); }

.wb-card-foot { gap: .6rem; font-size: .95rem; }

.wb-progress {
    flex: 1 1 auto;
    height: .55rem;
    border-radius: .3rem;
    background: var(--wb-border);
    overflow: hidden;
}

.wb-progress-none { background: transparent; }

.wb-progress-bar {
    display: block;
    height: 100%;
    background: var(--wb-type);
    border-radius: .3rem;
}

.wb-lines {
    flex: none;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.wb-card-time {
    flex: none;
    margin-left: auto;
    color: var(--wb-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* waiting or running too long: amber, then red (the time is bold as well, so it is not colour alone) */
.wb-sev-amber { background: var(--wb-amber-bg); border-color: var(--wb-amber); border-left-color: var(--wb-type); }
.wb-sev-amber .wb-card-time { color: var(--wb-amber); font-weight: 800; }
.wb-sev-red { background: var(--wb-red-bg); border-color: var(--wb-red); border-left-color: var(--wb-type); }
.wb-sev-red .wb-card-time { color: var(--wb-red); font-weight: 800; }
.wb-paused-long { background: var(--wb-red-bg); border-color: var(--wb-red); border-left-color: var(--wb-type); }
.wb-paused-long .wb-card-time { color: var(--wb-red); font-weight: 800; }


/* ---------- reconnect banner (the circuit to this server) ---------- */

.wb-reconnect {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    padding: .5rem 1rem;
    background: var(--wb-red);
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
}

.wb-reconnect .wb-reconnect-failed { display: none; }

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed .wb-reconnect-retrying,
#components-reconnect-modal.components-reconnect-rejected .wb-reconnect-retrying { display: none; }

#components-reconnect-modal.components-reconnect-failed .wb-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected .wb-reconnect-failed { display: inline; }

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    padding: .8rem 1rem;
    border-radius: .5rem;
    background: var(--wb-red);
    color: #fff;
    z-index: 10000;
    font-size: 1.2rem;
}

#blazor-error-ui .reload { color: #fff; margin-left: .6rem; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* leaderboard header: same block as the other lanes (title left, where they show the count pill the two column captions).
   The captions use the row's jobs / lines column widths and gap, and the margin is the body padding + row border + row padding
   minus the header padding, so each caption sits right-aligned over its figures. */
.wb-leader-head { gap: .4rem; }
/* the title has the size of the other lanes' titles (the header's 1.3rem; owner, 12 October 2026): 'Pick Job Leaders' with its trophy
   fits next to the captions in a lane 1.05fr wide with a few pixels to spare (everything is in rem, so it fits at 1080p and 4K alike);
   a longer title is cut with an ellipsis. The jobs / lines captions and the rows keep their sizes. */
.wb-leader-title { min-width: 0; }
/* a zero-width, invisible line of the header's own font (1.3rem, the size of the other lanes' titles): it keeps this header exactly
   the height of the other lane headers */
.wb-leader-sizer { flex: none; width: 0; padding: .05rem 0; margin-right: -.4rem; overflow: hidden; visibility: hidden; }

.wb-leader-cols {
    flex: none;
    display: grid;
    grid-template-columns: 3.6rem 4.4rem;
    column-gap: .7rem;
    margin-right: calc(.4rem + 1px);
    font-size: .8rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.wb-leader-col-jobs, .wb-leader-col-lines { text-align: right; }

/* demo mode (see DemoModeInfo): the banner of the setup page, the pairing block, and the small corner marker of every board */
.wb-demo-banner {
    margin-bottom: 1rem;
    padding: .5rem 1rem;
    border-radius: .5rem;
    background: var(--wm-colour-demo);
    color: var(--wm-colour-demo-contrast);
    font-weight: 700;
}

.wb-setup-pairing {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin: 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid currentColor;
}

.wb-demo-corner {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 5;
    padding: .1rem .6rem;
    border-bottom-left-radius: .5rem;
    background: var(--wm-colour-demo);
    color: var(--wm-colour-demo-contrast);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    pointer-events: none;
}
