:root {
    --milo-green-950: #052d21;
    --milo-green-900: #073b2a;
    --milo-green-850: #09432e;
    --milo-green-800: #0c4a2e;
    --milo-green-700: #0f6b3a;
    --milo-green-600: #17854a;

    /* Colour principle: deep green is only for the sidebar. Everything
       else is black and white (like DermoRepubliq), with the lightest
       greens as soft accents. Bright colours only where they mean
       something: green = on track, amber = needs a look, red = critical. */
    --milo-ink: #161616;

    /* Links in black instead of Bootstrap's blue */
    --bs-link-color: #161616;
    --bs-link-color-rgb: 22, 22, 22;
    --bs-link-hover-color: #000000;
    --bs-link-hover-color-rgb: 0, 0, 0;
    --bs-focus-ring-color: rgba(22, 22, 22, 0.2);

    --milo-cocoa-green: #2e5d46;
    --milo-sage: #c8d8c5;
    --milo-sage-soft: #edf4ec;
    --milo-sage-200: #9dd5ae;

    --milo-off-white: #faf9f4;
    --milo-surface: #ffffff;
    --milo-surface-soft: #f5f6f3;
    --milo-glass: rgba(255, 255, 255, 0.72);

    --milo-sand: #e6dccb;

    /* Metallic black: light catching the top-left, darkest just past
       the middle, a little light again at the far edge. Used by the
       logo coin and the day card. Slightly see-through (0.85) so
       the metal stays quiet and what sits on it stands out. */
    --milo-metal:
        linear-gradient(
            145deg,
            rgba(74, 78, 82, 0.85) 0%,
            rgba(26, 28, 30, 0.85) 45%,
            rgba(11, 12, 13, 0.85) 62%,
            rgba(46, 49, 53, 0.85) 100%
        );
    --milo-metal-rim: inset 0 1px 0 rgba(255, 255, 255, 0.22);
    --milo-silver: #c8cbcf;

    --milo-charcoal: #2e2e2e;
    --milo-gray-700: #59605b;
    --milo-gray: #8a8f8a;
    --milo-border: #e1e5e1;

    --milo-danger: #b42318;
    --milo-warning: #b26a00;
    --milo-info: #315b72;
    --milo-sky: #197da8;

    --milo-sidebar-width: 84px;
    --milo-radius: 12px;

    --milo-shadow:
        0 2px 8px rgba(19, 52, 38, 0.06);

    --milo-shadow-lg:
        0 10px 30px rgba(19, 52, 38, 0.08);

    /* Names some rules were already using but that were never
       defined, so those rules silently did nothing. Each points
       at the closest existing colour or size. */
    --milo-muted: var(--milo-gray-700);
    --milo-sage-100: var(--milo-sage-soft);
    --milo-sage-500: var(--milo-sage-200);
    --milo-surface-muted: var(--milo-surface-soft);
    --milo-radius-sm: 10px;

    --milo-shadow-sm:
        0 2px 6px rgba(19, 52, 38, 0.08);

    /* Buttons you can press: light on the top edge, a darker green
       bottom edge, then a tight and a soft green-tinted shadow (the
       cards' shadow colour). Pressed swaps the light: pushed in. */
    --milo-btn-raised:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1px 0 rgba(15, 107, 58, 0.22),
        0 1px 2px rgba(19, 52, 38, 0.14),
        0 3px 8px rgba(19, 52, 38, 0.08);

    --milo-btn-pressed:
        inset 0 1px 2px rgba(19, 52, 38, 0.2),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3),
        0 1px 1px rgba(19, 52, 38, 0.08);

    /* The same for white buttons. White light on a white face can't
       be seen, so the face shades a touch toward the bottom (sage
       grey): the lit top edge stands out against it, the green
       bottom edge and the lift do the rest */
    --milo-btn-raised-light:
        inset 0 1px 0 #ffffff,
        inset 0 -1px 0 rgba(15, 107, 58, 0.18),
        0 1px 2px rgba(19, 52, 38, 0.14),
        0 3px 8px rgba(19, 52, 38, 0.08);

    --milo-btn-face-light:
        linear-gradient(180deg, #ffffff 0%, #ffffff 35%, #eef3ed 100%);
}


/* =========================================================
   GLOBAL
   ========================================================= */

html,
body {
    min-height: 100%;

    /* No rubber-band past the top or the footer when swiping or
       zooming with a touchpad: it showed an empty strip under it */
    overscroll-behavior-y: none;
}

body {
    margin: 0;

    background:
        var(--milo-off-white);

    color:
        var(--milo-charcoal);

    font-family:
        Inter,
        "Segoe UI",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;

    font-size: 0.94rem;
}

/* No scrollbars by default: a box still scrolls (wheel, touch, keys),
   and a long list gets a search, or on the Cockpit a link to its
   module, instead of a bar. The page keeps its own bar, and so do
   boxes that scroll sideways (wide tables, the Classis line, the
   weather hours), where the bar is the only sign of more to the right. */
:where(body *:not(.table-responsive, .overflow-auto, .milo-forecast-hours, textarea)) {
    scrollbar-width: none;
}


/* =========================================================
   APPLICATION SHELL
   ========================================================= */

.milo-shell {
    min-height: 100vh;
    display: flex;
}


/* Leaves room for the sidebar, which is pinned to the window */
.milo-main {
    flex: 1;
    min-width: 0;

    margin-left: var(--milo-sidebar-width);

    background:
        var(--milo-off-white);
}


/* =========================================================
   SIDEBAR RAIL
   A narrow strip of categories. Clicking a category opens
   its panel (see SIDEBAR FLYOUT below).
   ========================================================= */

/* Pinned to the window (not the page), so it always runs from top to
   bottom however long the page is. Sticky stopped where the page frame
   ended, and a hover panel near the bottom could make the page longer
   than that frame, leaving a gap under the green. */
.milo-sidebar {
    width: var(--milo-sidebar-width);
    min-width: var(--milo-sidebar-width);
    height: 100vh;

    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;

    display: flex;
    flex-direction: column;
    align-items: center;

    background:
        linear-gradient(
            180deg,
            var(--milo-green-950) 0%,
            var(--milo-green-900) 45%,
            var(--milo-green-850) 100%
        );

    color: #ffffff;

    border-right: 1px solid rgba(255, 255, 255, 0.06);
}


/* MILO logo badge; same height as the top bar so their lines meet */
.milo-rail-brand {
    flex-shrink: 0;

    width: 100%;
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: center;

    text-decoration: none;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}


/* The logo, lights on: the mark with its black-and-white obelisk on a
   sage circle whose edge breaks up into polka dots
   (images/milo-logo-rail.svg, its dots sized for this ~56px spot;
   milo-logo-rail-off.svg is the lights-off black coin). The circle is
   part of the image, so no coin is drawn here. */
.milo-rail-mark {
    width: 56px;
    height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    transition: transform 0.15s ease;
}


.milo-rail-mark img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


.milo-rail-brand:hover .milo-rail-mark {
    transform: translateY(-1px);
}


.milo-rail-brand:focus-visible {
    outline: none;
}


.milo-rail-brand:focus-visible .milo-rail-mark {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}


.milo-rail-nav {
    flex: 1;
    width: 100%;

    display: flex;
    flex-direction: column;
    gap: 0.25rem;

    padding: 0.75rem 0.5rem;

    overflow-y: auto;
}


.milo-rail-item {
    position: relative;
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;

    padding: 0.4rem 0.2rem 0.55rem;

    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    border: 0;
    border-radius: 10px;

    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;

    cursor: pointer;

    transition: color 0.15s ease;
}


/* The rounded square around each category icon. It lights up
   exactly like the M badge when you hover the category. */
.milo-rail-icon {
    position: relative;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}


.milo-rail-icon i {
    font-size: 1.25rem;
    line-height: 1;
}


.milo-rail-item:hover {
    color: #ffffff;
}


/* Hover (or keyboard focus): same look as the M badge */
.milo-rail-item:hover .milo-rail-icon,
.milo-rail-item:focus-visible .milo-rail-icon {
    color: var(--milo-green-950);
    background: var(--milo-sage-200);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}


.milo-rail-item:focus-visible {
    outline: none;
}


.milo-rail-item:focus-visible .milo-rail-icon {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}


/* The category of the page you are on: white bar on the left
   and a faint square behind its icon */
.milo-rail-item.active {
    color: #ffffff;
}


.milo-rail-item.active .milo-rail-icon {
    background: rgba(255, 255, 255, 0.1);
}


.milo-rail-item.active::before {
    content: "";

    position: absolute;
    left: -0.5rem;
    top: 0.4rem;

    width: 3px;
    height: 40px;

    background: #ffffff;
    border-radius: 0 999px 999px 0;
}


/* The category whose panel is open keeps the badge look */
.milo-rail-item.is-open {
    color: #ffffff;
}


.milo-rail-item.is-open .milo-rail-icon {
    color: var(--milo-green-950);
    background: var(--milo-sage-200);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}


/*
 * One square glides to the category you point at and back to the
 * current one when you leave the rail (the layout's script sets
 * .has-spot and moves it). The script picks one icon at a time: the one
 * pointed at, else the open panel's, else the current page's; crossing
 * the gap between two icons keeps it where it is. Without the script
 * each icon keeps its own square.
 */
.milo-rail-nav.has-spot {
    position: relative;
    isolation: isolate;
}

.milo-rail-nav.has-spot::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    left: var(--milo-spot-x, 0);
    width: var(--milo-spot-size, 40px);
    height: var(--milo-spot-size, 40px);
    transform: translateY(var(--milo-spot-y, 0));
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    pointer-events: none;
}

/* Glides only once it's in place, so it doesn't fly in on page load */
.milo-rail-nav.has-spot.is-ready::after {
    transition: transform 0.25s ease, background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.milo-rail-nav.has-spot.is-pointing::after {
    background: var(--milo-sage-200);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.milo-rail-nav.has-spot:not(.is-spot-on)::after {
    opacity: 0;
}

/* The gliding square replaces each icon's own */
.milo-rail-nav.has-spot .milo-rail-item:is(.active, :hover, :focus-visible, .is-open) .milo-rail-icon {
    background: transparent;
    box-shadow: none;
    transform: none;
}

/* Dark icon only where the light square is, light everywhere else */
.milo-rail-nav.has-spot .milo-rail-item:is(:hover, :focus-visible, .is-open):not(.is-spot) .milo-rail-icon {
    color: inherit;
}

.milo-rail-nav.has-spot.is-pointing .milo-rail-item.is-spot {
    color: #ffffff;
}

.milo-rail-nav.has-spot.is-pointing .milo-rail-item.is-spot .milo-rail-icon {
    color: var(--milo-green-950);
}

@media (prefers-reduced-motion: reduce) {
    .milo-rail-nav.has-spot.is-ready::after {
        transition: none;
    }
}


/* =========================================================
   SIDEBAR FLYOUT
   The white panel that opens beside the rail.
   ========================================================= */

.milo-flyout {
    position: fixed;
    top: 0.75rem;
    left: calc(var(--milo-sidebar-width) + 0.6rem);

    width: 300px;
    max-width: calc(100vw - var(--milo-sidebar-width) - 1.2rem);
    max-height: calc(100vh - 1.5rem);
    overflow-y: auto;

    padding: 1.25rem 0.9rem 1rem;

    color: var(--milo-charcoal);
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 16px;

    box-shadow:
        0 18px 48px rgba(5, 45, 33, 0.18),
        0 2px 8px rgba(5, 45, 33, 0.08);

    /* Hidden until opened (fades and slides in) */
    visibility: hidden;
    opacity: 0;
    transform: translateX(-8px);

    transition:
        opacity 0.16s ease,
        transform 0.16s ease,
        visibility 0s linear 0.16s;
}


.milo-flyout.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;

    transition:
        opacity 0.16s ease,
        transform 0.16s ease;
}


.milo-flyout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding: 0 0.4rem 0.85rem;
}


.milo-flyout-title {
    margin: 0;

    color: var(--milo-ink);
    font-size: 1.35rem;
    font-weight: 700;
}


.milo-flyout-close {
    width: 2.1rem;
    height: 2.1rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: var(--milo-gray-700);
    background: transparent;
    border: 0;
    border-radius: 8px;

    cursor: pointer;
}


.milo-flyout-close:hover {
    color: var(--milo-charcoal);
    background: var(--milo-surface-soft);
}


.milo-flyout-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;

    padding: 0.7rem 0.75rem;

    color: var(--milo-charcoal);
    border-radius: 10px;

    font-size: 0.95rem;
    text-decoration: none;

    transition:
        background-color 0.12s ease,
        color 0.12s ease;
}


.milo-flyout-link i {
    width: 1.25rem;

    color: var(--milo-gray-700);
    font-size: 1.1rem;
    text-align: center;
}


.milo-flyout-link:hover {
    color: var(--milo-ink);
    background: var(--milo-surface-soft);
}


.milo-flyout-link:focus-visible,
.milo-flyout-close:focus-visible {
    outline: 2px solid var(--milo-ink);
    outline-offset: 1px;
}


/* The page you are on */
.milo-flyout-link.active {
    color: var(--milo-ink);
    background: var(--milo-sage-soft);
    font-weight: 600;
}


.milo-flyout-link.active i {
    color: var(--milo-ink);
}


@media (prefers-reduced-motion: reduce) {

    .milo-flyout,
    .milo-flyout.is-open {
        transition: none;
    }
}


/* =========================================================
   TOPBAR
   App name on the left, signed-in user on the right.
   Slightly see-through, so content blurs underneath it
   while scrolling.
   ========================================================= */

.milo-topbar {
    min-height: 64px;

    position: sticky;
    top: 0;
    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding: 0.5rem 1.5rem;

    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);

    border-bottom: 1px solid #d3dbd5;

    /* Darker shade along the bottom edge, so the bar sits above the page */
    box-shadow:
        0 1px 2px rgba(5, 45, 33, 0.06),
        0 6px 16px -8px rgba(5, 45, 33, 0.22);
}


/* "MILO | Monitoring, Intelligence & Logistics Operations" */

.milo-app-brand {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 0.85rem;

    color: inherit;
    text-decoration: none;
}


.milo-app-name {
    color: var(--milo-ink);
    font-family: "Outfit", "Segoe UI", sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1;

    transition: color 0.15s ease;
}


.milo-app-brand:hover .milo-app-name {
    color: var(--milo-ink);
}


.milo-app-brand:focus-visible {
    outline: 2px solid var(--milo-ink);
    outline-offset: 4px;
    border-radius: 6px;
}


.milo-app-divider {
    flex-shrink: 0;

    width: 1px;
    height: 1.4rem;

    background: #d5dad6;
}


/* What MILO stands for, in Poppins (loaded in the layout), plain */
.milo-app-meaning {
    overflow: hidden;

    color: var(--milo-gray-700);
    font-family: "Poppins", "Segoe UI", sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* =========================================================
   TOP BAR TITLE
   Once the page's title has scrolled under the top bar, the bar
   shows it (its icon and title, handed over by x-milo.page-header)
   in place of what MILO stands for; back at the top, the meaning
   returns. Tied to the scroll (a scroll-driven animation, moving and
   fading only). A browser that can't run both parts of it keeps
   today's bar: the title stays hidden. Phones keep "MILO" alone.
   ========================================================= */

.milo-app-swap {
    display: grid;
    align-items: center;
    min-width: 0;
}

.milo-app-swap > * {
    grid-area: 1 / 1;
    min-width: 0;
}

.milo-app-page {
    display: none;
    align-items: center;
    gap: 0.5rem;

    color: var(--milo-ink);
    font-size: 0.95rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.milo-app-page > i {
    font-size: 1rem;
}

.milo-app-page > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

@supports (animation-timeline: scroll()) and (animation-range: 0px 1px) {

    /* The meaning steps up and out as the page title goes under the bar */
    .milo-app-swap:has(.milo-app-page) > .milo-app-meaning {
        animation: milo-app-meaning-out linear both;
        animation-duration: 1ms; /* Firefox needs a length; the scroll sets the pace */
        animation-timeline: scroll(root);
        animation-range: 36px 80px;
    }

    /* ...and the page title rises into its place */
    .milo-app-page {
        display: inline-flex;

        opacity: 0;
        visibility: hidden;

        animation: milo-app-page-in linear both;
        animation-duration: 1ms;
        animation-timeline: scroll(root);
        animation-range: 56px 104px;
    }

    /* Phones keep "MILO" alone: beside it and the bar's buttons there's
       no room for the title (at 390 px it had none, and only the divider
       showed) */
    @media (max-width: 767.98px) {
        .milo-app-page {
            display: none;
        }
    }

    /* A device set to reduce motion: they swap with a fade, no slide */
    @media (prefers-reduced-motion: reduce) {
        .milo-app-swap:has(.milo-app-page) > .milo-app-meaning {
            animation-name: milo-app-meaning-fade;
        }

        .milo-app-page {
            animation-name: milo-app-page-fade;
        }
    }

}

@keyframes milo-app-meaning-out {
    to {
        opacity: 0;
        transform: translateY(-10px);
        visibility: hidden;
    }
}

@keyframes milo-app-page-in {
    from {
        opacity: 0;
        transform: translateY(10px);
        visibility: hidden;
    }

    to {
        opacity: 1;
        transform: none;
        visibility: visible;
    }
}

@keyframes milo-app-meaning-fade {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes milo-app-page-fade {
    from {
        opacity: 0;
        visibility: hidden;
    }

    to {
        opacity: 1;
        visibility: visible;
    }
}


/* =========================================================
   CREATE BUTTON (x-milo.create-button)
   The page's create button kept in reach: hidden while the page
   header and its own button are in sight; after that it waits in the
   bottom right corner (the bottom left is the Activity Center's),
   folds to a round + while you scroll down and opens again when you
   scroll up, like an email app's Compose. Its script watches the
   header and the scroll; the movement is CSS.
   ========================================================= */

.milo-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1030;

    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.milo-fab.is-away {
    opacity: 0;
    transform: translateY(16px);
    visibility: hidden;
    pointer-events: none;
}

.milo-fab-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    height: 52px;
    min-width: 52px;
    padding: 0 1.05rem;

    border-radius: 999px;
    box-shadow:
        0 10px 24px -6px rgba(5, 45, 33, 0.45),
        0 2px 6px rgba(5, 45, 33, 0.2);

    font-weight: 650;
    white-space: nowrap;

    transition: gap 0.2s ease;
}

.milo-fab-button > i {
    font-size: 1.2rem;
    line-height: 1;
}

.milo-fab-label {
    display: inline-block;
    max-width: 14rem;
    overflow: hidden;

    transition: max-width 0.2s ease, opacity 0.15s ease;
}

/* Folded: only the + (its name on hover) */
.milo-fab.is-folded .milo-fab-button {
    gap: 0;
}

.milo-fab.is-folded .milo-fab-label {
    max-width: 0;
    opacity: 0;
}

/* A menu (Third-Party's two kinds of job) without Bootstrap's caret */
.milo-fab-button.dropdown-toggle::after,
.milo-fab-button[data-bs-toggle="dropdown"]::after {
    display: none;
}

@media (max-width: 767.98px) {
    .milo-fab {
        right: 1rem;
        bottom: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .milo-fab,
    .milo-fab-button,
    .milo-fab-label {
        transition: none;
    }
}

@media print {
    .milo-fab {
        display: none;
    }
}


/* =========================================================
   FLOATING LABELS
   In the forms that save something (the sign-in box too; not the
   lists' search and filters), a field's name sits inside its box and
   rises when you click in or once it has something in it; a MILO
   green line grows from the middle along the bottom. The example
   ("e.g. …") shows once you're in the box. A field is a .form-label
   followed directly by its box: a text box, a list, a date, or the
   sign-in password (its box and eye button). Each rule starts from the
   name and the box right after it, so fields that share one container
   (the sign-in form) rise one at a time. Small boxes, ₱ boxes (input
   groups), choice buttons, read-only text, file pickers and hidden
   names keep today's look, and so does a name too long for one line
   inside its box (the layout's FLOATING LABELS script marks it
   .is-long; .milo-label-above asks for it by hand).
   ========================================================= */

/* The name, inside the box at rest: it keeps one line of room but gives
   it back (margin), so the box starts where the name is */
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm), select.form-select:not(.form-select-sm, [multiple]), .milo-password)) {
    position: relative;
    top: 1.05rem;
    left: 1rem;
    z-index: 3;

    display: block;
    height: 1.25rem;
    max-width: calc(100% - 3rem);
    margin: 0 0 -1.25rem;

    color: var(--milo-gray-700);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;

    pointer-events: none;

    transition: translate 0.2s ease, font-size 0.2s ease, color 0.2s ease;
}

/* Its ⓘ still answers when pointed at, its note over the fields below */
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm), select.form-select:not(.form-select-sm, [multiple]), .milo-password)) .milo-info-tip {
    pointer-events: auto;
}

:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm), select.form-select:not(.form-select-sm, [multiple]), .milo-password)):has(.milo-info-tip:is(:hover, :focus-visible)) {
    z-index: 30;
}

/* The box: filled, with a line along the bottom */
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm), select.form-select:not(.form-select-sm, [multiple])),
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + .milo-password > input.form-control {
    min-height: 3.6rem;
    padding: 1.6rem 1rem 0.45rem;

    color: var(--milo-ink);
    background-color: var(--milo-sage-soft);
    background-image: linear-gradient(var(--milo-green-600), var(--milo-green-600));
    background-position: 50% 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;

    border: 0;
    border-radius: 10px 10px 0 0;
    box-shadow: inset 0 -1px 0 var(--milo-gray-700);

    transition: background-size 0.25s ease;
}

:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + select.form-select:not(.form-select-sm, [multiple]) {
    padding-right: 2.75rem;

    background-image:
        linear-gradient(var(--milo-green-600), var(--milo-green-600)),
        var(--bs-form-select-bg-img);
    background-position: 50% 100%, right 1rem center;
    background-size: 0% 2px, 16px 12px;
}

/* The sign-in password: room for its eye button, which sits in the middle */
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + .milo-password > input.form-control {
    padding-right: 3rem;
}

:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + .milo-password > .milo-password-toggle {
    top: calc(50% - 1.15rem);
}

/* In the box: the line turns MILO green from the middle */
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm)):focus,
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + .milo-password > input.form-control:focus {
    background-size: 100% 2px;
    box-shadow: inset 0 -1px 0 transparent;
    outline: 0;
}

:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + select.form-select:not(.form-select-sm, [multiple]):focus {
    background-size: 100% 2px, 16px 12px;
    box-shadow: inset 0 -1px 0 transparent;
    outline: 0;
}

/* Something to fix: the line in red */
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + :is(input.form-control, textarea.form-control).is-invalid,
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + .milo-password > input.form-control.is-invalid {
    background-image: none;
    box-shadow: inset 0 -2px 0 var(--milo-danger);
}

:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + select.form-select.is-invalid {
    background-image: var(--bs-form-select-bg-img);
    background-position: right 1rem center;
    background-size: 16px 12px;
    box-shadow: inset 0 -2px 0 var(--milo-danger);
}

/* The searchable lists (Tom Select): the same filled box */
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + select.form-select:not(.form-select-sm, [multiple]) + .ts-wrapper.form-select {
    padding: 0;

    background-color: var(--milo-sage-soft);
    border: 0;
    border-radius: 10px 10px 0 0;
}

:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + select.form-select:not(.form-select-sm, [multiple]) + .ts-wrapper .ts-control {
    min-height: 3.6rem;
    padding: 1.6rem 2.75rem 0.45rem 1rem;

    background: transparent;
    border: 0;
    border-radius: 10px 10px 0 0;
    box-shadow: inset 0 -1px 0 var(--milo-gray-700);
}

:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + select.form-select:not(.form-select-sm, [multiple]) + .ts-wrapper.focus .ts-control {
    box-shadow: inset 0 -2px 0 var(--milo-green-600);
}

/* Raised: you're in its box, the box has something in it, or it always
   shows something (a list, a date) */
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm), select.form-select:not(.form-select-sm, [multiple]), .milo-password)):has(+ :is(:focus, .milo-password:focus-within)),
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm), select.form-select:not(.form-select-sm, [multiple]), .milo-password)):has(+ select + .ts-wrapper.focus),
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm)):not(:placeholder-shown)),
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ .milo-password > input.form-control:not(:placeholder-shown)),
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(select.form-select:not(.form-select-sm, [multiple]), input.form-control:is([type="date"], [type="datetime-local"], [type="time"], [type="month"], [type="week"]))) {
    translate: 0 -0.62rem;
    font-size: 0.78rem;
}

:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm), select.form-select:not(.form-select-sm, [multiple]), .milo-password)):has(+ :is(:focus, .milo-password:focus-within)),
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm), select.form-select:not(.form-select-sm, [multiple]), .milo-password)):has(+ select + .ts-wrapper.focus) {
    color: var(--milo-green-600);
}

/* Something to fix: the name in red, even while you're in the box */
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm), select.form-select:not(.form-select-sm, [multiple]), .milo-password)):has(+ .is-invalid),
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long):has(+ :is(input.form-control:not(.form-control-sm, [type="file"], [type="range"]), textarea.form-control:not(.form-control-sm), select.form-select:not(.form-select-sm, [multiple]), .milo-password)):has(+ .milo-password > .is-invalid) {
    color: var(--milo-danger);
}

/* The example ("e.g. …"): once you're in the box */
:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + :is(input.form-control, textarea.form-control)::placeholder {
    opacity: 0;
    transition: opacity 0.15s ease;
}

:is(.milo-content, .milo-auth-card) form[method="post" i] .form-label:not(.visually-hidden, .milo-label-above, .is-long) + :is(input.form-control, textarea.form-control):focus::placeholder {
    color: var(--milo-gray);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    :is(.milo-content, .milo-auth-card) form[method="post" i] :is(.form-label, .form-control, .form-select) {
        transition: none;
    }
}


/* Signed-in user, shown as a rounded chip */

.milo-user {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    gap: 0.65rem;

    padding: 0.3rem 0.9rem 0.3rem 0.3rem;

    font: inherit;
    text-align: left;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 999px;
    box-shadow: var(--milo-shadow);

    cursor: pointer;

    transition: border-color 0.15s ease;
}


/* It is a button that opens the account menu */
.milo-user:hover,
.milo-user[aria-expanded="true"] {
    border-color: var(--milo-sage-200);
}


.milo-user:focus-visible {
    outline: 2px solid var(--milo-ink);
    outline-offset: 2px;
}


.milo-user-chevron {
    color: var(--milo-gray);
    font-size: 0.7rem;
}


/* The account menu (Switch role, Sign out), and a split button's menu */
.milo-user-menu,
.milo-split-menu {
    min-width: 200px;

    padding: 0.4rem;

    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow-lg);
}


:is(.milo-user-menu, .milo-split-menu) .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;

    padding: 0.5rem 0.65rem;

    border-radius: 8px;

    font-size: 0.88rem;
}


:is(.milo-user-menu, .milo-split-menu) .dropdown-item i {
    color: var(--milo-gray-700);
}


:is(.milo-user-menu, .milo-split-menu) .dropdown-item:hover {
    color: var(--milo-ink);
    background: var(--milo-sage-soft);
}


/* =========================================================
   SPLIT BUTTON
   The main part does the usual thing; the chevron beside it opens
   a small menu (a popover: a click outside or Esc closes it),
   anchored under the pair (anchor-name on .milo-split,
   position-anchor on the menu, both inline per button). The
   chevron turns over while the menu is open.
   ========================================================= */

.milo-split {
    display: inline-flex;
    align-items: stretch;
}

.milo-split > :first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.milo-split > :last-child {
    margin-left: -1px;

    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.milo-split > a.milo-user {
    color: inherit;
    text-decoration: none;
}

.milo-user.milo-split-chev {
    padding: 0 0.75rem;
}

/* inline-block: an inline icon can't turn (a button isn't flex) */
.milo-split-chev > i {
    display: inline-block;

    transition: rotate 0.15s ease;
}

.milo-split:has(+ :popover-open) .milo-split-chev > i {
    rotate: 180deg;
}

/* Open, the chevron sits pressed, as a toggled button does */
.milo-split:has(+ :popover-open) .milo-split-chev.btn {
    color: var(--bs-btn-active-color);
    background-color: var(--bs-btn-active-bg);
    border-color: var(--bs-btn-active-border-color);
}

.milo-split:has(+ :popover-open) .milo-user {
    border-color: var(--milo-sage-200);
}

/* Under the pair, not in the middle of the page (a popover's own place) */
.milo-split-menu[popover] {
    position: fixed;
    inset: auto;
    top: anchor(bottom);
    left: anchor(left);

    margin: 4px 0 0;
}

.milo-split-menu[popover].is-end {
    left: auto;
    right: anchor(right);
}

.milo-split-menu:popover-open {
    display: block;
    max-width: 20rem;
}

.milo-split-menu .milo-split-note {
    display: block;

    color: var(--milo-gray-700);

    font-size: 0.76rem;
    white-space: normal;
}


/* The bell (decisions awaiting a manager or the Admin): wider than
   the account menu, rows wrap, red and amber first */
/* While a decision waits for you, the bell holds MILO's green, sage and
   amber, and they flow by themselves: once through in 3.2 seconds,
   gently, stopping where they began (the same colour at both ends),
   then a rest, then again. No number on it: the rest says how much
   waits. One decision rests 5 s; each one more takes a second off, to
   1 s at five or more (is-rest-5 … is-rest-1, set by the layout). A
   snooze that shortens, never an alarm. With nothing waiting it's the
   plain bell. Pointed at (or focused), the jelly runs alongside, the
   flow carrying on as it was */
.milo-bell {
    --milo-bell-amber: #d97706;
    --milo-bell-snooze: milo-bell-rest-5;
    --milo-bell-squish: milo-bell-squish-5;
    --milo-bell-cycle: 8.2s;
}

.milo-bell.is-rest-4 { --milo-bell-snooze: milo-bell-rest-4; --milo-bell-squish: milo-bell-squish-4; --milo-bell-cycle: 7.2s; }
.milo-bell.is-rest-3 { --milo-bell-snooze: milo-bell-rest-3; --milo-bell-squish: milo-bell-squish-3; --milo-bell-cycle: 6.2s; }
.milo-bell.is-rest-2 { --milo-bell-snooze: milo-bell-rest-2; --milo-bell-squish: milo-bell-squish-2; --milo-bell-cycle: 5.2s; }
.milo-bell.is-rest-1 { --milo-bell-snooze: milo-bell-rest-1; --milo-bell-squish: milo-bell-squish-1; --milo-bell-cycle: 4.2s; }

/* As each flow starts, the bell squishes and pops up a little, then
   lands and rests with the colours: 0.18 s squashed, 0.36 s up 4 px,
   0.58 s landed, 0.75 s settling, still from 0.9 s (as parts of each
   cycle) */
@keyframes milo-bell-squish-5 { 0% { transform: none; } 2.2% { transform: translateY(1px) scale(1.14, 0.86); } 4.39% { transform: translateY(-4px) scale(0.92, 1.1); } 7.07% { transform: translateY(0) scale(1.05, 0.95); } 9.15% { transform: scale(0.98, 1.02); } 10.98%, 100% { transform: none; } }
@keyframes milo-bell-squish-4 { 0% { transform: none; } 2.5% { transform: translateY(1px) scale(1.14, 0.86); } 5% { transform: translateY(-4px) scale(0.92, 1.1); } 8.06% { transform: translateY(0) scale(1.05, 0.95); } 10.42% { transform: scale(0.98, 1.02); } 12.5%, 100% { transform: none; } }
@keyframes milo-bell-squish-3 { 0% { transform: none; } 2.9% { transform: translateY(1px) scale(1.14, 0.86); } 5.81% { transform: translateY(-4px) scale(0.92, 1.1); } 9.35% { transform: translateY(0) scale(1.05, 0.95); } 12.1% { transform: scale(0.98, 1.02); } 14.52%, 100% { transform: none; } }
@keyframes milo-bell-squish-2 { 0% { transform: none; } 3.46% { transform: translateY(1px) scale(1.14, 0.86); } 6.92% { transform: translateY(-4px) scale(0.92, 1.1); } 11.15% { transform: translateY(0) scale(1.05, 0.95); } 14.42% { transform: scale(0.98, 1.02); } 17.31%, 100% { transform: none; } }
@keyframes milo-bell-squish-1 { 0% { transform: none; } 4.29% { transform: translateY(1px) scale(1.14, 0.86); } 8.57% { transform: translateY(-4px) scale(0.92, 1.1); } 13.81% { transform: translateY(0) scale(1.05, 0.95); } 17.86% { transform: scale(0.98, 1.02); } 21.43%, 100% { transform: none; } }

/* The flow is 3.2 s of each cycle (3.2 s + the rest); the rest stands still */
@keyframes milo-bell-rest-5 { 0% { background-position: 0 0; } 39% { background-position: -300% 0; } 100% { background-position: -300% 0; } }
@keyframes milo-bell-rest-4 { 0% { background-position: 0 0; } 44.4% { background-position: -300% 0; } 100% { background-position: -300% 0; } }
@keyframes milo-bell-rest-3 { 0% { background-position: 0 0; } 51.6% { background-position: -300% 0; } 100% { background-position: -300% 0; } }
@keyframes milo-bell-rest-2 { 0% { background-position: 0 0; } 61.5% { background-position: -300% 0; } 100% { background-position: -300% 0; } }
@keyframes milo-bell-rest-1 { 0% { background-position: 0 0; } 76.2% { background-position: -300% 0; } 100% { background-position: -300% 0; } }

.milo-bell.is-waiting .milo-theme-toggle > i::before {
    background: linear-gradient(90deg, var(--milo-green-600), var(--milo-sage-200), var(--milo-bell-amber), var(--milo-green-600));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: var(--milo-bell-snooze) var(--milo-bell-cycle) ease-in-out infinite, var(--milo-bell-squish) var(--milo-bell-cycle) ease-out infinite;
}

.milo-bell.is-waiting .milo-theme-toggle:is(:hover, :focus-visible) > i::before {
    animation: var(--milo-bell-snooze) var(--milo-bell-cycle) ease-in-out infinite, var(--milo-bell-squish) var(--milo-bell-cycle) ease-out infinite, milo-icon-jelly 0.45s ease;
}

/* The bell's hover note (what waits, kind by kind) gives way to its
   menu: with the menu open the list itself says it */
.milo-bell .milo-theme-toggle[aria-expanded="true"][data-milo-tooltip]::after {
    display: none;
}

/* The Requests page's tabs: where something waits for you (to approve,
   to answer, to schedule, a new SCM approval), only the tab's icon does
   the bell's snooze: its colours flow while it squishes, then 5 s of
   rest (the bell's rhythm for one decision). The tab stays as it is */
.milo-segmented a.milo-tab-waiting {
    --milo-tab-amber: #d97706;
}

.milo-segmented a.milo-tab-waiting > i::before {
    background: linear-gradient(90deg, var(--milo-green-600), var(--milo-sage-200), var(--milo-tab-amber), var(--milo-green-600));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: milo-bell-rest-5 8.2s ease-in-out infinite, milo-bell-squish-5 8.2s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .milo-bell.is-waiting .milo-theme-toggle > i::before,
    .milo-bell.is-waiting .milo-theme-toggle:is(:hover, :focus-visible) > i::before,
    .milo-segmented a.milo-tab-waiting > i::before {
        animation: none;
    }
}

.milo-bell-menu {
    width: min(24rem, calc(100vw - 2rem));
    max-height: 70vh;
    overflow-y: auto;
    /* A pressed item slides (PRESS NUDGE) without scrolling the menu sideways */
    overflow-x: clip;
}

.milo-bell-head,
.milo-bell-empty {
    margin: 0;
    padding: 0.35rem 0.65rem 0.5rem;

    color: var(--milo-gray-700);

    font-size: 0.8rem;
}

.milo-bell-menu .dropdown-item {
    align-items: flex-start;
    white-space: normal;
}

.milo-bell-menu .dropdown-item > span {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.milo-bell-menu .dropdown-item small {
    color: var(--milo-gray-700);
}

.milo-bell-menu .is-danger > i {
    color: var(--milo-danger);
}

.milo-bell-menu .is-warning > i {
    color: #c2410c;
}

.milo-bell-action {
    font-size: 0.8rem;
    font-weight: 600;
}


.milo-user-avatar {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--milo-ink);

    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;

    overflow: hidden;
}


/* A profile photo, when there is one, fills the circle */
.milo-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.milo-user-name {
    color: var(--milo-charcoal);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.25;
}


.milo-user-role {
    color: var(--milo-gray);
    font-size: 0.7rem;
    line-height: 1.25;
}


/* =========================================================
   PROFILE PAGE
   ========================================================= */

/* Label / value pairs: "Name  Juan dela Cruz" */
.milo-profile-list {
    display: grid;
    grid-template-columns: 7rem 1fr;

    gap: 0.75rem 1rem;

    margin: 0;
}


.milo-profile-list dt {
    color: var(--milo-gray-700);

    font-size: 0.85rem;
    font-weight: 500;
}


.milo-profile-list dd {
    margin: 0;
}


/* What the role allows, in up to three columns */
.milo-profile-permissions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));

    gap: 0.5rem 1.5rem;

    margin: 0;
    padding: 0;

    list-style: none;
}


.milo-profile-permissions i {
    margin-right: 0.35rem;

    color: var(--milo-green-600);
}


/* =========================================================
   CONTENT
   ========================================================= */

.milo-content {
    padding:
        1.5rem;
}


/* The company footer: MILO's green, like the sidebar beside it (the
   same with lights on or off), kept at the bottom of short pages
   (.milo-main is a column, content grows) */
.milo-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.milo-content {
    flex: 1 0 auto;
}

/* A card on its own on the page (not in a row of columns) keeps its
   natural height: h-100 is for cards side by side, and here it would
   stretch to the whole page and run over the footer */
.milo-content > .h-100 {
    height: auto !important;
}

.milo-footer {
    padding: 0.6rem 1.5rem;

    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;

    color: rgba(255, 255, 255, 0.88);
    background: var(--milo-green-900);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}


/* =========================================================
   MODERN PAGE HEADER
   ========================================================= */

.milo-page-header {
    margin-bottom: 1.5rem;

    padding-bottom: 1.25rem;

    border-bottom:
        1px solid var(--milo-border);
}


/* ---------------------------------------------------------
   CONTEXT / CATEGORY
   --------------------------------------------------------- */

.milo-page-context {
    display: flex;
    align-items: center;

    gap: 0.5rem;

    min-height: 22px;

    margin-bottom: 0.65rem;

    font-size: 0.72rem;

    font-weight: 650;

    letter-spacing: 0.055em;

    text-transform: uppercase;
}


.milo-page-section {
    color:
        var(--milo-ink);
}


/* Trial (option 2): flips the row so it reads top-down,
   "SECTION / ← back", without changing the markup */
.milo-page-context-trail {
    flex-direction: row-reverse;
    justify-content: flex-end;
}


/* Trial (option 3b): round SVG back-arrow button before the icon */
.milo-page-back-arrow {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 36px;

    margin-top: 4px;

    color: var(--milo-gray-700);
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 50%;

    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease;
}


.milo-page-back-arrow:hover,
.milo-page-back-arrow:focus-visible {
    color: var(--milo-ink);
    background: var(--milo-sage-soft);
    border-color: var(--milo-sage-200);
}


/* A way back in the page itself (x-milo.back-chip), in place of a bare
   "← Back to …" link: the drawn arrow in a dark disc, in a raised
   white pill */
.milo-back-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.22rem 0.85rem 0.22rem 0.25rem;
    color: var(--milo-ink);
    background-color: var(--milo-surface);
    background-image: var(--milo-btn-face-light);
    border: 1px solid var(--milo-border);
    border-radius: 999px;
    box-shadow: var(--milo-btn-raised-light);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.milo-back-chip-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: #fff;
    background: var(--milo-metal), var(--milo-ink);
    border-radius: 50%;
    box-shadow: var(--milo-metal-rim);
}

.milo-back-chip-icon .milo-back-arrow-svg {
    width: 15px;
    height: 15px;
}

.milo-back-chip:hover,
.milo-back-chip:focus-visible {
    color: var(--milo-ink);
    background: var(--milo-sage-soft);
    border-color: var(--milo-sage-200);
}

.milo-back-chip:active { box-shadow: var(--milo-btn-pressed); }

.milo-back-chip:hover .milo-back-arrow-svg { transform: translateX(-2px); }

/* The arrow nudges left on hover, hinting "go back" */
.milo-back-arrow-svg {
    transition: transform 0.15s ease;
}



/* Trial (option 3a): the module icon is the back button.
   On hover the module icon slides out and the arrow slides in. */
.milo-page-header-icon-back {
    position: relative;

    text-decoration: none;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}


.milo-page-header-icon-back > i,
.milo-page-header-icon-back .milo-back-arrow-svg {
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}


.milo-page-header-icon-back .milo-back-arrow-svg {
    position: absolute;

    opacity: 0;
    transform: translateX(6px);
}


.milo-page-header-icon-back:hover,
.milo-page-header-icon-back:focus-visible {
    color: var(--milo-ink);
    background: var(--milo-sage-200);
}


.milo-page-header-icon-back:hover > i,
.milo-page-header-icon-back:focus-visible > i {
    opacity: 0;
    transform: translateX(-6px);
}


.milo-page-header-icon-back:hover .milo-back-arrow-svg,
.milo-page-header-icon-back:focus-visible .milo-back-arrow-svg {
    opacity: 1;
    transform: none;
}


/* Tooltip: a small dark label under anything with
   data-milo-tooltip="…", shown on hover or keyboard focus */
[data-milo-tooltip] {
    position: relative;
}


[data-milo-tooltip]::after {
    content: attr(data-milo-tooltip);

    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;

    padding: 0.3rem 0.55rem;

    color: #ffffff;
    background: var(--milo-ink);
    border-radius: 6px;

    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;

    /* Hidden, it takes no room: a tooltip near the right edge left
       invisible but laid out made the page scroll sideways (Reports'
       Print / PDF). Still fades in and out (display allow-discrete) */
    display: none;

    opacity: 0;
    transform: translateY(-3px);
    pointer-events: none;

    transition:
        opacity 0.12s ease,
        transform 0.12s ease,
        display 0.12s allow-discrete;
}


[data-milo-tooltip]:hover::after,
[data-milo-tooltip]:focus-visible::after {
    display: block;

    opacity: 1;
    transform: none;

    @starting-style {
        opacity: 0;
        transform: translateY(-3px);
    }
}


/* Tooltip for things on the right edge: opens leftwards (set by hand, or
   by the layout's script when it would run past the window) */
[data-milo-tooltip-end]::after,
[data-milo-tooltip-flip]::after {
    left: auto;
    right: 0;
}

/* Tooltip that opens upwards: for things at the foot of a box that
   scrolls (a lane's last card), where a note below would hang out of
   the box and give it a scrollbar. Set by hand, or (-rise) by the
   layout's script at the foot of a table's box */
[data-milo-tooltip-up]::after,
[data-milo-tooltip-rise]::after {
    top: auto;
    bottom: calc(100% + 8px);

    transform: translateY(3px);
}

[data-milo-tooltip-up]:hover::after,
[data-milo-tooltip-up]:focus-visible::after,
[data-milo-tooltip-rise]:hover::after,
[data-milo-tooltip-rise]:focus-visible::after {
    transform: none;

    @starting-style {
        transform: translateY(3px);
    }
}


/* Small square icon button (x-milo.icon-link) */
.milo-icon-link {
    width: 32px;
    height: 32px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    color: var(--milo-ink);
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 8px;

    font-size: 0.95rem;
    text-decoration: none;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}


.milo-icon-link:hover,
.milo-icon-link:focus-visible {
    color: var(--milo-ink);
    background: var(--milo-sage-soft);
    border-color: var(--milo-sage-200);
}


.milo-icon-link-sm {
    width: 26px;
    height: 26px;

    border-radius: 7px;

    font-size: 0.8rem;
}


/* The icon buttons (icon links, Lights and the bell, the back arrow,
   the trend cards' corner arrow, Reports' row arrows, and the corner icon
   of Classis's summary tiles, pointed at itself, with its note): the icon
   wobbles once like jelly when the pointer arrives (never while it rests
   there) and squashes when pressed, springing back on release. Only the
   icon moves; the name stays in the tooltip. */
@keyframes milo-icon-jelly {
    0% { transform: scale(1, 1); }
    30% { transform: scale(1.14, 0.86); }
    50% { transform: scale(0.94, 1.06); }
    70% { transform: scale(1.04, 0.97); }
    100% { transform: scale(1, 1); }
}

:is(.milo-icon-link, .milo-trend-card-go, .milo-row-go, .milo-theme-toggle) > i::before,
.milo-classis-tile .milo-next-icon > i::before,
.milo-page-back-arrow > .milo-back-arrow-svg {
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

:is(.milo-icon-link, .milo-trend-card-go, .milo-row-go, .milo-theme-toggle):is(:hover, :focus-visible) > i::before,
.milo-classis-tile .milo-next-icon:hover > i::before,
.milo-classis-tile:focus-visible .milo-next-icon > i::before,
.milo-page-back-arrow:is(:hover, :focus-visible) > .milo-back-arrow-svg {
    animation: milo-icon-jelly 0.45s ease;
}

:is(.milo-icon-link, .milo-trend-card-go, .milo-row-go, .milo-theme-toggle):active > i::before,
.milo-classis-tile .milo-next-icon:active > i::before,
.milo-page-back-arrow:active > .milo-back-arrow-svg {
    animation: none;
    transform: scale(1.14, 0.84);
    transition-duration: 0.08s;
}

@media (prefers-reduced-motion: reduce) {
    :is(.milo-icon-link, .milo-trend-card-go, .milo-row-go, .milo-theme-toggle) > i::before,
    .milo-classis-tile .milo-next-icon > i::before,
    .milo-page-back-arrow > .milo-back-arrow-svg {
        animation: none !important;
        transition: none;
    }
}


.milo-page-context-separator {
    color:
        #B0B6B1;
}


.milo-page-back {
    display: inline-flex;
    align-items: center;

    gap: 0.35rem;

    color:
        var(--milo-gray-700);

    text-decoration: none;

    transition:
        color 0.15s ease;
}


.milo-page-back:hover {
    color:
        var(--milo-ink);
}


/* ---------------------------------------------------------
   MAIN HEADER
   --------------------------------------------------------- */

.milo-page-header-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 2rem;
}

.milo-page-heading,
.milo-page-heading-copy {
    min-width: 0;
}

.milo-page-heading {
    flex: 1 1 auto;
}


.milo-page-header-icon {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 44px;

    color:
        var(--milo-ink);

    background:
        var(--milo-sage-soft);

    border:
        1px solid
        rgba(15, 107, 58, 0.08);

    border-radius:
        11px;

    font-size: 1.1rem;
}


.milo-page-title {
    margin: 0;

    color:
        var(--milo-ink);

    font-size:
        clamp(
            1.55rem,
            2vw,
            1.95rem
        );

    font-weight: 720;

    line-height: 1.2;

    letter-spacing:
        -0.025em;
}


.milo-page-subtitle {
    max-width: 68ch;

    color:
        var(--milo-gray-700);

    font-size: 0.88rem;

    line-height: 1.55;
}


.milo-page-header-actions {
    display: flex;
    align-items: center;

    gap: 0.5rem;

    flex-shrink: 0;
}


/* A short note under the subtitle (schedule remarks): white, with
   the lightest-green edge as the only accent */
.milo-page-note {
    max-width: 68ch;

    margin-top: 0.9rem;
    padding: 0.6rem 0.85rem;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-left: 3px solid var(--milo-sage-200);
    border-radius: var(--milo-radius-sm);
}


.milo-page-note-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;

    margin-bottom: 0.2rem;

    color: var(--milo-gray-700);

    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}


.milo-page-note-text {
    color: var(--milo-ink);

    font-size: 0.92rem;
    line-height: 1.5;

    /* Keep the line breaks typed in the Remarks box */
    white-space: pre-line;
    overflow-wrap: anywhere;
}


.milo-page-note-empty {
    color: var(--milo-gray);

    font-size: 0.85rem;
}


/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 767.98px) {

    .milo-page-header-main {
        flex-direction: column;

        gap: 1rem;
    }


    .milo-page-header-actions {
        width: 100%;

        flex-wrap: wrap;
    }


    .milo-page-header-icon {
        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }

}


/* =========================================================
   CARDS
   ========================================================= */

.card {
    border:
        1px solid var(--milo-border);

    border-radius:
        var(--milo-radius);

    box-shadow:
        var(--milo-shadow);
}


.card-header {
    gap: 0.75rem 1rem;

    background:
        var(--milo-surface);

    border-bottom:
        1px solid var(--milo-border);

    border-radius:
        var(--milo-radius)
        var(--milo-radius)
        0
        0 !important;

    font-weight:
        600;
}


/* =========================================================
   CARD HEADERS
   ========================================================= */

.card-header.d-flex > :first-child {
    min-width: 0;
}

.milo-section-header {
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.milo-section-heading {
    flex: 1 1 12rem;
    min-width: 0;
}

.milo-section-title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    line-height: 1.4;
}

.milo-section-title > .milo-info-tip {
    flex-shrink: 0;
    margin-inline-start: 0;
}

.milo-section-subtitle {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
}

.milo-section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex: 0 1 auto;
    max-width: 100%;
    gap: 0.5rem;
    margin-inline-start: auto;
}

/* =========================================================
   KPI
   ========================================================= */

.milo-kpi-head {
    gap: 1rem;
}

.milo-kpi-copy {
    min-width: 0;
}

.milo-kpi-head > .milo-kpi-icon {
    flex-shrink: 0;
}

/* White card; lifts slightly when pointed at */
.milo-kpi-card {
    height:
        100%;

    padding:
        1.1rem 1.15rem 1rem;

    background:
        var(--milo-surface);

    border:
        1px solid var(--milo-border);

    border-radius:
        var(--milo-radius);

    box-shadow:
        var(--milo-shadow);

    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}


.milo-kpi-card:hover {
    box-shadow:
        var(--milo-shadow-lg);

    transform:
        translateY(-1px);
}

/* A card that is a link (x-milo.kpi-card href): to the records it counts
   on the page, which slide. It reads as the other cards; focused from
   the keyboard, its figure's note shows */
.milo-kpi-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.milo-kpi-link:hover {
    color: inherit;
}

.milo-kpi-link:focus-visible .milo-kpi-value[data-milo-tooltip]::after {
    display: block;
    opacity: 1;
    transform: none;
}


.milo-kpi-label {
    color:
        var(--milo-gray);

    font-size:
        0.68rem;

    font-weight:
        700;

    letter-spacing:
        0.07em;

    text-transform:
        uppercase;
}


.milo-kpi-value {
    margin-top:
        0.4rem;

    color:
        var(--milo-ink);

    font-size:
        2rem;

    font-weight:
        750;

    line-height:
        1.1;

    letter-spacing:
        -0.02em;
}


/* The short description, under a hairline divider */
.milo-kpi-note {
    margin-top:
        0.85rem;

    padding-top:
        0.65rem;

    color:
        var(--milo-gray-700);

    border-top:
        1px solid var(--milo-border);

    font-size:
        0.75rem;
}


/* The icon square on each KPI card */
.milo-kpi-icon {
    position: relative;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    color: var(--milo-ink);
    background: var(--milo-sage-soft);
    border-radius: 11px;

    font-size: 1.1rem;
}


/* Alerting KPI icon: red tint for critical, orange for warnings */
.milo-kpi-icon-danger {
    color: #8b1a12;
    background: #fce1df;
}


.milo-kpi-icon-warning {
    color: #9a3412;
    background: #ffedd5;
}


/* =========================================================
   KPI BREAKDOWN
   A card with a breakdown shows it under itself on hover or
   keyboard focus, and keeps it open when clicked ("pinned").
   ========================================================= */

:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).has-breakdown {
    position: relative;

    cursor: pointer;
}


:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).has-breakdown:focus-visible {
    outline: 2px solid var(--milo-ink);
    outline-offset: 2px;
}


/* The open card sits above the cards and sections below it. Peeking
   opens it on hover or keyboard focus (never focus left by a mouse
   click), unless it was just closed (is-dismissed, until the pointer
   or focus leaves). */
:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).has-breakdown:not(.is-dismissed):hover,
:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).has-breakdown:not(.is-dismissed):focus-visible,
:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).has-breakdown:not(.is-dismissed):has(.milo-kpi-breakdown :focus-visible),
:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).is-pinned,
.milo-ring-stage:not(.is-dismissed):hover,
.milo-ring-stage:not(.is-dismissed):has(:focus-visible),
.milo-ring-stage.is-pinned {
    z-index: 40;
}


:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).is-pinned {
    border-color: var(--milo-sage-200);
}


/* Hidden until opened. The top padding is an invisible bridge, so the
   pointer can move from the card into the panel without it closing.
   Closed, it takes no room (display: none): only invisible, a card near
   the bottom made the page longer than the footer, an empty strip under
   it. It fades in when opened and closes at once: a fade-out outlived
   the card's raised layer, so the closing panel showed through under
   the cards below it. */
.milo-kpi-breakdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    display: none;

    padding-top: 8px;

    opacity: 0;
    transform: translateY(-4px);
}


:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).has-breakdown:not(.is-dismissed):hover .milo-kpi-breakdown,
:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).has-breakdown:not(.is-dismissed):focus-visible .milo-kpi-breakdown,
:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).has-breakdown:not(.is-dismissed):has(.milo-kpi-breakdown :focus-visible) .milo-kpi-breakdown,
:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).is-pinned .milo-kpi-breakdown,
.milo-ring-stage:not(.is-dismissed):hover .milo-kpi-breakdown,
.milo-ring-stage:not(.is-dismissed):has(:focus-visible) .milo-kpi-breakdown,
.milo-ring-stage.is-pinned .milo-kpi-breakdown {
    display: block;

    opacity: 1;
    transform: none;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        display 0.15s allow-discrete;

    @starting-style {
        opacity: 0;
        transform: translateY(-4px);
    }
}


.milo-kpi-breakdown-panel {
    max-height: 340px;

    padding: 0.75rem;

    overflow-y: auto;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow-lg);

    cursor: default;
}


.milo-kpi-breakdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 0.5rem;

    margin-bottom: 0.4rem;
    padding: 0 0.35rem;

    color: var(--milo-gray);

    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* A panel that has to scroll keeps its title at the top, so it never
   looks cut off: the title covers the panel's own top padding and stays
   there, on a solid background the rows pass under */
.milo-kpi-breakdown-panel > .milo-kpi-breakdown-head {
    position: sticky;
    top: -0.75rem;
    z-index: 1;

    margin: -0.75rem -0.75rem 0.4rem;
    padding: 0.75rem 1.1rem 0.4rem;

    background: var(--milo-surface);
    border-radius: var(--milo-radius) var(--milo-radius) 0 0;
}


.milo-kpi-breakdown-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    flex-shrink: 0;
}


/* The card name in the panel header shortens with "…" rather than wrap */
.milo-kpi-breakdown-head > span:first-child {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* "Click to pin" / "Pinned": always one line */
.milo-kpi-pin-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;

    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}


:is(.milo-kpi-card, .milo-trend-card, .milo-review-stat, .milo-report-stat, .milo-tp-tile).is-pinned .milo-kpi-pin-hint {
    color: var(--milo-ink);
}


/* One line of a breakdown: [time/icon] [main text] [count/side] */
.milo-breakdown-row {
    display: flex;
    align-items: center;

    gap: 0.6rem;

    padding: 0.45rem 0.35rem;

    color: var(--milo-charcoal);
    border-radius: 8px;

    font-size: 0.8rem;
    text-decoration: none;
}


a.milo-breakdown-row:hover {
    color: var(--milo-ink);
    background: var(--milo-surface-soft);
}


.milo-breakdown-time {
    flex-shrink: 0;

    width: 2.6rem;

    color: var(--milo-gray-700);

    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}


.milo-breakdown-main {
    display: flex;
    flex-direction: column;

    min-width: 0;
}


.milo-breakdown-main strong {
    color: var(--milo-ink);

    font-size: 0.78rem;
}


.milo-breakdown-main span {
    overflow: hidden;

    color: var(--milo-gray-700);

    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A sentence to read in full (Data Integrity's rules): it wraps */
.milo-breakdown-main.is-wrap span {
    white-space: normal;
}


.milo-breakdown-side {
    display: flex;
    align-items: center;

    gap: 0.35rem;

    flex-shrink: 0;

    margin-left: auto;

    color: var(--milo-gray);

    font-size: 0.7rem;
}


.milo-breakdown-side-stack {
    flex-direction: column;
    align-items: flex-end;

    gap: 0.1rem;
}


.milo-breakdown-row > .milo-badge,
.milo-breakdown-count {
    flex-shrink: 0;

    margin-left: auto;
}


.milo-breakdown-count {
    color: var(--milo-ink);

    font-weight: 700;
    font-variant-numeric: tabular-nums;
}


/* Small square icon, tinted by severity */
.milo-breakdown-icon {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 7px;

    font-size: 0.85rem;
}


.milo-breakdown-icon-warning {
    color: #9a3412;
    background: #ffedd5;
}


.milo-breakdown-icon-danger {
    color: #8b1a12;
    background: #fce1df;
}


.milo-breakdown-empty {
    padding: 0.6rem 0.35rem;

    color: var(--milo-gray-700);

    font-size: 0.8rem;
}


.milo-breakdown-footnote {
    margin-top: 0.4rem;
    padding: 0.5rem 0.35rem 0;

    color: var(--milo-gray-700);
    border-top: 1px solid var(--milo-border);

    font-size: 0.72rem;
}


/* A plain sentence in a breakdown: what the card is for, how to read it */
.milo-breakdown-text {
    padding: 0.2rem 0.35rem 0.4rem;

    color: var(--milo-gray-700);

    font-size: 0.75rem;
    line-height: 1.4;
}


/* A small heading inside a breakdown, e.g. "Add a trip to" */
.milo-breakdown-subhead {
    margin-top: 0.6rem;
    padding: 0.5rem 0.35rem 0.15rem;

    color: var(--milo-gray);
    border-top: 1px solid var(--milo-border);

    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.milo-breakdown-plus {
    width: 22px;
    height: 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    color: var(--milo-ink);
    background: var(--milo-sage-soft);
    border-radius: 6px;

    font-size: 0.75rem;
}

.milo-breakdown-more {
    display: block;

    padding: 0.3rem 0.35rem 0;

    color: var(--milo-gray-700);

    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
}

.milo-breakdown-more:hover {
    color: var(--milo-ink);
}

/* "See all N" that opens the rest in the same panel (x-milo.breakdown-script) */
button.milo-breakdown-more {
    width: 100%;

    background: none;
    border: 0;

    text-align: left;
}


/* Trip states, matching the trip card badges:
   grey pending, blue in transit, green completed */
.milo-state-bar {
    display: flex;

    height: 8px;

    margin: 0.25rem 0.35rem 0.5rem;

    overflow: hidden;

    border-radius: 999px;
}


.milo-state-bar > span + span {
    border-left: 2px solid var(--milo-surface);
}


.milo-state-bar-pending,
.milo-state-dot-pending {
    background: #c9cec9;
}


.milo-state-bar-transit,
.milo-state-dot-transit {
    background: var(--milo-info);
}


.milo-state-bar-completed,
.milo-state-dot-completed {
    background: var(--milo-green-700);
}


.milo-state-dot {
    width: 9px;
    height: 9px;

    flex-shrink: 0;

    border-radius: 50%;
}


/* =========================================================
   NOTIFICATION BUBBLE
   A count in a red or orange circle whose ring pulses outward
   to catch the eye. Used on the Needs Attention card and the
   sidebar. --milo-alert colours it; --milo-alert-pulse its ring.
   ========================================================= */

.milo-bubble-danger {
    --milo-alert: var(--milo-danger);
    --milo-alert-pulse: rgba(180, 35, 24, 0.45);
}


.milo-bubble-warning {
    --milo-alert: #c2410c;
    --milo-alert-pulse: rgba(194, 65, 12, 0.45);
}

/* In the menu panels: the rail's amber, since a rail dot sums these up */
.milo-flyout .milo-bubble-warning {
    --milo-alert: var(--milo-warning);
    --milo-alert-pulse: color-mix(in srgb, var(--milo-warning) 45%, transparent);
}


/* Sits on the top-right corner of the icon it belongs to */
.milo-bubble {
    position: absolute;
    top: -7px;
    right: -7px;

    min-width: 20px;
    height: 20px;
    padding: 0 5px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;
    background: var(--milo-alert);
    border: 2px solid #ffffff;
    border-radius: 999px;

    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;

    animation: milo-alert-pulse 1.8s ease-out infinite;
}


/* On the dark sidebar: edge matches the rail, and it pulses
   three times per page instead of non-stop, so it reminds
   without distracting while you work */
.milo-rail-icon .milo-bubble {
    border-color: var(--milo-green-950);

    animation-iteration-count: 3;
}


/* Beside a panel link instead of on an icon */
.milo-bubble-inline {
    position: static;

    margin-left: auto;

    border: 0;

    animation: none;
}


@keyframes milo-alert-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--milo-alert-pulse);
    }

    70% {
        box-shadow: 0 0 0 10px transparent;
    }

    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}


@media (prefers-reduced-motion: reduce) {

    .milo-bubble {
        animation: none;
    }

}


/* =========================================================
   FLEET STATUS (sidebar, under the Attention link)
   Dot colours: white available, green in use, orange idle,
   red unavailable (maintenance or repair).
   ========================================================= */

/* Two columns: Available | In use, then Idle | Unavailable */
.milo-fleet-status {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 0.35rem 0.85rem;

    margin: 0.1rem 0.75rem 0.5rem;
    padding: 0.6rem 0.75rem;

    color: var(--milo-gray-700);
    background: var(--milo-surface-soft);
    border-radius: 10px;

    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}


.milo-fleet-status:hover {
    color: var(--milo-ink);
}


.milo-fleet-status > span {
    display: inline-flex;
    align-items: center;

    gap: 0.45rem;
}

/* The Vehicles page's state chips, a size down for the menu */
.milo-fleet-status .milo-chip {
    padding: 0.1rem 0.5rem;

    font-size: 0.72rem;
}


.milo-fleet-title {
    grid-column: 1 / -1;

    color: var(--milo-gray);

    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}


.milo-fleet-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;
}


.milo-fleet-dot-utilized {
    background: var(--milo-green-600);
}


.milo-fleet-dot-idle {
    /* Available: free to assign, not a problem */
    background: var(--milo-sage-500);
}


/* Dark red: the vehicle itself can't run */
.milo-fleet-dot-maintenance {
    background: #7f1d1d;
}


/* =========================================================
   OPERATIONAL REVIEW (Cockpit, big card)
   Today's numbers in a row, then one line per schedule with
   its trips as a split bar (grey pending, blue in transit,
   green arrived).
   ========================================================= */

.milo-review-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));

    gap: 0.75rem;

    padding-bottom: 1rem;
    margin-bottom: 0.5rem;

    border-bottom: 1px solid var(--milo-border);
}


.milo-review-stat-value {
    color: var(--milo-ink);

    font-size: 1.5rem;
    font-weight: 750;
    line-height: 1.1;
}


.milo-review-stat-label {
    display: flex;
    align-items: center;

    gap: 0.35rem;

    margin-top: 0.2rem;

    color: var(--milo-gray-700);

    font-size: 0.75rem;
}


.milo-review-row {
    display: grid;
    grid-template-columns: 3.2rem minmax(0, 1.4fr) minmax(0, 1fr) auto;
    align-items: center;

    gap: 0.9rem;

    padding: 0.6rem 0.4rem;

    color: var(--milo-ink);
    border-bottom: 1px solid var(--milo-border);

    text-decoration: none;
}


.milo-review-row:last-child {
    border-bottom: 0;
}


/* Each number opens what's behind it, like the KPI cards. A little
   room around it to show it can be opened; its breakdown is wider
   than the number, and the last two open leftwards, inside the card. */
.milo-review-stat.has-breakdown {
    margin: -0.4rem;
    padding: 0.4rem;

    border-radius: 8px;
}

.milo-review-stat.has-breakdown:hover {
    background: var(--milo-surface-soft);
}

.milo-review-stat .milo-kpi-breakdown {
    right: auto;

    width: min(21rem, 85vw);
}

.milo-review-stat:nth-last-child(-n + 2) .milo-kpi-breakdown {
    left: auto;
    right: 0;
}

/* Reports' headline figures open what they count, like the KPI cards;
   the breakdown is wider than a figure, and the last ones open
   leftwards, inside the row. */
.milo-report-stat .milo-kpi-breakdown {
    right: auto;

    width: min(22rem, 85vw);
}

.milo-report-stat:nth-last-child(-n + 2) .milo-kpi-breakdown {
    left: auto;
    right: 0;
}

.milo-report-stat.has-breakdown:hover {
    border-color: var(--milo-ink);
}


/* Release & Receipt's counters open what they count, like the KPI cards,
   while a click still filters the queue (no pinning). The breakdown is
   wider than a counter on a phone, so the right-hand ones open leftwards. */
.milo-tp-tile .milo-kpi-breakdown {
    right: auto;

    width: max(100%, min(21rem, 85vw));
}

.milo-custody-counters > :nth-child(even) .milo-kpi-breakdown {
    left: auto;
    right: 0;
}

/* Third-Party's tiles: the ones on the right of their row open leftwards
   (two a row on a phone, three on a tablet, six on a wide screen) */
@media (max-width: 767.98px) {
    .milo-tp-tiles > :nth-child(even) .milo-kpi-breakdown {
        left: auto;
        right: 0;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .milo-tp-tiles > :nth-child(3n) .milo-kpi-breakdown {
        left: auto;
        right: 0;
    }
}

@media (min-width: 1200px) {
    .milo-tp-tiles > :nth-child(n + 4) .milo-kpi-breakdown {
        left: auto;
        right: 0;
    }
}

.milo-tp-tile.has-breakdown:hover {
    border-color: var(--milo-ink);
}


/* Under the label, e.g. "No transport schedules today" */
.milo-review-stat-note {
    margin-top: 0.15rem;

    color: var(--milo-gray);

    font-size: 0.7rem;
}


.milo-review-row:hover {
    background: var(--milo-surface-soft);
}


.milo-review-time {
    color: var(--milo-gray-700);

    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}


.milo-review-main {
    display: flex;
    flex-direction: column;

    min-width: 0;
}


.milo-review-main strong {
    font-size: 0.82rem;
}


.milo-review-main span {
    overflow: hidden;

    color: var(--milo-gray-700);

    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.milo-review-progress .milo-state-bar {
    margin: 0 0 0.25rem;

    background: var(--milo-surface-soft);
}


.milo-review-progress-text {
    color: var(--milo-gray-700);

    font-size: 0.72rem;
}


.milo-review-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 0.4rem;
}


/* Phones: progress under the name, badges last */
@media (max-width: 767.98px) {

    .milo-review-row {
        grid-template-columns: 3.2rem minmax(0, 1fr);
    }

    .milo-review-progress,
    .milo-review-side {
        grid-column: 2;
    }

    .milo-review-side {
        justify-content: flex-start;
    }

}


/* =========================================================
   VEHICLE UTILIZATION (Cockpit, small card)
   ========================================================= */

.milo-utilization-head {
    margin-bottom: 1rem;
}


.milo-utilization-value {
    color: var(--milo-ink);

    font-size: 2rem;
    font-weight: 750;
    line-height: 1.1;
}


.milo-utilization-note {
    margin-top: 0.2rem;

    color: var(--milo-gray-700);

    font-size: 0.8rem;
}


/* =========================================================
   VEHICLE POSITION (Cockpit card)
   One bar split by status, then a row per status.
   ========================================================= */

.milo-fleet-bar {
    display: flex;

    height: 10px;

    margin-bottom: 1rem;

    border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--milo-border);
}


.milo-fleet-bar > span + span {
    border-left: 2px solid var(--milo-surface);
}


/* Rounded ends on the segments themselves, so a segment's tooltip
   isn't clipped by the bar */
.milo-fleet-bar > span:first-child {
    border-radius: 999px 0 0 999px;
}

.milo-fleet-bar > span:last-child {
    border-radius: 0 999px 999px 0;
}

.milo-fleet-bar > span:only-child {
    border-radius: 999px;
}


.milo-fleet-bar-utilized {
    background: var(--milo-green-600);
}


.milo-fleet-bar-idle {
    /* Available: free to assign, not a problem */
    background: var(--milo-sage-500);
}



.milo-fleet-bar-maintenance {
    background: #7f1d1d;
}


.milo-fleet-rows {
    margin: 0;
    padding: 0;

    list-style: none;
}


.milo-fleet-rows li {
    display: flex;
    align-items: center;

    gap: 0.6rem;

    padding: 0.55rem 0;

    border-bottom: 1px solid var(--milo-border);

    font-size: 0.85rem;
}


.milo-fleet-rows li:last-child {
    border-bottom: 0;
}


.milo-fleet-rows strong {
    margin-left: auto;

    color: var(--milo-ink);

    font-variant-numeric: tabular-nums;
}


/* =========================================================
   BUTTONS
   ========================================================= */

/* Main action: light green with black text, like the M badge */
.btn-primary,
.btn-primary:disabled {
    color:
        var(--milo-ink);

    background:
        var(--milo-sage-200);

    border-color:
        var(--milo-sage-200);

    font-weight:
        600;

    box-shadow:
        var(--milo-btn-raised);
}


.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    color:
        var(--milo-ink) !important;

    background:
        #86c99a !important;

    border-color:
        #86c99a !important;
}


/* Pressed (and a selected toggle): pushed in */
.btn-primary:active,
.btn-primary.active {
    box-shadow:
        var(--milo-btn-pressed);
}


/* Keyboard focus: still raised, with a green ring instead of
   Bootstrap's blue one */
.btn-primary:focus-visible {
    box-shadow:
        var(--milo-btn-raised),
        0 0 0 3px rgba(23, 133, 74, 0.35);
}


/* Can't be pressed, so it doesn't stand up */
.btn-primary:disabled,
.btn-primary.disabled {
    box-shadow:
        none;
}


/* Secondary action: white with a black outline */
.btn-outline-primary {
    color:
        var(--milo-ink);

    border-color:
        #c9cec9;
}


.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    color:
        var(--milo-ink) !important;

    background:
        var(--milo-sage-soft) !important;

    border-color:
        var(--milo-sage-200) !important;
}


/* White buttons stand up too: a white face (not see-through) so the
   raised edge reads on the off-white page */
.btn-outline-primary,
.btn-outline-secondary {
    --bs-btn-bg:
        var(--milo-surface);

    /* Hover and pressed: pale green, as the white buttons already do,
       not Bootstrap's solid grey; disabled: grey, not Bootstrap blue */
    --bs-btn-hover-color: var(--milo-ink);
    --bs-btn-hover-bg: var(--milo-sage-soft);
    --bs-btn-hover-border-color: var(--milo-sage-200);
    --bs-btn-active-color: var(--milo-ink);
    --bs-btn-active-bg: var(--milo-sage-soft);
    --bs-btn-active-border-color: var(--milo-sage-200);
    --bs-btn-disabled-color: var(--milo-gray);
    --bs-btn-disabled-border-color: #c9cec9;

    background-image:
        var(--milo-btn-face-light);

    box-shadow:
        var(--milo-btn-raised-light);
}


/* Hover and pressed show their pale green flat; disabled is flat */
.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-outline-primary:disabled,
.btn-outline-primary.disabled,
.btn-outline-secondary:hover,
.btn-outline-secondary:active,
.btn-outline-secondary.active,
.btn-outline-secondary:disabled,
.btn-outline-secondary.disabled {
    background-image:
        none;
}


.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-outline-secondary:active,
.btn-outline-secondary.active {
    box-shadow:
        var(--milo-btn-pressed);
}


.btn-outline-primary:focus-visible,
.btn-outline-secondary:focus-visible {
    box-shadow:
        var(--milo-btn-raised-light),
        0 0 0 3px rgba(23, 133, 74, 0.35);
}


.btn-outline-primary:disabled,
.btn-outline-primary.disabled,
.btn-outline-secondary:disabled,
.btn-outline-secondary.disabled {
    box-shadow:
        none;
}


/* =========================================================
   FORMS
   ========================================================= */

.form-control,
.form-select {
    min-height:
        40px;

    border-color:
        #d5dad6;

    border-radius:
        8px;
}


.form-control:focus,
.form-select:focus {
    border-color:
        var(--milo-ink);

    box-shadow:
        0 0 0 0.18rem
        rgba(23,133,74,0.12);
}


/* The "e.g. …" example in an empty box: light and slanted so it never
   reads as typed text, and gone the moment the box is clicked, so
   there's nothing to backspace. (A field whose name sits inside its
   box works the other way round: the example shows once you click in;
   FLOATING LABELS.) */
[placeholder^="e.g."]::placeholder {
    color: var(--milo-gray);
    font-style: italic;
    opacity: 1;
}

[placeholder^="e.g."]:focus::placeholder {
    color: transparent;
}


/* An arrow that opens something turns over while it's open: a chevron
   on a button that says so (aria-expanded: Custom, Show more, the name
   menu), and a dropdown's arrow while its list shows. The rail's group
   counts and folded sections turn already, by their own rules. */
[aria-expanded] > .bi-chevron-down {
    transition: rotate 0.2s ease;
}


[aria-expanded="true"] > .bi-chevron-down {
    rotate: 180deg;
}


.ts-wrapper.form-select.dropdown-active {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 11 6-6 6 6'/%3e%3c/svg%3e");
}


html[data-bs-theme="dark"] .ts-wrapper.form-select.dropdown-active {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 11 6-6 6 6'/%3e%3c/svg%3e");
}


/* Plain selects, where the browser knows :open (each in a rule of its
   own, so a browser that doesn't drops only these) */
select.form-select:open {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 11 6-6 6 6'/%3e%3c/svg%3e");
}


html[data-bs-theme="dark"] select.form-select:open {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 11 6-6 6 6'/%3e%3c/svg%3e");
}


@media (prefers-reduced-motion: reduce) {
    [aria-expanded] > .bi-chevron-down {
        transition: none;
    }
}


.form-label {
    color:
        var(--milo-charcoal);

    font-size:
        0.85rem;

    font-weight:
        600;
}


/* =========================================================
   ROLLING NUMBERS
   Numbers marked with data-milo-count roll up into place.
   The script in layouts/milo.blade.php turns every digit
   into a column of 0–9 inside a one-line window; --d slides
   the column up so only that digit shows.
   ========================================================= */

/* Every digit takes the same width, so numbers don't shift */
[data-milo-count] {
    font-variant-numeric: tabular-nums;
}


.milo-roll {
    display: inline-flex;
}


/* Commas, decimal points, ₱ and % between the digits */
.milo-roll-char {
    white-space: pre;
}


/* The one-line window */
.milo-roll-digit {
    height: 1lh;
    overflow: hidden;
}


/* The 0–9 column; moves up by --d lines */
.milo-roll-strip {
    --d: 0;

    display: flex;
    flex-direction: column;

    translate: 0 calc(var(--d) * -1lh);

    transition: translate 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}


/* =========================================================
   TABLES
   ========================================================= */

.table {
    --bs-table-bg:
        transparent;

    margin-bottom:
        0;
}


.table thead th {
    padding:
        0.8rem;

    background:
        var(--milo-surface-soft);

    color:
        var(--milo-gray-700);

    border-bottom:
        1px solid var(--milo-border);

    font-size:
        0.7rem;

    font-weight:
        700;

    letter-spacing:
        0.045em;

    text-transform:
        uppercase;

    /* Never split a word ("VARIAN / CE"): Bootstrap's .card lets long
       words break, which a narrow column header would otherwise do */
    overflow-wrap:
        normal;
}


.table tbody td {
    padding:
        0.85rem
        0.8rem;

    border-color:
        #edf0ed;
}


.table tbody tr:hover {
    background:
        rgba(15,107,58,0.035);
}


/* =========================================================
   STATUS
   ========================================================= */

.milo-badge {
    display:
        inline-flex;

    align-items:
        center;

    padding:
        0.3rem
        0.55rem;

    border-radius:
        999px;

    font-size:
        0.7rem;

    font-weight:
        700;
}

/* Release & Receipt tables: one pill per cell, a small line under it */
.milo-custody-table {
    width: 100%;
    min-width: 60rem;
    table-layout: fixed;
    font-size: 0.875rem;
}

/* At the narrowest (60rem) every header word still fits its column */
.milo-custody-table th:nth-child(1) { width: 15%; }
.milo-custody-table th:nth-child(2) { width: 11%; }
.milo-custody-table th:nth-child(3) { width: 13%; }
.milo-custody-table th:nth-child(4),
.milo-custody-table th:nth-child(5) { width: 11%; }
.milo-custody-table th:nth-child(6) { width: 9%; }
.milo-custody-table th:nth-child(7) { width: 11%; }
.milo-custody-table th:nth-child(8) { width: 13%; }

:is(.milo-custody-table, .milo-tp-table) thead th {
    padding-inline: 0.5rem;
}

.milo-custody-table td {
    overflow-wrap: anywhere;
}

.milo-custody-table th {
    padding-block: 0.75rem;
    line-height: 1.4;
}

.milo-custody-table :is(th, td):nth-child(n+4),
.milo-custody-recent :is(th, td):nth-child(n+6) {
    text-align: center;
}

/* Third-Party jobs: fixed columns, so long names slide (.milo-marquee) */
.milo-tp-table {
    min-width: 64rem;
    table-layout: fixed;
}

/* The last column holds the 32 px Open button and its padding at any
   width, so the button never touches the card's edge. Evidence and
   Cost are wide enough for a one-line "Missing Receipt" or "Not
   recorded" at the table's narrowest; Requested by, Route and Provider
   give the room (their long names slide when pointed at), and Status a
   point (its second line wraps anyway) */
.milo-tp-table th:nth-child(1) { width: 6%; }
.milo-tp-table th:nth-child(2) { width: 15%; }
.milo-tp-table th:nth-child(3) { width: 11%; }
.milo-tp-table th:nth-child(4) { width: 11%; }
.milo-tp-table th:nth-child(5) { width: 12%; }
.milo-tp-table th:nth-child(6) { width: 12%; }
.milo-tp-table th:nth-child(7) { width: 14%; }
.milo-tp-table th:nth-child(8) { width: 13%; }
.milo-tp-table th:nth-child(9) { width: 3.75rem; }

/* Long POD labels wrap inside their pill instead of widening the column */
:is(.milo-custody-table, .milo-custody-recent, .milo-tp-table) .milo-chip {
    white-space: normal;
    overflow-wrap: normal;
}

/* Third-Party: a chip that still has to wrap ("Missing POD & Receipt",
   "Not marked delivered") reads from the left, in a rounded box, even
   in the right-aligned Cost column; on one line it's the usual pill */
.milo-tp-table .milo-chip {
    text-align: start;
    border-radius: 0.75rem;
}

.milo-custody-scroll th:last-child,
.milo-custody-scroll td:last-child {
    position: sticky;
    right: 0;
    width: 3.5rem;
    padding-inline: 0.5rem;
    z-index: 2;
    background: var(--milo-surface);
    box-shadow: -4px 0 6px rgba(0, 0, 0, 0.06);
}

.milo-custody-scroll th:last-child {
    z-index: 3;
    background: var(--milo-surface-soft);
}

.milo-custody-action,
.milo-detail-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

/* An icon that fills up while its link or button is pointed at (hover,
   keyboard focus or a finger on it): the filled icon rises from the
   bottom over the outline one. Release & Receipt's Review eye. */
.milo-icon-fill {
    display: inline-grid;
}

.milo-icon-fill > i {
    grid-area: 1 / 1;
    line-height: 1;
    transition: clip-path 0.35s ease;
}

.milo-icon-fill > i::before {
    display: block;
}

.milo-icon-fill > i:first-child {
    clip-path: inset(0 0 0 0);
}

.milo-icon-fill > i:last-child {
    clip-path: inset(100% 0 0 0);
}

:is(a, button):is(:hover, :focus-visible, :active) > .milo-icon-fill > i:first-child {
    clip-path: inset(0 0 100% 0);
}

:is(a, button):is(:hover, :focus-visible, :active) > .milo-icon-fill > i:last-child {
    clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
    .milo-icon-fill > i {
        transition: none;
    }
}

.milo-custody-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
}

.milo-custody-time time {
    white-space: nowrap;
}

/* x-milo.detail-popover: an icon button, or a chip when it has a word */
.milo-detail {
    display: inline-flex;
}

.milo-detail-trigger {
    padding: 0;
    color: var(--milo-gray-700);
    background: var(--milo-surface-soft);
    border: 1px solid var(--milo-border);
    border-radius: 0.5rem;
    cursor: pointer;
}

.milo-chip-button {
    cursor: pointer;
}

.milo-detail-trigger:hover,
.milo-chip-button:hover,
.milo-detail-trigger:focus-visible,
.milo-chip-button:focus-visible {
    border-color: currentColor;
}

.milo-detail-trigger:focus-visible,
.milo-chip-button:focus-visible {
    outline: 2px solid var(--milo-cocoa-green);
    outline-offset: 2px;
}

.milo-chip.milo-chip-sky {
    color: var(--milo-sky);
    background: color-mix(in srgb, var(--milo-sky) 10%, var(--milo-surface));
    border-color: color-mix(in srgb, var(--milo-sky) 40%, var(--milo-border));
}

/* A red count on a chip's corner */
.milo-chip-bubble {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    color: #fff;
    background: var(--milo-danger);
    border: 2px solid var(--milo-surface);
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: calc(1.15rem - 4px);
    text-align: center;
}

/* Text that opens a record and shows a breakdown on hover */
.milo-detail-link {
    padding: 0;
    color: inherit;
    font: inherit;
    text-align: start;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    background: none;
    border: 0;
    cursor: pointer;
}

.milo-detail-link:hover,
.milo-detail-link:focus-visible {
    color: var(--milo-cocoa-green);
    text-decoration-style: solid;
}

.milo-detail-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0;
}

.milo-detail-facts dt {
    color: var(--milo-gray-700);
    font-weight: 600;
}

.milo-detail-facts dd {
    margin: 0;
}

/*
 * One line of text that may not fit: it fades out at the right edge and,
 * on hover or focus, slides just far enough to show the rest, then back.
 * Wrap the text (or a link) in one child element. Needs a box whose width
 * doesn't come from its text (a fixed-layout table cell, a grid column).
 */
.milo-marquee {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    container-type: inline-size;
    mask-image: linear-gradient(to right, #000 calc(100% - 1.25rem), transparent);
}

.milo-marquee > * {
    display: inline-block;
    width: max-content;
}

/* Also when the whole card is a link: pointing at the card slides it */
.milo-marquee:is(:hover, :focus-within),
a:is(:hover, :focus-visible) > .milo-marquee {
    mask-image: none;
}

.milo-marquee:is(:hover, :focus-within) > *,
a:is(:hover, :focus-visible) > .milo-marquee > * {
    animation: milo-marquee 5s ease-in-out infinite alternate;
}

/* min(): text that fits doesn't move */
@keyframes milo-marquee {
    0%,
    15% {
        transform: translateX(0);
    }

    85%,
    100% {
        transform: translateX(min(0px, calc(100cqw - 100%)));
    }
}

/*
 * Something on its way: a soft light sweeps across it. The light is a
 * tint of the text colour, so it shows on light, dark and green cards.
 * Add .milo-loading to any box; the weather card and Reports use it
 * through their own loading states.
 */
.milo-loading,
.milo-day-card[data-state="loading"] .milo-day-now,
.milo-report-loading .milo-report-toolbar ~ * :is(.card-body, .milo-report-stat) {
    background-image: linear-gradient(90deg, transparent 30%, color-mix(in srgb, currentColor 12%, transparent) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: milo-sweep 1.2s linear infinite;
}

.milo-day-card[data-state="loading"] .milo-day-now {
    border-radius: 0.5rem;
}

/* From off the left edge to off the right edge */
@keyframes milo-sweep {
    from {
        background-position: 150% 0;
    }

    to {
        background-position: -50% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .milo-loading,
    .milo-day-card[data-state="loading"] .milo-day-now,
    .milo-report-loading .milo-report-toolbar ~ * :is(.card-body, .milo-report-stat) {
        animation: none;
    }

    .milo-marquee:is(:hover, :focus-within),
    a:is(:hover, :focus-visible) > .milo-marquee {
        white-space: normal;
    }

    .milo-marquee:is(:hover, :focus-within) > *,
    a:is(:hover, :focus-visible) > .milo-marquee > * {
        width: auto;
        animation: none;
    }
}

.milo-detail-popover {
    --bs-popover-max-width: min(22rem, calc(100vw - 2rem));
    --bs-popover-bg: var(--milo-surface);
    --bs-popover-border-color: var(--milo-border);
    --bs-popover-header-bg: var(--milo-surface-soft);
    --bs-popover-header-color: var(--milo-ink);
    --bs-popover-body-color: var(--milo-ink);
    box-shadow: var(--milo-shadow-lg);
    overflow-wrap: anywhere;
}

.milo-detail-content {
    line-height: 1.5;
}


.milo-status-success {
    background:
        #dff2e4;

    color:
        var(--milo-green-800);
}


.milo-status-warning {
    background:
        #fff0cc;

    color:
        #7a4900;
}


.milo-status-danger {
    background:
        #fce1df;

    color:
        #8b1a12;
}


.milo-status-info {
    background:
        #dfebf1;

    color:
        #294d60;
}


/* The default when no type is given */
.milo-status-neutral {
    background:
        var(--milo-surface-soft);

    color:
        var(--milo-gray-700);
}


/* Vehicle "Available": white, outlined so it shows on light backgrounds */
.milo-status-light {
    background:
        #ffffff;

    color:
        var(--milo-gray-700);

    box-shadow:
        inset 0 0 0 1px var(--milo-border);
}


/* Cancelled: grey and struck through */
.milo-status-cancelled {
    background:
        var(--milo-surface-soft);

    color:
        var(--milo-gray);

    text-decoration:
        line-through;
}


/* Vehicle "Idle": orange, kept apart from the yellow warning badge */
.milo-status-orange {
    background:
        #ffedd5;

    color:
        #9a3412;
}


/* =========================================================
   COCKPIT INTELLIGENCE
   ========================================================= */

.milo-attention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    padding:
        0.8rem
        0;

    border-bottom:
        1px solid var(--milo-border);
}

.milo-attention-item:last-child {
    border-bottom: 0;
}

.milo-attention-icon {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius:
        9px;

    background:
        var(--milo-surface-muted);

    color:
        var(--milo-ink);

    flex-shrink: 0;
}

.milo-attention-label {
    color:
        var(--milo-charcoal);

    font-size:
        0.84rem;

    font-weight:
        600;
}

.milo-attention-description {
    color:
        var(--milo-muted);

    font-size:
        0.7rem;
}


.milo-position-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0.8rem;
}

.milo-position-card {
    padding: 0.9rem;

    background:
        var(--milo-surface-muted);

    border-radius:
        var(--milo-radius-sm);
}

.milo-position-value {
    color:
        var(--milo-ink);

    font-size:
        1.35rem;

    font-weight:
        700;
}

.milo-position-label {
    margin-top: 0.15rem;

    color:
        var(--milo-muted);

    font-size:
        0.7rem;

    font-weight:
        600;

    text-transform:
        uppercase;

    letter-spacing:
        0.04em;
}


.milo-cost-total {
    color:
        var(--milo-ink);

    font-size:
        2rem;

    font-weight:
        750;

    letter-spacing:
        -0.03em;
}

.milo-cost-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding:
        0.65rem
        0;

    border-bottom:
        1px solid var(--milo-border);

    font-size:
        0.82rem;
}

.milo-cost-row:last-child {
    border-bottom: 0;
}


.milo-timing-value {
    color:
        var(--milo-ink);

    font-size:
        2rem;

    font-weight:
        750;
}

.milo-timing-progress {
    height: 8px;

    background:
        #E8ECE8;

    border-radius:
        999px;

    overflow: hidden;
}

/* Trip card: Planned / Actual / Variance for departure and arrival */
.milo-timing-table {
    width: 100%;

    font-size: 0.85rem;
}


.milo-timing-table th,
.milo-timing-table td {
    padding: 0.2rem 0.75rem 0.2rem 0;
}


.milo-timing-table thead th {
    color: var(--milo-gray-700);

    font-size: 0.75rem;
    font-weight: 500;
}


.milo-timing-table tbody th {
    color: var(--milo-gray-700);

    font-weight: 500;
}


/* Variance: green early/on time, orange late, red overdue */
.milo-variance {
    color: var(--milo-gray);

    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}


.milo-variance-ok {
    color: var(--milo-green-700);
}


.milo-variance-late {
    color: #c2410c;
}


.milo-variance-overdue {
    color: var(--milo-danger);
}


/* Small explanation under a cost label, e.g. "Recorded cost ÷ 12 trips today" */
.milo-cost-note {
    display: block;

    color: var(--milo-gray);

    font-size: 0.7rem;
}


/* The second, smaller timing measure under a divider */
.milo-timing-secondary {
    margin-top: 1rem;
    padding-top: 0.85rem;

    border-top: 1px solid var(--milo-border);
}


.milo-timing-secondary strong {
    color: var(--milo-ink);
}


/* Three standing reminders under the Timing figures, in black and
   white; the alert under them is the only colour (red when a
   departure is missing, amber when only arrivals are) */
.milo-timing-reminders {
    margin-top: 1rem;
    padding-top: 0.85rem;

    border-top: 1px solid var(--milo-border);
}


.milo-timing-reminders-title {
    margin-bottom: 0.4rem;

    color: var(--milo-gray-700);

    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}


.milo-timing-reminders ol {
    margin: 0;
    padding-left: 1.1rem;

    color: var(--milo-gray-700);

    font-size: 0.8rem;
    line-height: 1.45;
}


.milo-timing-reminders li + li {
    margin-top: 0.3rem;
}


.milo-timing-reminders li strong {
    color: var(--milo-ink);

    font-weight: 600;
}


.milo-timing-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    margin-top: 0.75rem;
    padding: 0.5rem 0.7rem;

    border-radius: var(--milo-radius-sm);

    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}


.milo-timing-alert-danger {
    color: #8b1a12;
    background: #fce1df;
}


.milo-timing-alert-warning {
    color: #9a3412;
    background: #ffedd5;
}


.milo-timing-alert:hover {
    filter: brightness(0.97);
}


/* Jumped to from a link on the same page: stops below the sticky
   top bar instead of under it */
.milo-anchor-target {
    scroll-margin-top: 88px;
}


.milo-timing-progress-thin {
    height: 6px;

    margin-top: 0.35rem;
}


.milo-timing-progress-bar {
    height: 100%;

    background:
        var(--milo-ink);

    border-radius:
        999px;
}


/* Activity Center tile: quiet by default (soft fill, no visible
   border); becomes a white card when pointed at */
.milo-action-tile {
    position: relative;

    display: flex;
    align-items: center;

    gap: 0.7rem;

    width: 100%;

    padding:
        0.7rem 0.75rem;

    color:
        var(--milo-charcoal);

    background:
        var(--milo-surface-soft);

    border:
        1px solid transparent;

    border-radius:
        var(--milo-radius-sm);

    text-decoration:
        none;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.milo-action-tile:hover {
    color:
        var(--milo-ink);

    background:
        var(--milo-surface);

    border-color:
        var(--milo-border);

    box-shadow:
        var(--milo-shadow-sm);

    transform:
        translateY(-1px);
}

/* The tile pointed at sits over its neighbours, so the hover notes of
   its water icon and bubble open over the next tile, not under it (the
   lift makes the tile its own layer, which the next tile painted over).
   Pointing only: a tile with focus (clicked, or tabbed to) raised as
   high came later on the page and covered the pointed tile's note */
.milo-action-tile:hover {
    z-index: 10;
}

/* White icon chip on the soft tile */
.milo-action-icon {
    width: 32px;
    height: 32px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background:
        var(--milo-surface);

    color:
        var(--milo-ink);

    border-radius:
        8px;

    font-size:
        0.95rem;

    flex-shrink: 0;

    transition:
        background-color 0.15s ease;
}

.milo-action-tile:hover .milo-action-icon {
    background:
        var(--milo-sage-soft);
}

/* Lets the line under the title shorten with "…" instead of wrapping */
/* Takes the room beside the icon, no more, so its chips wrap inside
   the tile instead of running past its edge */
.milo-action-text {
    flex: 1;
    min-width: 0;
}

.milo-action-title {
    font-size:
        0.8rem;

    font-weight:
        600;
}

.milo-action-subtitle,
.milo-action-update,
.milo-action-alert {
    overflow: hidden;

    font-size:
        0.68rem;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.milo-action-subtitle {
    color:
        var(--milo-muted);
}


/* =========================================================
   ACTIVITY CENTER (Cockpit)
   A green bubble on a tile = records changed since you last
   opened that module. Green means "new"; red and orange stay
   reserved for "needs attention".
   ========================================================= */

.milo-bubble-new {
    --milo-alert: var(--milo-green-600);
    --milo-alert-pulse: rgba(23, 133, 74, 0.4);
}


/* Inside the tile's top-right corner; pulses three times */
.milo-action-tile .milo-bubble {
    top: 8px;
    right: 8px;

    animation-iteration-count: 3;

    transition: transform 0.15s ease;
}


/* Hovering grows the bubble a little. It only clears once the
   module is opened. */
.milo-action-tile:hover .milo-bubble {
    transform: scale(1.1);
}


/* A tile with news gets a light green edge */
.milo-action-tile.has-updates {
    border-color: var(--milo-sage-200);
}


/* The jump lands it clear of the sticky top bar */
.milo-activity-center {
    scroll-margin-top: 80px;
}


/* =========================================================
   ACTIVITY CENTER JUMP (Cockpit)
   Bottom left, beside the sidebar: an arrow with the count and
   one line of what's overdue, due today and next. Its edge and
   bubble are the traffic light (red overdue, amber due today,
   green all clear). Steps aside while the Activity Center is
   on screen (is-away).
   ========================================================= */

.milo-activity-jump {
    position: fixed;
    left: calc(var(--milo-sidebar-width) + 1rem);
    bottom: 1rem;
    z-index: 90;

    max-width: calc(100vw - var(--milo-sidebar-width) - 2rem);
    padding: 0.4rem 1rem 0.4rem 0.4rem;

    display: flex;
    align-items: center;
    gap: 0.65rem;

    color: var(--milo-ink);
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-left: 4px solid var(--milo-jump-tone);
    border-radius: 999px;
    box-shadow: var(--milo-shadow);

    font-size: 0.85rem;
    text-decoration: none;

    transition: opacity 0.2s ease, transform 0.2s ease;
}

.milo-activity-jump:hover {
    color: var(--milo-ink);
    transform: translateY(-2px);
}

.milo-activity-jump:focus-visible {
    outline: 3px solid var(--milo-sage-200);
    outline-offset: 2px;
}

.milo-activity-jump.is-away {
    opacity: 0;
    transform: translateY(1rem);
    pointer-events: none;
}

.milo-activity-jump-danger {
    --milo-jump-tone: var(--milo-danger);
}

.milo-activity-jump-warning {
    --milo-jump-tone: var(--milo-warning);
}

.milo-activity-jump-success {
    --milo-jump-tone: var(--milo-green-600);
}

/* Ink circle, so it inverts with the theme */
.milo-activity-jump-icon {
    position: relative;
    flex: none;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--milo-surface);
    background: var(--milo-ink);
    border-radius: 50%;

    font-size: 1.1rem;
}

.milo-activity-jump-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {

    .milo-activity-jump {
        transition: none;
    }

}


/* =========================================================
   CANCELLED REMINDER (Schedules & Trips)
   The Activity Center jump's pill, bottom left: what's
   cancelled in the week ahead, so nobody prepares or leaves
   for it. Several open a short list above it; the small x
   ("Got it") hides it until something else is cancelled.
   ========================================================= */

.milo-cancel-reminder {
    position: fixed;
    left: calc(var(--milo-sidebar-width) + 1rem);
    bottom: 1rem;
    z-index: 90;

    max-width: calc(100vw - var(--milo-sidebar-width) - 2rem);
}

.milo-cancel-reminder[hidden] {
    display: none;
}

.milo-cancel-reminder .milo-activity-jump {
    position: static;
    max-width: 100%;

    font-family: inherit;
    text-align: left;
}

.milo-cancel-dismiss {
    position: absolute;
    top: -8px;
    right: -8px;

    width: 24px;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: var(--milo-gray-700);
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 50%;
    box-shadow: var(--milo-shadow);

    font-size: 0.65rem;
}

.milo-cancel-dismiss:hover {
    color: var(--milo-ink);
}

.milo-cancel-dismiss:focus-visible {
    outline: 2px solid var(--milo-ink);
    outline-offset: 1px;
}

/* A full-size tap target around the small x */
.milo-cancel-dismiss::after {
    content: "";
    position: absolute;
    inset: -10px;
}

.milo-cancel-list {
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.5rem);

    width: min(22rem, calc(100vw - var(--milo-sidebar-width) - 2rem));
    max-height: 50vh;
    overflow-y: auto;

    margin: 0;
    padding: 0.35rem;

    list-style: none;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow-lg);
}

.milo-cancel-list a {
    min-height: 44px;

    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;

    padding: 0.45rem 0.6rem;

    color: var(--milo-ink);
    border-radius: 8px;

    font-size: 0.82rem;
    text-decoration: none;
}

.milo-cancel-list a:hover,
.milo-cancel-list a:focus-visible {
    background: var(--milo-surface-soft);
}

.milo-cancel-list span {
    overflow: hidden;

    color: var(--milo-gray-700);

    text-overflow: ellipsis;
    white-space: nowrap;
}

.milo-cancel-list small {
    color: var(--milo-gray-700);
}


/* "56 new since your last visit": quieter than issues */
.milo-action-note {
    overflow: hidden;

    color: var(--milo-green-700);

    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* A tile with issues gets a coloured edge so it stands out */
.milo-action-tile.milo-action-tile-danger {
    border-color: #f2c6c1;
}


.milo-action-tile.milo-action-tile-warning {
    border-color: #f5d9ab;
}


/* Each issue as a small chip: red = critical, amber = warning */
.milo-issue-chips {
    display: flex;
    flex-wrap: wrap;

    gap: 0.25rem;

    margin-top: 0.3rem;
}


/* A long label in a narrow tile ("Delivery Not Confirmed 1") wraps
   to a second line: a pill on one line, a soft rounded box on two */
.milo-issue-chip {
    max-width: 100%;
    padding: 0.05rem 0.45rem;

    border-radius: 0.6rem;

    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}


.milo-issue-chip-danger {
    color: #8b1a12;
    background: #fce1df;
}


.milo-issue-chip-warning {
    color: #9a3412;
    background: #ffedd5;
}


/* A bubble with no number: just "something new" */
.milo-bubble-dot {
    min-width: 12px;
    width: 12px;
    height: 12px;

    padding: 0;
}


/* =========================================================
   TODAY'S MOVEMENT: next step
   What to record next for each trip, coloured by urgency.
   ========================================================= */

.milo-next-step {
    font-size: 0.78rem;
    font-weight: 600;
}


.milo-next-step-danger {
    color: #b42318;
}


.milo-next-step-warning {
    color: #b45309;
}


.milo-next-step-calm {
    color: var(--milo-gray-700);

    font-weight: 500;
}


/* =========================================================
   SCHEDULE PAGE: the trip a link pointed to (#trip-12)
   gets a brief highlight, and isn't hidden under the top bar
   ========================================================= */

.milo-trip-card {
    scroll-margin-top: 90px;
}


.milo-trip-card:target {
    border-color: var(--milo-sage-200);

    animation: milo-trip-highlight 2.4s ease-out;
}


/* A car opened from a Vehicle card's breakdown (#vehicle-3) */
.milo-vehicle-row:target > td {
    /* Bootstrap paints table cells through this variable */
    --bs-table-bg-state: var(--milo-sage-soft);
}


@keyframes milo-trip-highlight {
    0%,
    40% {
        box-shadow: 0 0 0 4px rgba(157, 213, 174, 0.7);
    }

    100% {
        box-shadow: var(--milo-shadow);
    }
}


/* A tile with an open problem (orange warning, red critical):
   tinted icon and a coloured line, but no pulse, so it stays
   calm. The pulsing alert lives on Needs Attention. */
.milo-action-alert {
    font-weight: 600;
}


.milo-action-tile.milo-action-tile-warning .milo-action-icon {
    color: #9a3412;
    background: #ffedd5;
}


.milo-action-tile-warning .milo-action-alert {
    color: #9a3412;
}


.milo-action-tile.milo-action-tile-danger .milo-action-icon {
    color: #8b1a12;
    background: #fce1df;
}


.milo-action-tile-danger .milo-action-alert {
    color: #8b1a12;
}


/* =========================================================
   WATER (the Activity Center's icons)
   How much of a module's work is clear (ModuleClearService) fills
   its icon's chip from the bottom like water, its surface a small
   wave drifting slowly (one wave in 4 s); the icon turns the page's
   colour where it's under. In the tile's colour: red when something
   critical waits, amber when something is behind, green when all
   clear (full and still). The chip is its own size container, so the
   water follows it at any size. A key under the Activity Center's
   best practice names the colours. Still for reduced motion and Calm
   motion.
   ========================================================= */

.milo-water-icon {
    --milo-water-tone: var(--milo-green-600);
    --milo-water-box: 100cqh;
    --milo-water-crest: min(4px, calc(var(--p) * 4px));
    --milo-water-level: calc(var(--p) * var(--milo-water-box) / 100);
    --milo-water-top: calc(var(--milo-water-box) - var(--milo-water-level) - var(--milo-water-crest));
    --milo-water-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 4' preserveAspectRatio='none'%3E%3Cpath d='M0 2C2.67 0 5.33 0 8 2S13.33 4 16 2V4H0Z'/%3E%3C/svg%3E");

    position: relative;
    container-type: size;
}

.milo-water-icon.is-amber {
    --milo-water-tone: var(--milo-warning);
}

.milo-water-icon.is-red {
    --milo-water-tone: var(--milo-danger);
}

/* The icon, twice in one place: as it is, and under water */
.milo-water-icon > i {
    position: absolute;
    inset: 0;
    z-index: 1;

    display: grid;
    place-items: center;

    line-height: 1;
}

.milo-water-icon > i::before {
    display: block;
    vertical-align: 0;
}

/* The water and the icon under it share one surface. The body reaches
   1 px up under the wave, so no seam shows between them (a tile lifting
   on hover put a dark line there) */
.milo-water-icon > :is(.milo-water, .milo-water-wet) {
    -webkit-mask-image: var(--milo-water-wave), linear-gradient(#000 0 0);
    mask-image: var(--milo-water-wave), linear-gradient(#000 0 0);
    -webkit-mask-repeat: repeat-x, no-repeat;
    mask-repeat: repeat-x, no-repeat;
    -webkit-mask-size: 16px var(--milo-water-crest), 100% calc(var(--milo-water-level) + min(1px, var(--p) * 1px));
    mask-size: 16px var(--milo-water-crest), 100% calc(var(--milo-water-level) + min(1px, var(--p) * 1px));
    -webkit-mask-position: 0 var(--milo-water-top), 0 100%;
    mask-position: 0 var(--milo-water-top), 0 100%;

    animation: milo-water-drift 4s linear infinite;
}

.milo-water-icon > .milo-water {
    position: absolute;
    inset: 0;

    background: var(--milo-water-tone);
    border-radius: inherit;
    opacity: 0.9;
}

.milo-water-icon > .milo-water-wet {
    z-index: 2;

    color: var(--milo-surface);
}

@keyframes milo-water-drift {
    from {
        -webkit-mask-position: 0 var(--milo-water-top), 0 100%;
        mask-position: 0 var(--milo-water-top), 0 100%;
    }

    to {
        -webkit-mask-position: 16px var(--milo-water-top), 0 100%;
        mask-position: 16px var(--milo-water-top), 0 100%;
    }
}

/* Full: still */
.milo-water-icon.is-done > :is(.milo-water, .milo-water-wet) {
    animation: none;
}

/* The key under the Activity Center's best practice: an icon of still
   water in each colour, named under it (Critical, Behind, All Clear);
   its hover note says what the water means */
.milo-water-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;

    width: fit-content;
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;

    border: 1px dashed var(--milo-border);
    border-radius: 10px;
}

.milo-water-legend figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;

    margin: 0;

    color: var(--milo-gray-700);
    font-size: 0.72rem;
}

.milo-water-legend .milo-action-icon {
    border: 1px solid var(--milo-border);
}

.milo-water-legend .milo-water-icon.is-red > i:not(.milo-water-wet) {
    color: var(--milo-danger);
}

.milo-water-legend .milo-water-icon.is-amber > i:not(.milo-water-wet) {
    color: var(--milo-warning);
}

.milo-water-legend .milo-water-icon > :is(.milo-water, .milo-water-wet) {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .milo-water-icon > :is(.milo-water, .milo-water-wet) {
        animation: none;
    }
}


.milo-trip-number {
    color:
        var(--milo-ink);

    font-weight:
        700;

    text-decoration:
        none;
}

.milo-trip-number:hover {
    color:
        var(--milo-ink);
}

.milo-trip-secondary {
    color:
        var(--milo-muted);

    font-size:
        0.68rem;
}

.milo-route {
    font-size:
        0.82rem;

    font-weight:
        500;
}

.milo-route-arrow {
    margin:
        0
        0.35rem;

    color:
        var(--milo-sage-500);
}


/* =========================================================
   SCHEDULES: LIFECYCLE STRIP
   One small card per state, with a traffic-light dot:
   white upcoming, green ongoing, red needs action, grey done.
   ========================================================= */

.milo-lifecycle-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));

    gap: 0.75rem;

    margin-bottom: 1rem;
}


.milo-lifecycle {
    display: flex;
    align-items: center;

    gap: 0.6rem;

    padding: 0.75rem 0.9rem;

    color: var(--milo-ink);
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);

    text-decoration: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


.milo-lifecycle:hover {
    border-color: #c9cec9;
    box-shadow: var(--milo-shadow-sm);
}


/* The state being listed */
.milo-lifecycle.is-active {
    background: var(--milo-sage-soft);
    border-color: var(--milo-sage-200);
}


.milo-lifecycle-dot {
    width: 10px;
    height: 10px;

    flex-shrink: 0;

    border-radius: 50%;
}


.milo-lifecycle-upcoming .milo-lifecycle-dot {
    background: #ffffff;
    box-shadow: inset 0 0 0 1.5px #9aa09a;
}


.milo-lifecycle-ongoing .milo-lifecycle-dot {
    background: #d97706;
}


.milo-lifecycle-needs_action .milo-lifecycle-dot {
    background: #c0392b;
}


.milo-lifecycle-completed .milo-lifecycle-dot {
    background: #1f9d55;
}


.milo-lifecycle-cancelled .milo-lifecycle-dot {
    background: #c4c9c4;
}


.milo-lifecycle-label {
    color: var(--milo-gray-700);

    font-size: 0.82rem;
    font-weight: 600;
}


.milo-lifecycle-count {
    margin-left: auto;

    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}


/* Needs Action with something in it: the count turns red */
.milo-lifecycle-count.is-alert {
    color: #c0392b;
}


/* =========================================================
   SCHEDULES: TOOLBAR
   Filters on the left, the Calendar | List switch on the right.
   ========================================================= */

.milo-schedule-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;

    gap: 0.75rem;
}


.milo-schedule-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 0.5rem;
}


.milo-schedule-filters .form-select {
    width: auto;
    min-width: 150px;
}


/* Search box with a magnifier inside */
.milo-schedule-search {
    position: relative;
}


.milo-schedule-search i {
    position: absolute;
    top: 50%;
    left: 0.75rem;

    color: var(--milo-gray);

    transform: translateY(-50%);
    pointer-events: none;
}


.milo-schedule-search .form-control {
    width: 240px;

    padding-left: 2.2rem;
}


/* Two-option switch: the active option is a white "pill" */
.milo-segmented {
    display: inline-flex;

    padding: 3px;

    background: var(--milo-surface-soft);
    border: 1px solid var(--milo-border);
    border-radius: 10px;
}


/* Links switch pages; buttons switch something on the page (the
   Fuel trend's grouping and measure) */
.milo-segmented a,
.milo-segmented button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    padding: 0.35rem 0.85rem;

    color: var(--milo-gray-700);
    background: none;
    border: 0;
    border-radius: 7px;

    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}


.milo-segmented a:hover,
.milo-segmented button:hover {
    color: var(--milo-ink);
}


.milo-segmented a.active,
.milo-segmented button.active {
    color: var(--milo-ink);
    background: var(--milo-surface);
    box-shadow: 0 1px 3px rgba(19, 52, 38, 0.12);
}

/* One choice of a few, each its own MILO button (the Request Form's
   Request Type): white and raised like the other buttons, pale green on
   hover; the picked one is the main button's light green, pressed in,
   with a check */
.milo-choice-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.milo-choice-buttons > .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;

    font-weight: 500;
}

.milo-choice-buttons > .btn-check:checked + .btn,
.milo-choice-buttons > .btn-check:checked + .btn:hover {
    color: var(--milo-ink) !important;
    background: var(--milo-sage-200) !important;
    border-color: var(--milo-sage-200) !important;
    box-shadow: var(--milo-btn-pressed);

    font-weight: 600;
}

.milo-choice-buttons > .btn-check:checked + .btn:hover {
    background: #86c99a !important;
    border-color: #86c99a !important;
}

.milo-choice-buttons > .btn-check:focus-visible + .btn {
    box-shadow: var(--milo-btn-raised-light), 0 0 0 3px rgba(23, 133, 74, 0.35);
}

.milo-choice-check {
    display: none;
}

.milo-choice-buttons > .btn-check:checked + .btn .milo-choice-check {
    display: inline-block;
}

/* Phones: thumb-sized */
@media (max-width: 575.98px) {
    .milo-choice-buttons > .btn {
        min-height: 44px;
    }
}

/* Nothing to filter (a count of 0) */
.milo-segmented button:disabled,
.milo-segmented a[aria-disabled="true"] {
    cursor: default;
    opacity: 0.6;
}

/* Phones: never wider than the screen, and thumb-sized */
@media (max-width: 575.98px) {
    .milo-segmented {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .milo-segmented a,
    .milo-segmented button {
        min-height: 44px;
    }
}


/* =========================================================
   FUEL TREND
   The latest period in ink, the ones before in light green;
   the change chip is amber when spending went up, green
   when it went down.
   ========================================================= */

.milo-trend-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.85rem;

    margin-bottom: 1rem;
}


.milo-trend-value {
    color: var(--milo-ink);

    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}


.milo-trend-compare {
    color: var(--milo-gray-700);

    font-size: 0.85rem;
}


.milo-trend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;

    padding: 0.15rem 0.55rem;

    border-radius: 999px;

    font-size: 0.8rem;
    font-weight: 700;
}


.milo-trend-chip.is-up {
    color: #92400e;
    background: #fef3c7;
}


.milo-trend-chip.is-down {
    color: #166534;
    background: #dcfce7;
}


.milo-trend-chip.is-flat {
    color: var(--milo-gray-700);
    background: var(--milo-surface-soft);
}


.milo-trend-chart {
    position: relative;

    height: 260px;
}


/* Page links ("‹ 1 2 3 ›", Audit Trail and Schedules list) in black
   and white instead of Bootstrap blue */
.pagination {
    --bs-pagination-color: var(--milo-ink);
    --bs-pagination-hover-color: var(--milo-ink);
    --bs-pagination-hover-bg: var(--milo-sage-soft);
    --bs-pagination-hover-border-color: var(--milo-border);
    --bs-pagination-focus-color: var(--milo-ink);
    --bs-pagination-focus-bg: var(--milo-sage-soft);
    --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(157, 213, 174, 0.5);
    --bs-pagination-active-color: #ffffff;
    --bs-pagination-active-bg: var(--milo-ink);
    --bs-pagination-active-border-color: var(--milo-ink);
    --bs-pagination-border-color: var(--milo-border);
    --bs-pagination-disabled-color: var(--milo-gray);
    --bs-pagination-disabled-bg: var(--milo-surface-soft);
    --bs-pagination-disabled-border-color: var(--milo-border);

    margin-bottom: 0;
}


/* The page control (vendor/pagination/bootstrap-5): on phones Previous
   and Next with the position between them, each 44px tall to tap */
.milo-pager-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 0.5rem;
}


.milo-pager-compact .page-link {
    display: inline-flex;
    align-items: center;

    min-height: 44px;

    border-radius: var(--bs-pagination-border-radius);
}


.milo-pager-position {
    color: var(--milo-gray-700);

    font-size: 0.85rem;
    white-space: nowrap;
}


/* Operational Cost totals: the change against the period before */
.milo-cost-change {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;

    margin-top: 0.5rem;

    color: var(--milo-gray-700);

    font-size: 0.78rem;
}


/* =========================================================
   SCHEDULES: CALENDAR
   FullCalendar in black and white. Colour only means
   something, like traffic lights:
     green  = on track (ongoing, no problems)
     amber  = needs a look (warnings)
     red    = critical, or past its plan and unfinished
     white  = upcoming, nothing wrong yet
     grey   = completed / cancelled
   ========================================================= */

.milo-calendar {
    --fc-border-color: var(--milo-border);
    --fc-page-bg-color: var(--milo-surface);
    --fc-neutral-bg-color: var(--milo-surface-soft);
    --fc-today-bg-color: rgba(237, 244, 236, 0.7);
    --fc-now-indicator-color: var(--milo-danger);
    --fc-list-event-hover-bg-color: var(--milo-surface-soft);

    --fc-button-text-color: var(--milo-ink);
    --fc-button-bg-color: var(--milo-surface);
    --fc-button-border-color: var(--milo-border);
    --fc-button-hover-bg-color: var(--milo-sage-soft);
    --fc-button-hover-border-color: var(--milo-sage-200);
    --fc-button-active-bg-color: var(--milo-sage-200);
    --fc-button-active-border-color: var(--milo-sage-200);

    --fc-event-bg-color: var(--milo-surface);
    --fc-event-border-color: var(--milo-border);
    --fc-event-text-color: var(--milo-ink);

    font-size: 0.85rem;
}


/* The calendar's own toolbar wraps on narrow screens */
.milo-calendar .fc-header-toolbar {
    flex-wrap: wrap;

    gap: 0.5rem;
}


/* Month name in the calendar's own toolbar */
.milo-calendar .fc-toolbar-title {
    color: var(--milo-ink);

    font-size: 1.15rem;
    font-weight: 700;
}


.milo-calendar .fc-button {
    padding: 0.35rem 0.75rem;

    border-radius: 8px;

    font-size: 0.82rem;
    font-weight: 600;
    text-transform: none;
}


.milo-calendar .fc-button:focus,
.milo-calendar .fc-button-primary:not(:disabled):active:focus {
    box-shadow: 0 0 0 2px rgba(22, 22, 22, 0.15);
}


/* The selected view (Month / Week / Agenda): light green, black text */
.milo-calendar .fc-button-primary:not(:disabled).fc-button-active {
    color: var(--milo-ink);
}


/* Weekday headings: small grey capitals */
.milo-calendar .fc-col-header-cell-cushion {
    padding: 0.5rem 0;

    color: var(--milo-gray-700);

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-transform: uppercase;
}


.milo-calendar .fc-daygrid-day-number {
    padding: 0.35rem 0.5rem;

    color: var(--milo-charcoal);

    font-size: 0.8rem;
    text-decoration: none;
}


/* Today's date in a light green circle */
.milo-calendar .fc-day-today .fc-daygrid-day-number {
    margin: 0.25rem;
    padding: 0.1rem 0.45rem;

    color: var(--milo-ink);
    background: var(--milo-sage-200);
    border-radius: 999px;

    font-weight: 700;
}


/* Empty days can be clicked to plan a schedule */
.milo-calendar-can-create .fc-daygrid-day,
.milo-calendar-can-create .fc-timegrid-slot {
    cursor: pointer;
}


.milo-calendar-can-create .fc-daygrid-day:hover {
    background: rgba(237, 244, 236, 0.6);
}


/* --- Schedules (events): a soft tint plus a coloured stripe on the left --- */

.milo-calendar .milo-event {
    --milo-tone: #9aa09a;

    padding: 0.2rem 0.35rem 0.2rem 0.5rem;

    color: var(--milo-ink);
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 6px;
    box-shadow: inset 3px 0 0 var(--milo-tone);

    cursor: pointer;

    transition:
        filter 0.15s ease,
        box-shadow 0.15s ease;
}


.milo-calendar .milo-event:hover {
    filter: brightness(0.97);
    box-shadow:
        inset 3px 0 0 var(--milo-tone),
        0 2px 6px rgba(19, 52, 38, 0.1);
}


.milo-calendar .milo-event .fc-event-main {
    color: var(--milo-ink);
}


/* Green: completed */
.milo-calendar .milo-tone-green {
    --milo-tone: #1f9d55;

    background: #eaf6ef;
    border-color: #c4e5d0;
}


/* Amber: ongoing, or needs a look */
.milo-calendar .milo-tone-amber {
    --milo-tone: #d97706;

    background: #fff5e6;
    border-color: #f5d9ab;
}


/* Red: critical, or past its plan and unfinished */
.milo-calendar .milo-tone-red {
    --milo-tone: #c0392b;

    background: #fdeeec;
    border-color: #f2c6c1;
}


/* Grey: cancelled */
.milo-calendar .milo-tone-cancelled {
    --milo-tone: #c4c9c4;

    background: #f4f5f3;
    border-color: var(--milo-border);
}


.milo-calendar .milo-tone-cancelled .fc-event-main {
    color: var(--milo-gray-700);
}


.milo-calendar .milo-tone-cancelled .milo-event-title {
    text-decoration: line-through;
}


.milo-event-body {
    overflow: hidden;

    line-height: 1.3;
}


.milo-event-top {
    display: flex;
    gap: 0.35rem;

    overflow: hidden;

    white-space: nowrap;
}


.milo-event-time {
    flex-shrink: 0;

    opacity: 0.8;
}


.milo-event-title {
    overflow: hidden;

    font-weight: 600;
    text-overflow: ellipsis;
}


.milo-event-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 0.35rem;

    font-size: 0.72rem;
}


.milo-event-detail {
    overflow: hidden;

    opacity: 0.85;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* The small ⚠ count: orange = needs attention, red = critical */
.milo-event-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;

    flex-shrink: 0;

    padding: 0.05rem 0.4rem;

    border-radius: 999px;

    font-size: 0.68rem;
    font-weight: 700;
}


.milo-event-flag-warning {
    color: #9a3412;
    background: #ffedd5;
}


.milo-event-flag-danger {
    color: #8b1a12;
    background: #fce1df;
}


/* Agenda view: event rows use dark text on white */
.milo-calendar .fc-list-event {
    color: var(--milo-charcoal);
}


.milo-calendar .fc-list-event-dot {
    border-color: var(--milo-ink);
}


/* Agenda: the title is the row's link; the row's hover already shows it,
   so no underline (a cancelled one keeps its strike-through) */
.milo-calendar .fc-list-event.fc-event-forced-url:hover .milo-event-title {
    text-decoration: none;
}

.milo-calendar .fc-list-event.milo-tone-cancelled.fc-event-forced-url:hover .milo-event-title {
    text-decoration: line-through;
}


.milo-calendar .fc-list-day-cushion {
    background: var(--milo-surface-soft);
}


/* Day headings in Agenda ("Thursday · October 15, 2026") */
.milo-calendar .fc-list-day-cushion a {
    color: var(--milo-ink);

    font-weight: 700;
    text-decoration: none;
}


/* --- Legend under the calendar --- */

.milo-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 0.5rem 1.25rem;

    margin-top: 1rem;
    padding-top: 0.85rem;

    color: var(--milo-gray-700);
    border-top: 1px solid var(--milo-border);

    font-size: 0.78rem;
}


.milo-calendar-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}


/* Small sample of each event colour, matching .milo-tone-* */
.milo-legend-swatch {
    width: 14px;
    height: 12px;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 3px;
    box-shadow: inset 3px 0 0 #9aa09a;
}


.milo-legend-swatch-green {
    background: #eaf6ef;
    border-color: #c4e5d0;
    box-shadow: inset 3px 0 0 #1f9d55;
}


.milo-legend-swatch-amber {
    background: #fff5e6;
    border-color: #f5d9ab;
    box-shadow: inset 3px 0 0 #d97706;
}


.milo-legend-swatch-red {
    background: #fdeeec;
    border-color: #f2c6c1;
    box-shadow: inset 3px 0 0 #c0392b;
}


.milo-legend-swatch-done {
    background: #f4f5f3;
    box-shadow: inset 3px 0 0 #c4c9c4;
}


.milo-calendar-hint {
    margin-left: auto;

    color: var(--milo-gray);
}


/* =========================================================
   SCHEDULES: TODAY'S SCHEDULES WINDOW
   A small window in the schedule page header: title bar with
   minimize / restore, a search box and a scrolling list.
   ========================================================= */

.milo-today-panel {
    width: 340px;

    display: grid;
    grid-template-rows: auto 1fr;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow);

    /* Minimize/restore slides the body closed/open */
    transition: grid-template-rows 0.2s ease;
}


.milo-today-panel.is-minimized {
    grid-template-rows: auto 0fr;
}


/* Title bar */
.milo-today-bar {
    display: flex;
    align-items: center;

    gap: 0.5rem;

    padding: 0.55rem 0.55rem 0.55rem 0.85rem;

    color: var(--milo-ink);

    font-size: 0.82rem;
    font-weight: 700;
}


.milo-today-panel:not(.is-minimized) .milo-today-bar {
    border-bottom: 1px solid var(--milo-border);
}


.milo-today-title {
    white-space: nowrap;
}


.milo-today-count {
    min-width: 20px;

    padding: 0.05rem 0.4rem;

    color: var(--milo-ink);
    background: var(--milo-sage-soft);
    border-radius: 999px;

    font-size: 0.7rem;
    text-align: center;
}


/* Status icons beside the title: trips anywhere that need help, by
   where the trip is (Not left yet / On the road / Arrived). An ink
   circle with a bubble when some need help, quiet when none; picked =
   ringed. They filter the list. */
.milo-today-alerts {
    display: flex;
    align-items: center;
    gap: 0.7rem;

    margin-left: auto;
    padding-right: 0.15rem;
}

.milo-today-alert {
    position: relative;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: var(--milo-gray);
    background: var(--milo-surface-soft);
    border: 0;
    border-radius: 50%;

    font-size: 0.85rem;

    transition: transform 0.15s ease;
}

.milo-today-alert.has-help {
    color: var(--milo-surface);
    background: var(--milo-ink);
}

.milo-today-alert:hover {
    transform: translateY(-1px);
}

.milo-today-alert[aria-pressed="true"],
.milo-today-alert:focus-visible {
    outline: 2px solid var(--milo-ink);
    outline-offset: 2px;
}

.milo-today-alert .milo-bubble {
    top: -6px;
    right: -8px;

    min-width: 17px;
    height: 17px;
    padding: 0 4px;

    font-size: 0.6rem;

    animation-iteration-count: 3;
}

.milo-today-alerts + .milo-today-toggle {
    margin-left: 0.15rem;
}

.milo-today-caption {
    padding: 0 0.35rem 0.4rem;

    color: var(--milo-gray-700);

    font-size: 0.72rem;
    font-weight: 600;
}

/* Phones: a full-size tap target */
@media (max-width: 575.98px) {

    .milo-today-alert {
        width: 36px;
        height: 36px;
    }

    .milo-today-alert::after {
        content: "";
        position: absolute;
        inset: -4px;
    }

}

@media (prefers-reduced-motion: reduce) {

    .milo-today-alert {
        transition: none;
    }

}


.milo-today-toggle {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-left: auto;

    color: var(--milo-gray-700);
    background: transparent;
    border: 0;
    border-radius: 7px;

    transition: background-color 0.15s ease;
}


.milo-today-toggle:hover {
    color: var(--milo-ink);
    background: var(--milo-surface-soft);
}


.milo-today-toggle:focus-visible {
    outline: 2px solid var(--milo-ink);
    outline-offset: 1px;
}


/* Body: hidden overflow lets it slide closed */
.milo-today-body {
    min-height: 0;

    overflow: hidden;
}


.milo-today-inner {
    padding: 0.6rem;
}


/* The same small search on the Latest trips window and on any list
   that grows (data-milo-findable) */
.milo-today-search,
.milo-findable-search {
    position: relative;

    margin-bottom: 0.5rem;
}


.milo-today-search i,
.milo-findable-search i {
    position: absolute;
    top: 50%;
    left: 0.65rem;

    color: var(--milo-gray);

    font-size: 0.8rem;

    transform: translateY(-50%);
    pointer-events: none;
}


.milo-today-search input,
.milo-findable-search input {
    width: 100%;

    padding: 0.4rem 0.6rem 0.4rem 1.9rem;

    background: var(--milo-surface-soft);
    border: 1px solid transparent;
    border-radius: 8px;

    font-size: 0.8rem;
}


.milo-today-search input:focus,
.milo-findable-search input:focus {
    background: var(--milo-surface);
    border-color: var(--milo-sage-200);
    outline: none;
}

/* A list that grows scrolls inside its card (a list's own height wins) */
:where([data-milo-findable]) {
    max-height: 22rem;
    overflow-y: auto;
}

/* A page's main table (users, Master Data, jobs, transactions): full
   height, its search inside the card's edges */
[data-milo-findable-full] {
    max-height: none;
}

.card > .milo-findable-search,
.card > .milo-findable-empty {
    margin: 0.75rem 1rem;
}

.milo-findable-empty {
    margin: 0.5rem 0 0;
    color: var(--milo-gray-700);
    font-size: 0.85rem;
}

/* Directly in a card (a table under its header): inside the padding */
.card > .milo-findable-search,
.card > .milo-findable-empty {
    margin: 0.75rem 1rem;
}

/* Cockpit's Operational Cost: the day in short, under the costs */
.milo-cost-plan {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--milo-border);
}

.milo-cost-plan-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.86rem;
}

.milo-cost-plan-list li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.milo-cost-plan-list i {
    color: var(--milo-gray);
}

.milo-cost-plan-list li.is-follow-up i {
    color: #c2410c;
}

/* Cockpit's Vehicle Utilization: the fleet's insights under the bar */
.milo-utilization-insights {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--milo-border);
}

.milo-utilization-insights-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    color: var(--milo-gray-700);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* The magnifier is the search button: Enter or a click searches */
.milo-today-search-button {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;

    width: 1.9rem;
    padding: 0;

    color: var(--milo-gray);
    background: transparent;
    border: 0;
    border-radius: 8px 0 0 8px;
}

.milo-today-search-button:hover,
.milo-today-search-button:focus-visible {
    color: var(--milo-cocoa-green);
}


/* The scrolling list: about five rows, then it scrolls */
.milo-today-list {
    max-height: 232px;

    margin: 0;
    padding: 0;

    overflow-y: auto;
    /* A pressed row slides (PRESS NUDGE) without scrolling the list sideways */
    overflow-x: clip;

    list-style: none;
}


.milo-today-item {
    position: relative;

    display: flex;
    align-items: center;

    gap: 0.6rem;

    padding: 0.45rem 0.5rem;

    color: var(--milo-charcoal);
    border-radius: 8px;

    text-decoration: none;

    transition: background-color 0.15s ease;
}


.milo-today-item:hover {
    color: var(--milo-ink);
    background: var(--milo-surface-soft);
}


/* The schedule you're looking at: green bar on the left */
.milo-today-item.is-current {
    background: var(--milo-sage-soft);
}


.milo-today-item.is-current::before {
    content: "";

    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;

    width: 3px;

    background: var(--milo-ink);
    border-radius: 999px;
}


.milo-today-time {
    flex-shrink: 0;

    width: 2.6rem;

    color: var(--milo-gray-700);

    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}


.milo-today-main {
    display: flex;
    flex-direction: column;

    min-width: 0;
}


.milo-today-number {
    color: var(--milo-ink);

    font-size: 0.78rem;
    font-weight: 700;
}


.milo-today-name {
    overflow: hidden;

    color: var(--milo-gray-700);

    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.milo-today-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 0.15rem;

    flex-shrink: 0;

    margin-left: auto;
}


.milo-today-trips {
    color: var(--milo-gray);

    font-size: 0.7rem;
}


.milo-today-empty {
    padding: 0.75rem 0.5rem;

    color: var(--milo-gray-700);

    font-size: 0.8rem;
    text-align: center;
}


/* Phones: the window takes the full width under the title */
@media (max-width: 767.98px) {

    .milo-today-panel {
        width: 100%;
    }

}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 991.98px) {

    /* Keep the rail on small screens, just a little narrower */
    :root {
        --milo-sidebar-width: 72px;
    }

    .milo-content {
        padding:
            1rem;
    }

    .milo-topbar {
        padding:
            0.5rem
            1rem;
    }

    .milo-user-meta {
        display:
            none;
    }

    /* Only the avatar is left, so make the chip a circle */
    .milo-user {
        padding: 0.3rem;
    }

}


/* Phones: show just "MILO", not its meaning */
@media (max-width: 767.98px) {

    .milo-app-divider,
    .milo-app-meaning {
        display: none;
    }

}


/* =========================================================
   CHIPS (x-milo.chip)
   Small rounded labels in the MILO colours: white available or
   planned, light-green outline scheduled, green moving, grey
   done, amber needs a look, red late or unavailable.
   ========================================================= */

.milo-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    padding: 0.18rem 0.6rem;

    border: 1px solid transparent;
    border-radius: 999px;

    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.milo-chip-available,
.milo-chip-neutral {
    color: var(--milo-ink);
    background: var(--milo-surface);
    border-color: #c9cfc9;
}

.milo-chip-scheduled {
    color: var(--milo-ink);
    background: var(--milo-surface);
    border: 2px solid var(--milo-sage-200);
}

.milo-chip-transit {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.milo-chip-completed {
    color: var(--milo-gray-700);
    background: var(--milo-surface-soft);
    border-color: var(--milo-border);
}

.milo-chip-amber {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;
}

.milo-chip-red,
.milo-chip-unavailable {
    color: #8b1a12;
    background: #fce1df;
    border-color: #f6c4bf;
}

/* Attention's resolution level beside a title (L2 · Assisted): inline,
   even inside lists that set their spans to blocks or grey */
.milo-chip.milo-level-chip {
    display: inline-flex;
    margin: 0 0 0 0.4rem;
    color: #92400e;
    padding: 0.05rem 0.45rem;
    font-size: 0.7rem;
    vertical-align: 0.1em;
}


/* =========================================================
   INFO TIP (x-milo.info-tip)
   A small ⓘ that explains a term on hover or keyboard focus.
   ========================================================= */

.milo-info-tip {
    display: inline-flex;
    align-items: center;

    margin-left: 0.25rem;

    color: var(--milo-gray);

    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: middle;

    cursor: help;
}

.milo-info-tip:hover,
.milo-info-tip:focus-visible {
    color: var(--milo-ink);
    outline: none;
}

/* Definitions are sentences: let them wrap */
.milo-info-tip[data-milo-tooltip]::after {
    width: 260px;
    white-space: normal;
    line-height: 1.35;
}

/* An empty table's message: hover (or focus) tells what the data is
   for and what fills it; the dotted line says there's more to read */
.milo-empty-note {
    width: fit-content;

    text-decoration: underline dotted;
    text-underline-offset: 3px;

    cursor: help;
}

/* Any other tooltip that holds a sentence or two */
.milo-tooltip-wrap[data-milo-tooltip]::after {
    width: 260px;
    white-space: normal;
    line-height: 1.35;
}


/* ---------- Table rows' hover notes, over the page ---------- */

/* The layout's script shows a row's note on one fixed holder laid over the
   row, so a table that scrolls can't cut it off; the row's own note
   then stays hidden. Reports' tables, and any marked data-milo-row-notes */
.milo-row-notes :is(.milo-report-table, [data-milo-row-notes]) .milo-tooltip-wrap[data-milo-tooltip]::after {
    display: none;
}

.milo-row-note.milo-tooltip-wrap {
    position: fixed;
    z-index: 1080;

    pointer-events: none;
}

.milo-row-note.is-on::after {
    display: block;

    opacity: 1;
    transform: none;

    @starting-style {
        opacity: 0;
        transform: translateY(-3px);
    }
}

/* Near the foot of the window: above the row */
.milo-row-note.is-up::after {
    top: auto;
    bottom: calc(100% + 8px);
}

/* Next to a page title: a little bigger, and room for "how to use"
   instructions */
.milo-info-tip-lg {
    font-size: 1rem;
}

.milo-info-tip-lg[data-milo-tooltip]::after {
    width: 320px;

    font-size: 0.78rem;
    font-weight: 500;
}

/* An icon that says what a card or tile leads to, on hover (the
   card itself is the link) */
.milo-next-icon {
    width: 28px;
    height: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    color: var(--milo-ink);
    background: var(--milo-surface-soft);
    border: 1px solid var(--milo-border);
    border-radius: 8px;

    font-size: 0.85rem;
}

a:hover .milo-next-icon {
    background: var(--milo-sage-soft);
    border-color: var(--milo-sage-200);
}

/* On a trip's or job's card (Classis, Third-Party) the corner icon fills
   like a glass while it's pointed at (or its card has keyboard focus):
   water (WATER) rises from the bottom to the brim, its surface a small
   still wave, and the icon turns light only where the water has reached
   it; it drains as the pointer leaves. At once for reduced motion and
   Calm motion. (Its level has a name of its own: --milo-glass is the
   hover panels' frosted colour, and registering it as a number voided
   that colour.) */
@property --milo-next-fill {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

.milo-classis-trip .milo-next-icon.milo-water-icon {
    --p: var(--milo-next-fill);

    transition: --milo-next-fill 0.6s ease, border-color 0.35s ease;
}

.milo-classis-trip .milo-next-icon.milo-water-icon > :is(.milo-water, .milo-water-wet) {
    animation: none;
}

.milo-classis-trip .milo-next-icon.milo-water-icon:hover,
.milo-classis-trip:focus-visible .milo-next-icon.milo-water-icon {
    --milo-next-fill: 100;

    border-color: var(--milo-green-600);
}

@media (prefers-reduced-motion: reduce) {
    .milo-classis-trip .milo-next-icon.milo-water-icon {
        transition: none;
    }
}


/* =========================================================
   SIDEBAR: PAGES UNDER A PAGE
   Classis Monitoring → L300, Truck, Vios: shown underneath on
   hover or keyboard focus, and kept open while one is open.
   ========================================================= */

/* Pointing at the page lifts it a little (white card, soft shadow),
   and its pages slide down underneath, one after another */
.milo-flyout-group > .milo-flyout-link {
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.milo-flyout-group:hover > .milo-flyout-link,
.milo-flyout-group:focus-within > .milo-flyout-link {
    background: var(--milo-surface);
    box-shadow: 0 6px 16px rgba(19, 52, 38, 0.1);
    transform: translateY(-2px);
}

/* The page you're on keeps its light green */
.milo-flyout-group:hover > .milo-flyout-link.active,
.milo-flyout-group:focus-within > .milo-flyout-link.active {
    background: var(--milo-sage-soft);
}

/* Up to three rows; a fourth type (and on) starts a new column
   beside them, so the list never runs far down the panel */
.milo-flyout-sub {
    display: grid;
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    column-gap: 0.25rem;

    max-height: 0;
    margin: 0 0 0 1.6rem;
    padding-left: 0.5rem;
    overflow: hidden;

    border-left: 2px solid var(--milo-sage-200);

    opacity: 0;

    transition:
        max-height 0.25s ease,
        margin 0.2s ease,
        opacity 0.2s ease;
}

.milo-flyout-group:hover .milo-flyout-sub,
.milo-flyout-group:focus-within .milo-flyout-sub,
.milo-flyout-group.is-open .milo-flyout-sub {
    max-height: 10rem;
    margin: 0.35rem 0 0.3rem 1.6rem;

    opacity: 1;
}

.milo-flyout-sub .milo-flyout-link {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;

    font-size: 0.9rem;

    opacity: 0;
    transform: translateY(-4px);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        background-color 0.15s ease;
}

.milo-flyout-group:hover .milo-flyout-sub .milo-flyout-link,
.milo-flyout-group:focus-within .milo-flyout-sub .milo-flyout-link,
.milo-flyout-group.is-open .milo-flyout-sub .milo-flyout-link {
    opacity: 1;
    transform: none;
}

/* One after another */
.milo-flyout-sub .milo-flyout-link:nth-child(2) {
    transition-delay: 0.05s, 0.05s, 0s;
}

.milo-flyout-sub .milo-flyout-link:nth-child(3) {
    transition-delay: 0.1s, 0.1s, 0s;
}

.milo-flyout-sub .milo-flyout-link:nth-child(n + 4) {
    transition-delay: 0.15s, 0.15s, 0s;
}

/* "3 ⌄": how many pages are underneath */
/* A menu link's signs (x-milo.menu-signs): one cluster at the right, in
   fixed columns (what needs a look · what's moving · pages under it) so
   they line up row under row; an empty column keeps its room */
.milo-menu-signs {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;

    margin-left: auto;
}

.milo-menu-sign {
    display: inline-flex;
    justify-content: center;
}

.milo-menu-sign.is-bubble {
    min-width: 1.6rem;
}

.milo-menu-sign.is-live {
    min-width: 2.75rem;
}

.milo-menu-sign.is-pages {
    min-width: 2.6rem;
}

/* A panel with a sign after the running light (Operations: Schedules &
   Trips' cancelled) is a little wider, so its names stay on one line */
.milo-flyout:has(.milo-menu-sign.is-after) {
    width: 344px;
}

.milo-menu-sign > * {
    margin-left: 0;
}

.milo-flyout-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;

    margin-left: auto;
    padding: 0.1rem 0.45rem;

    color: var(--milo-gray-700);
    background: var(--milo-surface-soft);
    border: 1px solid var(--milo-border);
    border-radius: 999px;

    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;

    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease;
}

.milo-flyout-link .milo-flyout-count i {
    width: auto;

    color: inherit;

    font-size: 0.62rem;

    transition: transform 0.2s ease;
}

.milo-flyout-group:hover .milo-flyout-count,
.milo-flyout-group:focus-within .milo-flyout-count,
.milo-flyout-group.is-open .milo-flyout-count {
    color: var(--milo-ink);
    background: var(--milo-sage-soft);
    border-color: var(--milo-sage-200);
}

.milo-flyout-group:hover .milo-flyout-count i,
.milo-flyout-group:focus-within .milo-flyout-count i,
.milo-flyout-group.is-open .milo-flyout-count i {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {

    .milo-flyout-group > .milo-flyout-link,
    .milo-flyout-sub,
    .milo-flyout-sub .milo-flyout-link,
    .milo-flyout-count,
    .milo-flyout-count i {
        transition: none;
    }

}


/* =========================================================
   WEATHER CARD (Cockpit and Classis headers: x-milo.day-card)
   Where the user is, the time and day, the weather now and
   what the next hours mean for loading and trips. Deep MILO
   green in both themes, like the sidebar (milo-day-* stays
   out of the dark-theme generator).
   ========================================================= */

.milo-day-card {
    position: relative;

    display: flex;
    flex-direction: column;

    width: 28.5rem;
    max-width: 100%;
    min-height: 10.75rem;

    padding: 0.85rem 1.1rem 0.85rem;

    color: #ffffff;
    background:
        /* sage light from the top right, faint clouds below */
        radial-gradient(120% 95% at 100% 0%, rgba(200, 216, 197, 0.3) 0%, rgba(200, 216, 197, 0) 55%),
        radial-gradient(55% 40% at 15% 105%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%),
        radial-gradient(35% 28% at 72% 92%, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 70%),
        linear-gradient(135deg, var(--milo-green-950) 0%, var(--milo-green-800) 55%, var(--milo-green-600) 100%);
    border-radius: 26px;
    box-shadow: 0 8px 22px rgba(5, 45, 33, 0.22);

    /* Loaded from Google Fonts in the layout; the usual font if offline */
    font-family: Poppins, Inter, "Segoe UI", system-ui, sans-serif;
}

.milo-day-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    min-height: 1.75rem;
}

.milo-day-place {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    min-width: 0;

    font-size: 0.95rem;
    font-weight: 600;
}

.milo-day-place > span {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.milo-day-clock {
    margin-left: auto;

    color: rgba(255, 255, 255, 0.75);

    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The time in a digital clock's digits: DSEG7 Classic, bold (SIL Open
   Font License, free for company use; the look of Digital-7, whose
   licence is personal use only). AM/PM stays in MILO's font: seven
   segments can't draw an M. Until it loads, MILO's font shows */
@font-face {
    font-family: "DSEG7 Classic";
    src: url("https://cdn.jsdelivr.net/npm/dseg@0.46.0/fonts/DSEG7-Classic/DSEG7Classic-Bold.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

.milo-day-time {
    font-family: "DSEG7 Classic", "Poppins", system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.milo-day-time small {
    margin-left: 0.2rem;

    font-family: "Poppins", system-ui, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0;
}

.milo-day-more {
    width: 1.75rem;
    height: 1.75rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: rgba(255, 255, 255, 0.85);
    background: transparent;
    border: 0;
    border-radius: 50%;
}

.milo-day-more:hover,
.milo-day-more:focus-visible,
.milo-day-more[aria-expanded="true"] {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
}

.milo-day-main,
.milo-day-ask {
    flex: 1;

    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;

    margin: 0.55rem 0 0.7rem;
}

.milo-day-now {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.milo-day-now > i {
    font-size: 2.35rem;
    line-height: 1;
}

.milo-day-temp {
    display: block;

    font-size: 2.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
}

.milo-day-feel {
    display: block;

    margin-top: 0.35rem;

    color: rgba(255, 255, 255, 0.72);

    font-size: 0.72rem;
    white-space: nowrap;
}

.milo-day-insight {
    padding-left: 0.95rem;

    border-left: 1px solid rgba(255, 255, 255, 0.16);

    font-size: 0.82rem;
    line-height: 1.4;
}

.milo-day-insight strong {
    display: block;

    font-size: 0.88rem;
    font-weight: 600;
    text-wrap: balance;
}

.milo-day-insight > span {
    display: block;

    color: rgba(255, 255, 255, 0.78);
    text-wrap: pretty;
}

/* Only when the weather is worth a look: amber look, red bad */
.milo-day-kicker {
    display: flex;
    align-items: center;
    gap: 0.35rem;

    margin-bottom: 0.15rem;

    color: rgba(255, 255, 255, 0.82);

    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.milo-day-kicker::before {
    content: "";

    width: 0.45rem;
    height: 0.45rem;

    background: #f6c453;
    border-radius: 50%;
}

.milo-day-card[data-tone="storm"] .milo-day-kicker::before,
.milo-day-card[data-tone="heavy_rain"] .milo-day-kicker::before,
.milo-day-card[data-tone="heat"] .milo-day-kicker::before {
    background: #ff8f7e;
}

.milo-day-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.milo-day-pill {
    padding: 0.28rem 1rem;

    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;

    font-size: 0.78rem;
    font-weight: 600;
}

.milo-day-pill:hover,
.milo-day-pill:focus-visible {
    background: rgba(255, 255, 255, 0.26);
}

.milo-day-checked {
    color: rgba(255, 255, 255, 0.7);

    font-size: 0.72rem;
}

/* Location not shared yet, or blocked */
.milo-day-ask > i {
    font-size: 2rem;
    line-height: 1;
}

.milo-day-ask strong {
    display: block;

    font-size: 0.9rem;
    font-weight: 600;
}

.milo-day-ask span {
    color: rgba(255, 255, 255, 0.78);

    font-size: 0.8rem;
    line-height: 1.4;
}

/* Checking, or the service can't be reached: the same card, quieter */
.milo-day-card[data-state="loading"] .milo-day-now,
.milo-day-card[data-state="unavailable"] .milo-day-now {
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 575.98px) {
    .milo-day-card {
        width: 100%;
    }
}

/* The forecast window (View forecast); follows the light / dark theme */
.milo-forecast .modal-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.milo-forecast h3 {
    margin: 1.1rem 0 0.5rem;

    color: var(--milo-gray-700);

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.milo-forecast-now {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    padding: 0.75rem 0.9rem;

    background: var(--milo-surface-soft);
    border-radius: 14px;
}

.milo-forecast-now > i {
    font-size: 2rem;
}

.milo-forecast-hours {
    display: grid;
    grid-auto-columns: minmax(3.5rem, 1fr);
    grid-auto-flow: column;
    gap: 0.4rem;

    margin: 0;
    padding: 0 0 0.35rem;

    overflow-x: auto;

    list-style: none;
}

.milo-forecast-hours li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;

    padding: 0.55rem 0.3rem;

    border: 1px solid var(--milo-border);
    border-radius: 12px;

    font-size: 0.78rem;
    text-align: center;
}

.milo-forecast-hours i,
.milo-forecast-days i {
    font-size: 1.25rem;
}

.milo-forecast-days {
    margin: 0;
    padding: 0;

    border: 1px solid var(--milo-border);
    border-radius: 12px;

    list-style: none;
}

.milo-forecast-days li {
    display: grid;
    grid-template-columns: 7rem 1.75rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;

    padding: 0.5rem 0.85rem;

    font-size: 0.85rem;
}

.milo-forecast-days li + li {
    border-top: 1px solid var(--milo-border);
}

.milo-forecast-rain {
    color: var(--milo-gray-700);
}

.milo-forecast .modal-footer {
    justify-content: flex-start;

    color: var(--milo-gray-700);

    font-size: 0.75rem;
}


/* =========================================================
   LIVE SIGN (Lalamove, Hauling)
   Green pulsing dot: a job is on the way right now. White dot:
   one is waiting for pickup today. The Transport rail icon gets
   a small green dot while anything is on the way.
   ========================================================= */

.milo-live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    margin-left: auto;
    padding: 0.1rem 0.45rem;

    border: 1px solid transparent;
    border-radius: 999px;

    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
}

.milo-live.is-moving {
    color: #166534;
    background: #dcfce7;
}

.milo-live.is-waiting {
    color: var(--milo-ink);
    background: var(--milo-surface);
    border-color: #c9cfc9;
}

/* Sidebar links set their icons' width; the dot keeps its own */
.milo-flyout-link .milo-live-dot,
.milo-live-dot {
    width: 8px;
    height: 8px;

    flex-shrink: 0;

    border-radius: 50%;
}

/* Steady: the pill's circling light shows it's moving */
.milo-live.is-moving .milo-live-dot {
    background: #1f9d55;
}

/*
 * Running right now: one soft green light circles the edge. Only for
 * something in progress at this moment (a job on the way), never as
 * decoration. Drawn on top of the border, so backgrounds and the dark
 * theme are untouched.
 */
@property --milo-light-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.milo-running,
.milo-live.is-moving {
    position: relative;
}

.milo-running::before,
.milo-live.is-moving::before {
    content: "";
    position: absolute;
    inset: -1px;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(from var(--milo-light-angle), transparent 65%, #1f9d55 90%, transparent);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    animation: milo-running 2.4s linear infinite;
}

@keyframes milo-running {
    to {
        --milo-light-angle: 360deg;
    }
}

/* Dashboard cards (Cockpit In Transit, Classis In Use, Third-Party
   In transit): a slightly wider light, seen from across the room */
:is(.milo-kpi-card, .milo-tp-tile).milo-running::before {
    padding: 2px;
}

/* The dark rail (Transport icon): brighter, just outside the edge */
.milo-rail-icon.milo-running::before {
    inset: -4px;
    padding: 2px;
    background: conic-gradient(from var(--milo-light-angle), transparent 60%, #7ee2a8 90%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .milo-running::before,
    .milo-live.is-moving::before {
        animation: none;
    }
}

/*
 * ON THE ROAD: a schedule with a trip on the road right now
 * (Trip::underWay, the menu's rule), in Schedules. Its event in the
 * calendar (Month, Week, Agenda) and its Lifecycle pill in the List get
 * the running light: one green light circling the whole edge, a little
 * slower than the menu's (3.2 s against 2.4 s), so the two read apart.
 * Calendar events keep FullCalendar's own positioning (Week's are
 * absolute); an Agenda event is a table row, the row holding the ring.
 */
.milo-badge.milo-on-road,
.milo-calendar tr.milo-on-road {
    position: relative;
}

.milo-calendar .milo-event.milo-on-road:not(.fc-list-event)::after,
.milo-calendar tr.milo-on-road::after,
.milo-badge.milo-on-road::after {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(from var(--milo-light-angle), transparent 65%, #1f9d55 90%, transparent);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    animation: milo-running 3.2s linear infinite;
}

/*
 * The trip card on a schedule's page (only the trip on the road): the
 * same running light round the whole card, 3.2 s a lap, so "on the
 * road" reads the same throughout Schedules. Bootstrap's card is already
 * positioned; the light sits over its border.
 */
.milo-trip-card.milo-on-road::after {
    content: "";
    position: absolute;
    inset: -1px;
    padding: 2px;
    border-radius: inherit;
    background: conic-gradient(from var(--milo-light-angle), transparent 65%, #1f9d55 90%, transparent);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    animation: milo-running 3.2s linear infinite;
}

/* Reduced motion: the light stands still on the edge */
@media (prefers-reduced-motion: reduce) {
    .milo-calendar .milo-event.milo-on-road:not(.fc-list-event)::after,
    .milo-calendar tr.milo-on-road::after,
    .milo-badge.milo-on-road::after,
    .milo-trip-card.milo-on-road::after {
        animation: none;
    }
}

.milo-live.is-waiting .milo-live-dot {
    background: var(--milo-surface);
    border: 1.5px solid var(--milo-gray);
}

/* Something in the group needs follow-up: a dot, no number (the counts
   show in the menu on hover); bottom corner, clear of the live dot */
.milo-rail-dot {
    position: absolute;
    right: -3px;
    bottom: -3px;

    width: 11px;
    height: 11px;

    /* The Attention page's amber, so it follows Lights as Attention does */
    background: var(--milo-warning);
    border: 2px solid var(--milo-green-950);
    border-radius: 50%;
}

/* Attention: red when a condition is critical */
.milo-rail-dot.is-danger {
    background: var(--milo-danger);
}

.milo-rail-live {
    position: absolute;
    top: -3px;
    right: -3px;

    width: 12px;
    height: 12px;

    background: #1f9d55;
    border: 2px solid var(--milo-green-950);
    border-radius: 50%;
}

/* Operations, Transport and Intelligence: the same dots, stacked at the
   icon's right edge in one order: green (on the road; resolved today),
   then amber (waiting on you, behind, needing follow-up: the Attention
   page's amber, deeper with Lights on, brighter with Lights off, so it
   never reads as a second red), then red (cancelled, overdue,
   critical), each with a soft glow of its own colour. Only the ones
   with something to show (layouts/partials/rail-stack) */
.milo-rail-stack {
    position: absolute;
    top: 50%;
    right: -4px;

    display: flex;
    flex-direction: column;
    gap: 2px;

    transform: translateY(-50%);
}

.milo-rail-lamp {
    width: 11px;
    height: 11px;

    border: 2px solid var(--milo-green-950);
    border-radius: 50%;
}

.milo-rail-lamp.is-green {
    background: #1f9d55;
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.85);
}

.milo-rail-lamp.is-amber {
    background: var(--milo-warning);
    box-shadow: 0 0 5px color-mix(in srgb, var(--milo-warning) 85%, transparent);
}

.milo-rail-lamp.is-red {
    background: var(--milo-danger);
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.85);
}


/* =========================================================
   CLASSIS MONITORING
   Vehicle records, not live tracking. The train line: each
   trip moves along as its record fills in. Per vehicle type,
   three cards: now, recent, next.
   ========================================================= */

.milo-classis-section {
    scroll-margin-top: 1rem;
}

.milo-classis-label,
.milo-classis-card-label {
    color: var(--milo-gray-700);

    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.milo-classis-heading {
    margin-bottom: 0.75rem;

    color: var(--milo-ink);

    font-size: 1rem;
    font-weight: 700;
}

.milo-classis-subhead {
    margin: 0 0 0.5rem;

    color: var(--milo-gray);

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.milo-classis-go {
    color: var(--milo-ink);

    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}


/* "+ Add type" beside the type tabs: quieter, dashed like an empty slot */
.milo-classis-add-type {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    padding: 0.35rem 0.85rem;

    color: var(--milo-gray-700);
    border: 1px dashed var(--milo-border);
    border-radius: 10px;

    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.milo-classis-add-type:hover {
    color: var(--milo-ink);
    background: var(--milo-sage-soft);
}


/* Reminder: remarks still without a point of contact */
.milo-classis-reminder {
    display: flex;
    gap: 0.6rem;

    padding: 0.75rem 1rem;

    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--milo-radius);
}

.milo-classis-reminder a {
    color: #92400e;
    font-weight: 600;
}


/* Breakdown tiles */
.milo-classis-tile {
    height: 100%;

    display: flex;
    flex-direction: column;
    gap: 0.2rem;

    padding: 0.9rem 1rem;

    color: inherit;
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow);

    text-decoration: none;

    transition:
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.milo-classis-tile:hover {
    color: inherit;
    box-shadow: var(--milo-shadow-lg);
    transform: translateY(-1px);
}

.milo-classis-tile-number {
    color: var(--milo-ink);

    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

/* The tile is the link: focused from the keyboard, its number's note shows */
.milo-classis-tile:focus-visible .milo-classis-tile-number[data-milo-tooltip]::after {
    display: block;
    opacity: 1;
    transform: none;
}

.milo-classis-tile .milo-classis-go {
    margin-top: auto;
    padding-top: 0.4rem;
}


/* The train line: stops across the top, a lane under each */
.milo-classis-line-wrap {
    min-width: 1080px;
}

.milo-classis-line,
.milo-classis-lanes {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.milo-classis-line {
    position: relative;
    margin-bottom: 0.6rem;
}

.milo-classis-line::before {
    content: "";

    position: absolute;
    top: 9px;
    left: 10%;
    right: 10%;

    height: 2px;

    background: var(--milo-border);
}

.milo-classis-stop {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;

    color: var(--milo-gray-700);

    font-size: 0.78rem;
    text-align: center;
}

.milo-classis-stop strong {
    color: var(--milo-ink);
    font-size: 0.85rem;
}

/* Each stage fills from the bottom, in MILO green, with how many on
   the line have reached it (--fill, set on the page) */
.milo-classis-dot {
    width: 20px;
    height: 20px;

    background: linear-gradient(to top, var(--milo-green-600) var(--fill, 0%), var(--milo-surface) 0);
    border: 2px solid var(--milo-ink);
    border-radius: 50%;
}

.milo-classis-share {
    color: var(--milo-green-600);
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 700;
}


/* =========================================================
   WAVE RING (x-milo.wave-ring)
   The calm wave around an icon: a pixel up and down, about 16 px a
   wave, 1.8 px thick. --p of it fills from the top, clockwise, drifting
   slowly (one wave in 4 s, as the Activity Center's water): green while
   on track, amber when something is behind, red when something critical
   waits (the icon in their colour); a plain, still ring only when
   everything is done.
   Drawn once here: sm 34 px (around 26 px links), md 44 px (32 px
   links), lg 52 px (40 px card icons).
   ========================================================= */

:root {
    --milo-wave-ring-sm: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2034%2034'%3E%3Cpath%20d='M17,3L17.56,2.82L18.13,2.66L18.71,2.55L19.3,2.47L19.89,2.45L20.48,2.49L21.07,2.58L21.64,2.73L22.19,2.95L22.71,3.21L23.21,3.53L23.68,3.9L24.11,4.3L24.51,4.74L24.89,5.2L25.23,5.67L25.55,6.16L25.84,6.65L26.13,7.13L26.4,7.6L26.67,8.06L26.94,8.51L27.22,8.94L27.52,9.36L27.83,9.77L28.15,10.17L28.49,10.57L28.84,10.97L29.21,11.37L29.58,11.79L29.95,12.22L30.31,12.67L30.66,13.15L30.99,13.64L31.28,14.16L31.53,14.7L31.73,15.26L31.88,15.83L31.97,16.41L32,17L31.97,17.59L31.88,18.17L31.73,18.74L31.53,19.3L31.28,19.84L30.99,20.36L30.66,20.85L30.31,21.33L29.95,21.78L29.58,22.21L29.21,22.63L28.84,23.03L28.49,23.43L28.15,23.83L27.83,24.23L27.52,24.64L27.22,25.06L26.94,25.49L26.67,25.94L26.4,26.4L26.13,26.87L25.84,27.35L25.55,27.84L25.23,28.33L24.89,28.8L24.51,29.26L24.11,29.7L23.68,30.1L23.21,30.47L22.71,30.79L22.19,31.05L21.64,31.27L21.07,31.42L20.48,31.51L19.89,31.55L19.3,31.53L18.71,31.45L18.13,31.34L17.56,31.18L17,31L16.46,30.79L15.93,30.58L15.42,30.35L14.92,30.13L14.43,29.92L13.95,29.71L13.47,29.53L12.98,29.36L12.49,29.21L12,29.08L11.49,28.96L10.97,28.84L10.43,28.73L9.88,28.61L9.33,28.48L8.77,28.33L8.21,28.15L7.66,27.94L7.12,27.69L6.6,27.4L6.11,27.07L5.65,26.69L5.24,26.27L4.86,25.82L4.54,25.32L4.28,24.8L4.06,24.25L3.9,23.68L3.78,23.09L3.71,22.5L3.68,21.91L3.69,21.33L3.71,20.75L3.76,20.18L3.81,19.62L3.87,19.08L3.92,18.55L3.96,18.03L3.99,17.51L4,17L3.99,16.49L3.96,15.97L3.92,15.45L3.87,14.92L3.81,14.38L3.76,13.82L3.71,13.25L3.69,12.67L3.68,12.09L3.71,11.5L3.78,10.91L3.9,10.32L4.06,9.75L4.28,9.2L4.54,8.68L4.86,8.18L5.24,7.73L5.65,7.31L6.11,6.93L6.6,6.6L7.12,6.31L7.66,6.06L8.21,5.85L8.77,5.67L9.33,5.52L9.88,5.39L10.43,5.27L10.97,5.16L11.49,5.04L12,4.92L12.49,4.79L12.98,4.64L13.47,4.47L13.95,4.29L14.43,4.08L14.92,3.87L15.42,3.65L15.93,3.42L16.46,3.21Z'%20fill='none'%20stroke='%23000'%20stroke-width='1.8'%20stroke-linejoin='round'/%3E%3C/svg%3E");
    --milo-wave-ring-md: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2044%2044'%3E%3Cpath%20d='M22,3L22.76,2.74L23.53,2.54L24.32,2.4L25.11,2.35L25.9,2.4L26.67,2.56L27.41,2.81L28.12,3.16L28.79,3.59L29.42,4.09L30,4.64L30.55,5.21L31.08,5.79L31.59,6.35L32.09,6.89L32.61,7.4L33.14,7.86L33.71,8.29L34.3,8.69L34.94,9.06L35.59,9.43L36.27,9.81L36.95,10.21L37.62,10.65L38.26,11.14L38.85,11.68L39.37,12.27L39.81,12.93L40.16,13.63L40.41,14.38L40.56,15.15L40.63,15.95L40.62,16.75L40.55,17.55L40.44,18.33L40.32,19.1L40.19,19.85L40.09,20.58L40.02,21.29L40,22L40.02,22.71L40.09,23.42L40.19,24.15L40.32,24.9L40.44,25.67L40.55,26.45L40.62,27.25L40.63,28.05L40.56,28.85L40.41,29.62L40.16,30.37L39.81,31.07L39.37,31.73L38.85,32.32L38.26,32.86L37.62,33.35L36.95,33.79L36.27,34.19L35.59,34.57L34.94,34.94L34.3,35.31L33.71,35.71L33.14,36.14L32.61,36.6L32.09,37.11L31.59,37.65L31.08,38.21L30.55,38.79L30,39.36L29.42,39.91L28.79,40.41L28.12,40.84L27.41,41.19L26.67,41.44L25.9,41.6L25.11,41.65L24.32,41.6L23.53,41.46L22.76,41.26L22,41L21.26,40.71L20.55,40.42L19.85,40.14L19.17,39.89L18.48,39.67L17.8,39.51L17.1,39.38L16.38,39.3L15.64,39.24L14.88,39.2L14.09,39.15L13.3,39.07L12.51,38.94L11.73,38.75L10.98,38.49L10.27,38.14L9.62,37.71L9.03,37.19L8.51,36.59L8.06,35.94L7.69,35.23L7.37,34.49L7.11,33.74L6.88,32.99L6.66,32.25L6.45,31.53L6.21,30.84L5.95,30.18L5.65,29.54L5.3,28.92L4.91,28.3L4.49,27.69L4.05,27.06L3.6,26.42L3.17,25.74L2.79,25.04L2.46,24.31L2.21,23.56L2.05,22.78L2,22L2.05,21.22L2.21,20.44L2.46,19.69L2.79,18.96L3.17,18.26L3.6,17.58L4.05,16.94L4.49,16.31L4.91,15.7L5.3,15.08L5.65,14.46L5.95,13.82L6.21,13.16L6.45,12.47L6.66,11.75L6.88,11.01L7.11,10.26L7.37,9.51L7.69,8.77L8.06,8.06L8.51,7.41L9.03,6.81L9.62,6.29L10.27,5.86L10.98,5.51L11.73,5.25L12.51,5.06L13.3,4.93L14.09,4.85L14.88,4.8L15.64,4.76L16.38,4.7L17.1,4.62L17.8,4.49L18.48,4.33L19.17,4.11L19.85,3.86L20.55,3.58L21.26,3.29Z'%20fill='none'%20stroke='%23000'%20stroke-width='1.8'%20stroke-linejoin='round'/%3E%3C/svg%3E");
    --milo-wave-ring-lg: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2052%2052'%3E%3Cpath%20d='M26,3L26.92,2.67L27.86,2.42L28.81,2.29L29.75,2.31L30.68,2.48L31.57,2.81L32.41,3.27L33.2,3.83L33.95,4.46L34.66,5.1L35.34,5.73L36.04,6.3L36.75,6.8L37.51,7.22L38.32,7.57L39.17,7.87L40.07,8.15L40.99,8.45L41.9,8.8L42.76,9.24L43.56,9.77L44.25,10.42L44.82,11.16L45.26,12.01L45.59,12.91L45.81,13.86L45.96,14.82L46.09,15.76L46.22,16.68L46.4,17.55L46.64,18.39L46.97,19.19L47.38,19.97L47.86,20.75L48.37,21.55L48.87,22.38L49.33,23.24L49.69,24.14L49.92,25.06L50,26L49.92,26.94L49.69,27.86L49.33,28.76L48.87,29.62L48.37,30.45L47.86,31.25L47.38,32.03L46.97,32.81L46.64,33.61L46.4,34.45L46.22,35.32L46.09,36.24L45.96,37.18L45.81,38.14L45.59,39.09L45.26,39.99L44.82,40.84L44.25,41.58L43.56,42.23L42.76,42.76L41.9,43.2L40.99,43.55L40.07,43.85L39.17,44.13L38.32,44.43L37.51,44.78L36.75,45.2L36.04,45.7L35.34,46.27L34.66,46.9L33.95,47.54L33.2,48.17L32.41,48.73L31.57,49.19L30.68,49.52L29.75,49.69L28.81,49.71L27.86,49.58L26.92,49.33L26,49L25.11,48.64L24.25,48.28L23.4,47.97L22.56,47.74L21.7,47.6L20.83,47.54L19.92,47.54L18.99,47.58L18.03,47.62L17.05,47.6L16.09,47.5L15.15,47.29L14.28,46.93L13.47,46.44L12.76,45.82L12.14,45.08L11.59,44.28L11.11,43.43L10.67,42.58L10.24,41.76L9.78,41L9.27,40.29L8.69,39.64L8.05,39.04L7.34,38.47L6.59,37.9L5.83,37.3L5.1,36.65L4.45,35.94L3.9,35.16L3.48,34.31L3.22,33.4L3.11,32.46L3.13,31.49L3.25,30.53L3.44,29.57L3.64,28.65L3.83,27.74L3.96,26.87L4,26L3.96,25.13L3.83,24.26L3.64,23.35L3.44,22.43L3.25,21.47L3.13,20.51L3.11,19.54L3.22,18.6L3.48,17.69L3.9,16.84L4.45,16.06L5.1,15.35L5.83,14.7L6.59,14.1L7.34,13.53L8.05,12.96L8.69,12.36L9.27,11.71L9.78,11L10.24,10.24L10.67,9.42L11.11,8.57L11.59,7.72L12.14,6.92L12.76,6.18L13.47,5.56L14.28,5.07L15.15,4.71L16.09,4.5L17.05,4.4L18.03,4.38L18.99,4.42L19.92,4.46L20.83,4.46L21.7,4.4L22.56,4.26L23.4,4.03L24.25,3.72L25.11,3.36Z'%20fill='none'%20stroke='%23000'%20stroke-width='1.8'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.milo-wave-ring {
    --milo-ring-tone: var(--milo-green-600);
    --milo-ring-size: 52px;
    --milo-ring-wave: var(--milo-wave-ring-lg);
    --milo-ring-step: 40deg;

    position: relative;
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
    width: var(--milo-ring-size);
    height: var(--milo-ring-size);
    vertical-align: middle;
}

/* Each ring takes no more room than what it surrounds, so nothing
   around it moves or wraps: it reaches out over the margin */
.milo-wave-ring {
    margin: -6px;
}

.milo-wave-ring.is-sm {
    --milo-ring-size: 34px;
    --milo-ring-wave: var(--milo-wave-ring-sm);
    --milo-ring-step: 72deg;

    margin: -4px;
}

.milo-wave-ring.is-md {
    --milo-ring-size: 44px;
    --milo-ring-wave: var(--milo-wave-ring-md);
    --milo-ring-step: 51.429deg;
}

.milo-wave-ring.is-amber {
    --milo-ring-tone: var(--milo-warning);
}

.milo-wave-ring.is-red {
    --milo-ring-tone: var(--milo-danger);
}

/* Behind or critical: the icon says so too, even before anything is done
   (the part still to do stays grey, so a full ring always means done) */
.milo-wave-ring:is(.is-amber, .is-red) > .milo-kpi-icon > i {
    color: var(--milo-ring-tone);
}

/* The ring: grey all round, the share in its colour. Until it's done the
   wave drifts round, one wave in 4 s: the ring turns and its fill turns
   back, so the share stays where it is */
@property --milo-ring-turn {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.milo-wave-ring::before {
    content: "";
    position: absolute;
    inset: 0;
    background: conic-gradient(from calc(0deg - var(--milo-ring-turn)), var(--milo-ring-tone) calc(var(--p) * 1%), var(--milo-border) 0);
    -webkit-mask: var(--milo-ring-wave) center / 100% 100% no-repeat;
    mask: var(--milo-ring-wave) center / 100% 100% no-repeat;
    transform: rotate(var(--milo-ring-turn));
    pointer-events: none;
    animation: milo-ring-drift 4s linear infinite;
}

@keyframes milo-ring-drift {
    to {
        --milo-ring-turn: var(--milo-ring-step);
    }
}

/* Done, or nothing done yet: still (an empty grey ring that moved read
   like a broken loader) */
.milo-wave-ring:is(.is-done, .is-empty)::before {
    animation: none;
}

/* Something to act on (a trip's amber box ring): flashes three times as
   the page opens, the count bubbles' pulse in the ring's own colour; every
   load or refresh plays it again. On the ring itself, not a pseudo-element:
   its ::after is the hover note's */
.milo-wave-ring.is-flash {
    border-radius: 50%;
    animation: milo-ring-flash 1.8s ease-out 3;
}

@keyframes milo-ring-flash {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--milo-ring-tone) 55%, transparent);
    }

    70% {
        box-shadow: 0 0 0 9px transparent;
    }

    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

@media (prefers-reduced-motion: reduce) {
    .milo-wave-ring::before,
    .milo-wave-ring.is-flash {
        animation: none;
    }
}

/* Done: a plain ring */
.milo-wave-ring.is-done::before {
    inset: 2.1px;
    background: none;
    border: 1.8px solid var(--milo-ring-tone);
    border-radius: 50%;
    -webkit-mask: none;
    mask: none;
}

/* A card icon in a ring is round */
.milo-wave-ring > .milo-kpi-icon {
    border-radius: 50%;
}

/* A link icon in a ring takes the ring's colour; a trip's box keeps its
   orange (it only shows while something waits) */
.milo-wave-ring > .milo-icon-link > i:not(.text-warning) {
    color: var(--milo-ring-tone) !important;
}

.milo-classis-lane {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;

    padding: 0.75rem;

    background: var(--milo-surface-soft);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
}

.milo-classis-lane-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.milo-classis-trip {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;

    padding: 0.65rem 0.75rem;

    color: inherit;
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 10px;

    text-decoration: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.milo-classis-trip:hover {
    color: inherit;
    border-color: var(--milo-sage-200);
    box-shadow: var(--milo-shadow);
}

/* "Show 6 more" / "Show less" at the foot of a lane */
.milo-classis-more-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;

    padding: 0.4rem 0.6rem;

    color: var(--milo-gray-700);
    background: transparent;
    border: 1px dashed #c9cfc9;
    border-radius: 10px;

    font-size: 0.8rem;
    font-weight: 600;

    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.milo-classis-more-toggle:hover {
    color: var(--milo-ink);
    background: var(--milo-surface);
    border-color: var(--milo-sage-200);
}

.milo-classis-trip .milo-classis-go {
    color: var(--milo-gray-700);
}

.milo-classis-trip:hover .milo-classis-go {
    color: var(--milo-ink);
}


/* Per type: now, recent, next */
.milo-classis-type-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;

    color: var(--milo-ink);

    font-size: 1rem;
    font-weight: 700;
}

.milo-classis-type-title a {
    color: inherit;
    text-decoration: none;
}

.milo-classis-type-title a:hover {
    text-decoration: underline;
}

.milo-classis-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.milo-classis-card {
    position: relative;

    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    padding: 0.9rem 1rem;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow);

    font-size: 0.88rem;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

/* On hover (or keyboard focus) the card grows a little and a few
   more details open in a panel attached below it, over the page,
   so nothing else moves */
.milo-classis-card:hover,
.milo-classis-card:focus-within {
    z-index: 10;

    box-shadow: var(--milo-shadow-lg);
    transform: scale(1.03);
}

.milo-classis-card:has(.milo-classis-more):hover,
.milo-classis-card:has(.milo-classis-more):focus-within {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.milo-classis-more {
    position: absolute;
    top: calc(100% - 1px);
    left: -1px;
    right: -1px;

    display: flex;
    flex-direction: column;
    gap: 0.3rem;

    padding: 0.6rem 1rem 0.8rem;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-top-style: dashed;
    border-radius: 0 0 var(--milo-radius) var(--milo-radius);
    box-shadow: 0 14px 24px rgba(19, 52, 38, 0.1);

    font-size: 0.82rem;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s;
}

.milo-classis-card:hover .milo-classis-more,
.milo-classis-card:focus-within .milo-classis-more {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* Links inside a card sit above the card's own (stretched) link */
.milo-classis-more a,
.milo-classis-item {
    position: relative;
    z-index: 2;
}

.milo-classis-fact {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.milo-classis-fact > i {
    margin-top: 0.1rem;
    color: var(--milo-gray);
}

.milo-classis-times {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.15rem 0.75rem;

    font-size: 0.82rem;
}

.milo-classis-times em {
    margin-right: 0.35rem;

    color: var(--milo-gray);

    font-style: normal;
    font-weight: 600;
}

.milo-classis-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.6rem;

    margin: 0 -0.5rem;
    padding: 0.4rem 0.5rem;

    color: inherit;
    border-radius: 8px;

    text-decoration: none;
}

.milo-classis-item:hover {
    color: inherit;
    background: var(--milo-surface-soft);
}

.milo-classis-when {
    min-width: 7.5rem;

    color: var(--milo-gray-700);

    font-size: 0.8rem;
    font-weight: 600;
}

@media (max-width: 991.98px) {

    .milo-classis-cards {
        grid-template-columns: minmax(0, 1fr);
    }

}


/* Type pages: each vehicle in full, with its remarks */
.milo-classis-vehicle {
    scroll-margin-top: 1rem;
}

/* The vehicle a link pointed at (#vehicle-12) */
.milo-classis-vehicle:target {
    box-shadow: 0 0 0 3px var(--milo-sage-200);
}

.milo-classis-remark {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;

    margin-bottom: 0.6rem;
    padding: 0.75rem 0.9rem;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 10px;
}

.milo-classis-remark.is-pending {
    background: #fffbeb;
    border-color: #fde68a;
}

.milo-classis-remark.is-resolved {
    background: var(--milo-surface-soft);
}

/* A daily update (not a problem): soft green */
.milo-classis-remark.is-update {
    background: #f6fbf7;
    border-color: #d9efe0;
}


/* Daily update reminder on each vehicle (type pages). Amber until
   someone adds or updates a remark today, green once they have.
   Pointing at the amber one offers two icons: add remark, not yet. */
.milo-classis-daily {
    position: relative;
    display: inline-flex;
}

.milo-classis-daily-icon,
.milo-classis-daily.is-done {
    width: 32px;
    height: 32px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid transparent;
    border-radius: 9px;

    font-size: 0.95rem;
}

.milo-classis-daily.is-due .milo-classis-daily-icon {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;

    cursor: pointer;

    animation: milo-daily-nudge 2.4s ease-in-out 3;
}

.milo-classis-daily.is-done {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.milo-classis-daily-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;

    width: 190px;
    padding: 0.65rem 0.75rem;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow-lg);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s;
}

/* Bridges the gap so the choices stay open on the way down to them */
.milo-classis-daily-pop::before {
    content: "";

    position: absolute;
    top: -10px;
    left: 0;
    right: 0;

    height: 10px;
}

.milo-classis-daily.is-due:hover .milo-classis-daily-pop,
.milo-classis-daily.is-due:focus-within .milo-classis-daily-pop,
.milo-classis-daily.is-due.is-open .milo-classis-daily-pop {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* "Not yet": the choices go away, the icon stays amber */
.milo-classis-daily.is-snoozed .milo-classis-daily-pop {
    opacity: 0 !important;
    visibility: hidden !important;
}

.milo-classis-daily-choice {
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: var(--milo-ink);
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 9px;
}

.milo-classis-daily-choice.is-add {
    background: var(--milo-sage-200);
    border-color: var(--milo-sage-200);
}

.milo-classis-daily-choice:hover {
    box-shadow: var(--milo-shadow);
}

@keyframes milo-daily-nudge {
    0%,
    100% {
        transform: none;
    }

    50% {
        transform: translateY(-2px);
    }
}

@media (prefers-reduced-motion: reduce) {

    .milo-classis-daily.is-due .milo-classis-daily-icon {
        animation: none;
    }

}

/* "Add a remark": no ▶ marker; ⊕ turns into ⊖ while open */
.milo-classis-add summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    padding: 0.35rem 0.7rem;

    color: var(--milo-ink);
    border: 1px solid var(--milo-border);
    border-radius: 999px;

    font-size: 0.85rem;
    font-weight: 600;

    list-style: none;
    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.milo-classis-add summary::-webkit-details-marker {
    display: none;
}

.milo-classis-add summary:hover,
.milo-classis-add[open] summary {
    background: var(--milo-sage-soft);
    border-color: var(--milo-sage-200);
}

.milo-classis-add .milo-when-open,
.milo-classis-add[open] .milo-when-closed {
    display: none;
}

.milo-classis-add[open] .milo-when-open {
    display: inline;
}


/* =========================================================
   FLEET CAPACITY (Vehicles page, Attention, Change Status)
   Vehicle colours as everywhere: green utilized, orange idle,
   red no driver, dark red maintenance. Insights stay neutral:
   they're worth knowing, not a problem.
   ========================================================= */

/* Attention and Insights as a list: icon, title, detail, Open */
.milo-condition-list {
    margin: 0;
    padding: 0;

    list-style: none;
}

.milo-condition {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;

    padding: 0.7rem 0;

    border-bottom: 1px solid var(--milo-border);
}

.milo-condition:last-child {
    border-bottom: 0;
}

.milo-condition > i {
    flex-shrink: 0;

    margin-top: 0.1rem;

    font-size: 1rem;
}

.milo-condition.is-danger > i {
    color: var(--milo-danger);
}

.milo-condition.is-warning > i {
    color: #c2410c;
}

.milo-condition.is-info > i {
    width: 1.6rem;
    height: 1.6rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: -0.15rem;

    color: var(--milo-ink);
    background: var(--milo-sage-soft);
    border-radius: 8px;

    font-size: 0.85rem;
}

.milo-condition-text {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.milo-condition-text strong {
    font-size: 0.9rem;
}

.milo-condition-text span {
    color: var(--milo-gray-700);
    font-size: 0.83rem;
}

.milo-condition-empty {
    padding: 1rem 0;

    color: var(--milo-gray-700);
    font-size: 0.88rem;
    text-align: center;
}

/* Severity dot before a condition in the Attention table */
.milo-severity-dot {
    display: inline-block;

    width: 9px;
    height: 9px;

    margin-right: 0.4rem;

    border-radius: 50%;

    vertical-align: middle;
}

.milo-severity-dot-danger {
    background: var(--milo-danger);
}

.milo-severity-dot-warning {
    background: #c2410c;
}

/* Readiness and utilization bars in the type table */
.milo-meter {
    width: 100%;
    max-width: 140px;
    height: 7px;

    overflow: hidden;

    background: var(--milo-surface-soft);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--milo-border);
}

.milo-meter > span {
    display: block;

    height: 100%;

    background: var(--milo-ink);
    border-radius: inherit;
}

.milo-meter.is-used > span {
    background: var(--milo-green-600);
}

.milo-meter.is-warning > span {
    background: #c2410c;
}

.milo-meter.is-danger > span {
    background: var(--milo-danger);
}

.milo-capacity-table small {
    color: var(--milo-gray-700);
    font-variant-numeric: tabular-nums;
}

.milo-capacity-table td,
.milo-capacity-table th {
    font-variant-numeric: tabular-nums;
}

/* "2 trips need one": red when more than the free vehicles */
.milo-capacity-need {
    display: inline-block;

    margin-left: 0.25rem;
    padding: 0 0.45rem;

    color: #9a3412;
    background: #ffedd5;
    border-radius: 999px;

    font-weight: 700;
}

.milo-capacity-need.is-short {
    color: #912018;
    background: #fee4e2;
}

/* Trend: the period's totals above the chart */
.milo-trend-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.6rem;

    margin-bottom: 1rem;
}

.milo-trend-totals > div {
    display: flex;
    flex-direction: column;

    padding: 0.6rem 0.75rem;

    background: var(--milo-surface-soft);
    border-radius: 10px;
}

.milo-trend-totals span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    color: var(--milo-gray-700);
    font-size: 0.75rem;
}

.milo-trend-totals strong {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.milo-trend-totals small {
    color: var(--milo-gray);
    font-size: 0.7rem;
}

/* Change Status: three choices as cards */
.milo-status-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem;
}

.milo-status-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;

    padding: 0.75rem 0.9rem;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 12px;

    cursor: pointer;
}

.milo-status-choice input {
    margin-top: 0.3rem;
}

.milo-status-choice > i {
    font-size: 1.1rem;
}

.milo-status-choice span {
    display: flex;
    flex-direction: column;
}

.milo-status-choice small {
    color: var(--milo-gray-700);
    font-size: 0.78rem;
}

.milo-status-choice:has(input:checked) {
    background: var(--milo-sage-soft);
    border-color: var(--milo-sage-200);
}

.milo-status-choice.is-no_driver > i {
    color: var(--milo-danger);
}

.milo-status-choice.is-maintenance > i {
    color: #7f1d1d;
}

/* What's wrong + point of contact: only while Maintenance is picked */
.milo-maintenance-fields {
    display: none;

    padding: 0.9rem;

    background: var(--milo-surface-soft);
    border-radius: 12px;
}

.milo-status-form:has(input[value="maintenance"]:checked) .milo-maintenance-fields {
    display: block;
}


/* =========================================================
   THIRD-PARTY TRANSPORT (Lalamove, Hauling)
   Built like Classis: tiles, a 4-stop line of job cards, and a
   page per job with its timeline and evidence. Green pulses mean
   something is on the way right now.
   ========================================================= */

/* The line with four stops instead of Classis's five */
.milo-classis-line-wrap.has-4 {
    min-width: 900px;
}

.milo-classis-line-wrap.has-4 .milo-classis-line,
.milo-classis-line-wrap.has-4 .milo-classis-lanes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.milo-classis-line-wrap.has-4 .milo-classis-line::before {
    left: 12.5%;
    right: 12.5%;
}

/* A sidebar group link with a live sign: the count sits right after it */
.milo-flyout-link .milo-live + .milo-flyout-count {
    margin-left: 0.35rem;
}

/* Tiles */
.milo-tp-tile {
    height: 100%;

    display: flex;
    flex-direction: column;
    gap: 0.2rem;

    padding: 0.9rem 1rem;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow);
}

.milo-tp-tile .milo-classis-tile-number {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.milo-tp-tile-icon {
    color: var(--milo-gray);
    font-size: 1rem;
}

.milo-tp-tile.is-live {
    border-color: #bbe5c8;
}

.milo-tp-tile.is-live .milo-tp-tile-icon {
    color: #1f9d55;
}

.milo-tp-tile.is-warning .milo-classis-tile-number {
    color: #9a3412;
}

.milo-tp-tile.is-danger .milo-classis-tile-number {
    color: var(--milo-danger);
}

/* A tile that turns: three faces round a ring (Operational Planning's
   cost attention); the page sets --face, each face its --i */
.milo-ring-stage {
    position: relative;
    height: 100%;
    perspective: 1000px;
    container-type: inline-size;
    cursor: pointer;
}

.milo-ring {
    display: grid;
    height: 100%;
    transform-style: preserve-3d;
    transform: translateZ(-29cqw) rotateY(calc(var(--face, 0) * -120deg));
    transition: transform 0.8s ease;
}

/* Two classes, so a card's own hover lift never moves a face off the ring */
.milo-ring > .milo-ring-face {
    grid-area: 1 / 1;
    backface-visibility: hidden;
    transform: rotateY(calc(var(--i) * 120deg)) translateZ(29cqw);
}

.milo-ring-dots {
    position: absolute;
    right: 0.6rem;
    bottom: 0.4rem;
    z-index: 1;
    display: flex;
}

.milo-ring-dots button {
    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    background: radial-gradient(circle, var(--milo-border) 0.2rem, transparent 0.22rem);
    border: 0;
}

.milo-ring-dots button[aria-pressed="true"] {
    background: radial-gradient(circle, var(--milo-ink) 0.2rem, transparent 0.22rem);
}

/* Reports' Operational Cost ring (reports.partials.cost-ring): its faces
   are headline figures, room left under them for the dots; the
   breakdown is as wide as the other figures' and the face in front
   darkens its edge on hover, as they do */
.milo-report-ring > .milo-ring > .milo-ring-face {
    padding-bottom: 1.5rem;
}

.milo-report-ring .milo-kpi-breakdown {
    right: auto;

    width: min(22rem, 85vw);
}

.milo-report-ring:not(.is-dismissed):hover > .milo-ring > .milo-ring-face,
.milo-report-ring.is-pinned > .milo-ring > .milo-ring-face {
    border-color: var(--milo-ink);
}

/* Two faces flip, back to back (Reports' Trips and Cost per Trip) */
.milo-ring.milo-ring-2 {
    transform: rotateY(calc(var(--face, 0) * -180deg));
}

.milo-ring.milo-ring-2 > .milo-ring-face {
    transform: rotateY(calc(var(--i) * 180deg));
}

/* Reports' headline figures open their breakdown towards the side with
   room, as the Overview's script finds it (data-opens); without it, the
   last two in the row open leftwards */
.milo-report-headline > [data-opens="right"] .milo-kpi-breakdown {
    left: 0;
    right: auto;
}

.milo-report-headline > [data-opens="left"] .milo-kpi-breakdown {
    left: auto;
    right: 0;
}

/* What the figure is made of, one line under its change */
.milo-report-stat-split {
    margin-top: 0.35rem;

    color: var(--milo-gray-700);
    font-size: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
    .milo-ring {
        transition: none;
    }
}

/* The pulsing dot next to "On the way" */
.milo-tp-pulse {
    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: #1f9d55;
}

/* Job page: what's wrong and what's next */
.milo-tp-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;

    padding: 0.7rem 1rem;

    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    background: var(--milo-surface);
}

.milo-tp-banner.is-red {
    color: #912018;
    background: #fef3f2;
    border-color: #f1b5ae;
}

.milo-tp-banner.is-amber {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.milo-tp-banner .milo-live {
    margin-left: 0;
}

/* Execution timeline */
.milo-tp-timeline {
    margin: 0;
    padding: 0;

    list-style: none;
}

.milo-tp-timeline li {
    position: relative;

    display: flex;
    gap: 0.85rem;

    padding-bottom: 1rem;
}

.milo-tp-timeline li:last-child {
    padding-bottom: 0;
}

/* The line between the dots */
.milo-tp-timeline li:not(:last-child)::before {
    content: "";

    position: absolute;
    top: 14px;
    bottom: 0;
    left: 6px;

    width: 2px;

    background: var(--milo-border);
}

.milo-tp-timeline-dot {
    flex-shrink: 0;

    width: 14px;
    height: 14px;

    margin-top: 3px;

    background: var(--milo-surface);
    border: 2px solid #c9cfc9;
    border-radius: 50%;
}

.milo-tp-timeline li.is-done .milo-tp-timeline-dot {
    background: var(--milo-green-600);
    border-color: var(--milo-green-600);
}

.milo-tp-timeline div {
    display: flex;
    flex-direction: column;
}

.milo-tp-timeline span {
    font-size: 0.9rem;
}

.milo-tp-timeline small {
    color: var(--milo-gray-700);
}

/* Label / value pairs */
.milo-tp-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem 1.25rem;

    margin: 0;
}

.milo-tp-facts.is-stacked {
    grid-template-columns: 1fr;
}

.milo-tp-facts .is-wide {
    grid-column: 1 / -1;
}

.milo-tp-facts dt {
    color: var(--milo-gray);

    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.milo-tp-facts dd {
    margin: 0;
}

/* Points of contact */
.milo-tp-contact {
    display: grid;
    grid-template-columns: 170px 1fr;
    column-gap: 0.75rem;

    padding: 0.55rem 0;

    border-bottom: 1px solid var(--milo-border);
}

.milo-tp-contact:last-child {
    border-bottom: 0;
}

.milo-tp-contact-role {
    grid-row: span 2;

    color: var(--milo-gray-700);

    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.milo-tp-contact .text-secondary {
    font-size: 0.85rem;
}

/* Evidence checklist, files and upload */
/*
| Evidence panel (x-milo.evidence-panel), the same on every record:
| a row per kind of evidence. Colour only as meaning: green provided,
| red not provided, grey not needed yet or not assessed.
*/
.milo-evidence-legacy {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;

    margin-bottom: 0.85rem;
    padding: 0.6rem 0.85rem;

    background: var(--milo-surface-soft);
    border: 1px dashed var(--milo-border);
    border-radius: 12px;

    color: var(--milo-gray-700);
    font-size: 0.85rem;
}

.milo-evidence-rows {
    margin: 0 0 1rem;
    padding: 0;

    border: 1px solid var(--milo-border);
    border-radius: 12px;

    list-style: none;
}

.milo-evidence-rows > li {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem 0.75rem;

    padding: 0.7rem 0.85rem;
}

.milo-evidence-rows > li + li {
    border-top: 1px solid var(--milo-border);
}

.milo-evidence-mark {
    margin-top: 0.1rem;

    color: var(--milo-gray-700);
    font-size: 1.1rem;
}

.milo-evidence-rows > li.is-provided .milo-evidence-mark {
    color: #166534;
}

.milo-evidence-rows > li.is-missing {
    background: #fef3f2;
}

.milo-evidence-rows > li.is-missing .milo-evidence-mark,
.milo-evidence-rows > li.is-missing small {
    color: var(--milo-danger);
}

.milo-evidence-what {
    display: flex;
    flex: 1 1 14rem;
    flex-direction: column;
    gap: 0.1rem;

    min-width: 0;
}

.milo-evidence-what small {
    color: var(--milo-gray-700);
}

.milo-evidence-note {
    font-style: italic;
}

.milo-evidence-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.4rem;
}

/* Replace / Withdraw: the button opens a small form under it */
.milo-evidence-step > summary,
.milo-evidence-add > summary {
    list-style: none;
}

.milo-evidence-step > summary::-webkit-details-marker,
.milo-evidence-add > summary::-webkit-details-marker {
    display: none;
}

.milo-evidence-step[open] {
    flex-basis: 100%;
}

.milo-evidence-step > form {
    margin-top: 0.5rem;
    padding: 0.75rem;

    background: var(--milo-surface-soft);
    border-radius: 10px;
}

.milo-evidence-upload {
    margin-top: 0.6rem;
    padding: 0.85rem;

    background: var(--milo-surface-soft);
    border-radius: 12px;
}

/* "Specify" only when Other is picked */
.milo-evidence-upload:not(:has(option[data-other]:checked)) .milo-evidence-other {
    display: none;
}

.milo-evidence-earlier {
    margin-top: 1rem;
}

.milo-evidence-earlier .milo-evidence-rows {
    margin-bottom: 0;
}

.milo-evidence-state {
    margin-left: 0.35rem;
    padding: 0.05rem 0.45rem;

    background: var(--milo-surface-soft);
    border: 1px solid var(--milo-border);
    border-radius: 999px;

    color: var(--milo-gray-700);
    font-size: 0.72rem;
    font-weight: 600;
}

.milo-tp-cost {
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Forms: sections with a heading, and the buttons under the card */
.milo-form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;

    border-bottom: 1px solid var(--milo-border);
}

.milo-form-section:last-of-type {
    border-bottom: 0;
}

.milo-form-section legend {
    margin-bottom: 0.75rem;

    color: var(--milo-ink);

    font-size: 0.95rem;
    font-weight: 700;
}

.milo-form-section legend small {
    margin-left: 0.4rem;

    color: var(--milo-gray-700);

    font-size: 0.8rem;
    font-weight: 400;
}

.milo-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;

    margin-top: 1rem;
}

.milo-contact-row {
    padding: 0.6rem 0;
}

.milo-contact-row + .milo-contact-row {
    border-top: 1px dashed var(--milo-border);
}


/* =========================================================
   Reports & Analytics: the bigger picture
   Colour as meaning only: green = boon (good direction),
   red = bane (costly direction), amber = needs a look.
   ========================================================= */

.milo-report-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.milo-report-headline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.milo-report-stat {
    padding: 1rem 1.1rem;
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow);
}

.milo-report-stat-top {
    display: flex;
    justify-content: space-between;
    color: var(--milo-gray-700);
    font-size: 0.82rem;
    font-weight: 600;
}

.milo-report-stat-value {
    margin: 0.35rem 0 0.25rem;
    color: var(--milo-ink);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.milo-report-stat-change {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.8rem;
}

.milo-tone {
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-weight: 700;
}

.milo-tone-boon { color: var(--milo-green-600); background: var(--milo-sage-soft); }
.milo-tone-bane { color: var(--milo-danger); background: #fdecea; }
.milo-tone-neutral { color: var(--milo-gray-700); background: var(--milo-surface-soft); }

.milo-outlook-chart {
    position: relative;
    height: 340px;
}

.milo-outlook-verdict {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.milo-outlook-figures {
    margin: 0 0 0.75rem;
}

.milo-outlook-figures > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--milo-border);
}

.milo-outlook-figures dt {
    color: var(--milo-gray-700);
    font-weight: 500;
    font-size: 0.85rem;
}

.milo-outlook-figures dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.milo-outlook-boon dd { color: var(--milo-green-600); }
.milo-outlook-bane dd { color: var(--milo-danger); }

/* Legend under a split bar (Reports timing) */
.milo-stack-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    color: var(--milo-gray-700);
    font-size: 0.78rem;
}

.milo-stack-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 0.3rem;
    border-radius: 3px;
    vertical-align: -1px;
}

/* What to change */
.milo-findings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.milo-finding {
    padding: 0.9rem 1rem;
    border: 1px solid var(--milo-border);
    border-left-width: 4px;
    border-radius: 10px;
}

.milo-finding p { margin: 0.35rem 0 0; font-size: 0.86rem; }

.milo-finding-bane { border-left-color: var(--milo-danger); }
.milo-finding-boon { border-left-color: var(--milo-green-600); }

.milo-finding-title { font-weight: 700; }

.milo-finding-means { color: var(--milo-gray-700); }

/* Breakdown: a small bar behind each total */
.milo-report-table tfoot th { border-top: 2px solid var(--milo-ink); }

@media print {
    .milo-report-toolbar .btn,
    .milo-report-toolbar .milo-segmented { display: none !important; }
}


/* =========================================================
   Trend cards: a number, its change and a small line of the
   last weeks. Simple on purpose: read at a glance.
   ========================================================= */

.milo-trend-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.milo-trend-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9rem 1rem;
    color: var(--milo-ink);
    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow);
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.milo-trend-card.is-link:hover {
    color: var(--milo-ink);
    border-color: var(--milo-ink);
    transform: translateY(-1px);
}

.milo-trend-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.milo-trend-card-label {
    color: var(--milo-gray-700);
    font-size: 0.8rem;
    font-weight: 600;
}

.milo-trend-card-label i { margin-right: 0.3rem; }

.milo-trend-card-go { color: var(--milo-gray); font-size: 0.8rem; }

.milo-trend-card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.75rem;
}

.milo-trend-card-value {
    margin-bottom: 0.2rem;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.milo-trend-card-note {
    color: var(--milo-gray-700);
    font-size: 0.72rem;
}

/* The number keeps its room; the line gives way, down to a point */
.milo-trend-card-body > div { min-width: 0; }

.milo-trend-card .milo-tone { white-space: nowrap; }

.milo-sparkline {
    flex: 0 1 120px;
    min-width: 64px;
    height: 34px;
    overflow: visible;
}

/* A narrow card (five in a row, a phone) puts the line under the
   number, across the card, instead of squeezing the two side by side */
.milo-trend-card { container-type: inline-size; }

@container (max-width: 250px) {
    .milo-trend-card-body {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .milo-sparkline {
        flex: none;
        width: 100%;
        height: 28px;
    }
}

.milo-sparkline-line,
.milo-sparkline-dot {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.milo-sparkline-line { stroke-width: 2; }
.milo-sparkline-dot { stroke-width: 5.2; }

.milo-sparkline-neutral .milo-sparkline-line,
.milo-sparkline-neutral .milo-sparkline-dot { stroke: var(--milo-ink); }
.milo-sparkline-neutral .milo-sparkline-area { fill: rgba(22, 22, 22, 0.06); }

.milo-sparkline-boon .milo-sparkline-line,
.milo-sparkline-boon .milo-sparkline-dot { stroke: var(--milo-green-600); }
.milo-sparkline-boon .milo-sparkline-area { fill: rgba(23, 133, 74, 0.10); }

.milo-sparkline-bane .milo-sparkline-line,
.milo-sparkline-bane .milo-sparkline-dot { stroke: var(--milo-danger); }
.milo-sparkline-bane .milo-sparkline-area { fill: rgba(180, 35, 24, 0.08); }


/* =========================================================
   Fuel: where to fuel up (stations ranked by price)
   ========================================================= */

.milo-station-rank {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.milo-station-rank li {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--milo-border);
    border-radius: 10px;
}

.milo-station-rank-1 {
    border-color: var(--milo-green-600) !important;
    background: var(--milo-sage-soft);
}

.milo-station-place {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    color: var(--milo-ink);
    background: var(--milo-surface-soft);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.milo-station-rank-1 .milo-station-place {
    color: #fff;
    background: var(--milo-green-600);
}

.milo-station-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.milo-station-address,
.milo-station-meta {
    color: var(--milo-gray-700);
    font-size: 0.75rem;
}

.milo-station-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-weight: 700;
    font-size: 1.05rem;
}

.milo-station-price small { color: var(--milo-gray-700); font-weight: 500; }

.milo-station-gap {
    color: var(--milo-danger);
    font-size: 0.72rem;
    font-weight: 600;
}

.milo-station-saving {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    background: var(--milo-surface-soft);
    border-radius: 10px;
    font-size: 0.86rem;
}

.milo-station-saving i { font-size: 1.2rem; }

.milo-station-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.milo-station-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    background: var(--milo-surface-soft);
    border: 1px solid var(--milo-border);
    border-radius: 999px;
    font-size: 0.76rem;
}

.milo-station-chip em {
    color: var(--milo-gray-700);
    font-style: normal;
    font-weight: 700;
}

.milo-station-chip b { color: var(--milo-gray-700); font-weight: 600; }

.milo-station-chip.is-best {
    border-color: var(--milo-green-600);
    background: var(--milo-sage-soft);
}

.milo-station-chip.is-best em { color: var(--milo-green-600); }

.milo-station-chip.is-unknown { color: var(--milo-gray-700); font-style: italic; }


/* =========================================================
   Operational Cost: total + categories, what-if scenarios
   ========================================================= */

.milo-cost-overview {
    display: grid;
    grid-template-columns: minmax(240px, 0.8fr) 3fr;
    gap: 1rem;
    align-items: stretch;
}

@media (max-width: 991.98px) {
    .milo-cost-overview { grid-template-columns: 1fr; }
}

/* Not .milo-cost-total: that is the Cockpit's big number, and its
   2rem would reach every line in here */
.milo-cost-sum {
    padding: 1rem 1.1rem;
    color: #fff;
    background: var(--milo-metal), var(--milo-ink);
    border-radius: var(--milo-radius);
    box-shadow: var(--milo-shadow), var(--milo-metal-rim);
}

.milo-cost-sum .text-secondary,
.milo-cost-sum .milo-cost-change span:last-child { color: rgba(255, 255, 255, 0.72) !important; }

.milo-finding-neutral { border-left-color: var(--milo-gray); }

.milo-scenario-effect {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.8rem;
}

/* Radio buttons shown as a segmented control (Vehicle Cost form) */
.milo-segmented-option {
    margin: 0;
    cursor: pointer;
}

.milo-segmented-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.milo-segmented-option span {
    display: inline-flex;
    padding: 0.35rem 0.85rem;
    color: var(--milo-gray-700);
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
}

.milo-segmented-option input:checked + span {
    color: var(--milo-ink);
    background: var(--milo-surface);
    box-shadow: 0 1px 3px rgba(19, 52, 38, 0.12);
}

.milo-segmented-option input:focus-visible + span { outline: 2px solid var(--milo-ink); }

/* A faint line between the kinds, so they read as separate options
   rather than one wide button, as between MILO and its name in the
   header; none beside the picked one, so its pill stays clean */
.milo-segmented-option + .milo-segmented-option {
    position: relative;
}

.milo-segmented-option + .milo-segmented-option::before {
    content: "";

    position: absolute;
    top: 50%;
    left: 0;

    width: 1px;
    height: 1.2rem;

    background: #d5dad6;
    transform: translateY(-50%);
}

.milo-segmented-option:has(input:checked)::before,
.milo-segmented-option:has(input:checked) + .milo-segmented-option::before {
    display: none;
}


/* =========================================================
   RAISED WHITE CONTROLS
   MILO's own white buttons stand up like the Bootstrap ones:
   a face shaded a touch toward the bottom, a lit top edge, a
   green bottom edge and a soft lift (--milo-btn-raised-light).
   Pressed, or chosen (a selected tab or option), they sit in.
   Kept last so it outranks each control's own earlier rule.
   ========================================================= */

.milo-user,
.milo-page-back-arrow,
.milo-icon-link,
.milo-classis-daily-choice,
.milo-status-choice,
.milo-row-go,
.milo-segmented a.active,
.milo-segmented button.active,
.milo-segmented-option input:checked + span {
    background-image: var(--milo-btn-face-light);
    box-shadow: var(--milo-btn-raised-light);
}

/* Their hover colour shows flat, as on the Bootstrap buttons */
.milo-page-back-arrow:hover,
.milo-icon-link:hover,
.milo-status-choice:hover {
    background-image: none;
}

/* Its hover used to swap in the card shadow: stay raised */
.milo-classis-daily-choice:hover {
    box-shadow: var(--milo-btn-raised-light);
}

/* The green "add" choice is raised like the green buttons */
.milo-classis-daily-choice.is-add,
.milo-classis-daily-choice.is-add:hover {
    box-shadow: var(--milo-btn-raised);
}

/* Pressed, and chosen: pushed in */
.milo-user:active,
.milo-page-back-arrow:active,
.milo-icon-link:active,
.milo-classis-daily-choice:active,
.milo-status-choice:active,
.milo-status-choice:has(input:checked),
.milo-row-go:active {
    background-image: none;
    box-shadow: var(--milo-btn-pressed);
}


/* "System:" before a message MILO itself sends (saved, signed in...):
   small, grey and typewriter-like, a quiet note from the server rather
   than part of the sentence */
.milo-system-label {
    margin-right: 0.45rem;

    color: var(--milo-gray-700);
    opacity: 0.75;

    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}


/* =========================================================
   SCHEDULE FORM (create and edit)
   Sections in the order a planner thinks: what and for whom, why,
   when, how. The new schedule's status is shown, not chosen.
   ========================================================= */

.milo-form-section + .milo-form-section {
    margin-top: 1.6rem;
}

.milo-form-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.9rem;

    color: var(--milo-gray-700);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* The section's rule, running out from its name */
.milo-form-section h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--milo-border);
}

.milo-required {
    color: var(--milo-danger);
    font-weight: 700;
}

.milo-schedule-form-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.milo-schedule-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.milo-schedule-status-note {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--milo-gray-700);
    font-size: 0.88rem;
}

.milo-schedule-status-note strong {
    color: var(--milo-ink);
}

/* Planned: not started, nothing wrong */
.milo-status-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--milo-sage-200);
    box-shadow: 0 0 0 3px var(--milo-sage-soft);
}

/* Searchable lists (data-milo-searchable, Tom Select) in MILO's look,
   on every page. The box is the wrapper, which keeps the select's
   .form-select: Bootstrap's border, chevron, small size and red edge
   for a message; Tom Select's theme draws no border on the inside. */
.ts-wrapper.form-select.focus {
    border-color: var(--milo-ink);
    box-shadow: 0 0 0 0.2rem rgba(22, 22, 22, 0.12);
}

.ts-dropdown .active {
    color: var(--milo-ink);
    background: var(--milo-sage-soft);
}

/* A list that offers only some of its options (Fuel's City follows the
   Brand): the ones not on offer aren't shown at all */
[data-milo-hide-disabled] + .ts-wrapper .option.disabled {
    display: none;
}

/* A long choice ("All departments" in a narrow filter) shortens with
   "…" instead of running under the arrow: room for the arrow on the
   right (Tom Select's own sum comes out short here) */
.ts-wrapper.form-select .ts-control {
    padding-right: 2.25rem !important;
}

.ts-wrapper.single .ts-control {
    flex-wrap: nowrap;
    overflow: hidden;
}

.ts-wrapper.single .ts-control > .item {
    min-width: 0;
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The search field takes only the room left over: Tom Select gives it
   min-width 7rem, which joined the box's width on focus and made the
   auto-width Reports filters grow when clicked */
.ts-wrapper.single .ts-control > input {
    flex: 1 1 0;
    min-width: 0;
}

/* While typing, only the search shows: the current choice steps aside
   (the layout's searchable setup marks .is-typing) */
.ts-wrapper.single.is-typing .ts-control > .item {
    display: none;
}


/* A section that opens and closes (x-milo.disclosure): a drawn chevron
   in a soft sage disc in place of the browser's triangle; it turns down
   when open and the content slides in. Tokens only, so the dark theme
   needs nothing extra. */
details.milo-disclosure > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--milo-gray-700);
    font-size: 0.88rem;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

details.milo-disclosure > summary::-webkit-details-marker {
    display: none;
}

.milo-disclosure-disc {
    display: grid;
    place-items: center;
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--milo-cocoa-green);
    background: var(--milo-sage-soft);
    border: 1px solid var(--milo-sage-200);
    border-radius: 50%;
    transition: background-color 0.15s ease;
}

.milo-disclosure-chevron {
    transition: transform 0.2s ease;
}

.milo-disclosure-count {
    color: var(--milo-gray-700);
    font-weight: 400;
}

details.milo-disclosure > summary:hover,
details.milo-disclosure > summary:focus-visible {
    color: var(--milo-cocoa-green);
}

details.milo-disclosure > summary:hover .milo-disclosure-disc {
    background: var(--milo-sage);
}

details.milo-disclosure[open] > summary {
    color: var(--milo-ink);
}

details.milo-disclosure[open] > summary .milo-disclosure-chevron {
    transform: rotate(90deg);
}

details.milo-disclosure[open] > summary ~ * {
    margin-top: 0.6rem;
}

@media (prefers-reduced-motion: no-preference) {
    details.milo-disclosure[open] > summary ~ * {
        animation: milo-disclosure-in 0.2s ease both;
    }
}

@keyframes milo-disclosure-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}


/* The Cockpit's Release & Receipt section (cockpit/partials/custody-review):
   Classis's type chips, a size smaller, over a short list. Tokens only. */
.milo-custody-tabs {
    margin-bottom: 0.6rem;
}

.milo-custody-list .milo-review-row {
    grid-template-columns: 4.2rem minmax(0, 1.3fr) minmax(0, 1fr) auto;
}

/* The end of a short list: "3 more … · Open <module>" (x-milo.list-more) */
.milo-list-more {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    padding: 0.5rem 0.4rem;
    color: var(--milo-gray-700);
    font-size: 0.78rem;
    text-decoration: none;
}

.milo-list-more:hover {
    color: var(--milo-cocoa-green);
}

/* Under a table, as the card's footer */
.card-footer.milo-list-more {
    padding: 0.65rem 1rem;
}

/* The compact one (x-milo.list-more compact): a MILO button on the
   right, "More insights" with how many more in a pill that turns light
   green with the button */
.milo-list-more-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.6rem;
}

.milo-more-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    font-weight: 500;
}

.milo-more-count {
    min-width: 1.6rem;
    height: 1.3rem;
    padding: 0 0.45rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: var(--milo-green-850);
    background: var(--milo-sage-soft);
    border-radius: 999px;

    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.milo-more-button:hover .milo-more-count,
.milo-more-button:focus-visible .milo-more-count {
    color: var(--milo-ink);
    background: var(--milo-sage-200);
}

/* Phones: thumb-sized */
@media (max-width: 575.98px) {
    .milo-more-button {
        min-height: 44px;
    }
}


/* =========================================================
   WRAPPED CHIPS
   A chip whose words run onto a second line (.is-wrapped, set
   by the layout's script) would stretch its pill into an oval.
   It becomes a rounded box instead, with squircle corners where
   the browser can draw them. Chips on one line stay pills, and
   nothing else uses squircle corners.
   ========================================================= */

.milo-chip.is-wrapped {
    border-radius: 0.85rem;
}

@supports (corner-shape: squircle) {
    .milo-chip.is-wrapped {
        corner-shape: squircle;
    }
}


/* =========================================================
   REQUEST FORM PLANNER
   Beside the Request Form: planning tips, the department's
   mini calendar with its day and remarks, and the person's
   own notes. Tokens only, so the dark theme needs nothing.
   ========================================================= */

@media (min-width: 1200px) {
    .milo-planner {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* Tips: one line each, coloured like the chips */
.milo-plan-tips {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}

.milo-plan-tips li {
    display: flex;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--milo-border);
    border-radius: 8px;
    background: var(--milo-surface-soft);
}

.milo-plan-tips li.is-green { border-color: #bbf7d0; background: color-mix(in srgb, #22c55e 8%, var(--milo-surface)); }
.milo-plan-tips li.is-green i { color: var(--milo-green-600); }
.milo-plan-tips li.is-amber { border-color: #fde68a; background: color-mix(in srgb, #f59e0b 9%, var(--milo-surface)); }
.milo-plan-tips li.is-amber i { color: #b45309; }
.milo-plan-tips li.is-red { border-color: #f6c4bf; background: color-mix(in srgb, #ef4444 8%, var(--milo-surface)); }
.milo-plan-tips li.is-red i { color: var(--milo-danger); }
.milo-plan-tips li.is-info i { color: var(--milo-sky); }

/* The month: seven columns, Monday first */
.milo-mini-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.milo-mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
}

.milo-mini-cal-dow {
    padding-bottom: 0.25rem;
    color: var(--milo-gray);
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.milo-mini-cal-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 2.4rem;
    padding: 0.25rem 0 0.2rem;
    color: var(--milo-ink);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.8rem;
}

.milo-mini-cal-day:hover,
.milo-mini-cal-day:focus-visible {
    background: var(--milo-surface-soft);
    border-color: var(--milo-border);
    outline: none;
}

.milo-mini-cal-day.is-past { color: var(--milo-gray); }
.milo-mini-cal-day.is-off { color: var(--milo-gray); background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--milo-border) 60%, transparent) 4px 5px); }
.milo-mini-cal-day.is-today span:first-child { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.milo-mini-cal-day.is-selected { color: var(--milo-green-950); background: var(--milo-sage-200); border-color: var(--milo-sage-200); }

.milo-mini-cal-dots {
    display: flex;
    gap: 2px;
    height: 5px;
}

.milo-mini-cal-dots i,
.milo-mini-cal-key i {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.milo-mini-cal-dots .is-schedule,
.milo-mini-cal-key .is-schedule { background: var(--milo-green-600); }
.milo-mini-cal-dots .is-request,
.milo-mini-cal-key .is-request { background: var(--milo-sky); }
.milo-mini-cal-dots .is-note,
.milo-mini-cal-key .is-note { background: #d97706; }

.milo-mini-cal-key {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    color: var(--milo-gray-700);
    font-size: 0.72rem;
}

.milo-mini-cal-key span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* The picked day: what's on it, and its remarks */
.milo-mini-day {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--milo-border);
}

.milo-mini-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.milo-mini-day-off {
    margin-bottom: 0.5rem;
    color: var(--milo-gray-700);
    font-size: 0.8rem;
}

.milo-mini-item {
    margin-bottom: 0.5rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--milo-border);
    border-left: 3px solid var(--milo-green-600);
    border-radius: 8px;
    font-size: 0.86rem;
}

.milo-mini-item.is-request { border-left-color: var(--milo-sky); }
.milo-mini-item.is-note { border-left-color: #d97706; font-size: 0.82rem; }

.milo-remarks {
    margin: 0.45rem 0 0;
    padding: 0;
    list-style: none;
}

.milo-remarks li {
    display: flex;
    flex-direction: column;
    padding: 0.35rem 0;
    border-top: 1px dashed var(--milo-border);
    font-size: 0.8rem;
}

.milo-remarks li p {
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.milo-remarks li span {
    color: var(--milo-gray-700);
    font-size: 0.72rem;
}

.milo-remark-add {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

/* My notes: tick, text, actions */
.milo-notes {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.85rem 0 0;
    padding: 0;
    list-style: none;
}

.milo-notes li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--milo-border);
    border-radius: 8px;
    font-size: 0.85rem;
}

.milo-notes li.is-done .milo-note-text {
    color: var(--milo-gray);
    text-decoration: line-through;
}

.milo-note-text {
    flex: 1;
    min-width: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.milo-note-text small {
    display: block;
    color: var(--milo-gray-700);
    font-size: 0.72rem;
}

.milo-note-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}


/* =========================================================
   GLASS
   See-through, with the page blurred behind it, like the top
   bar. On what floats over the content (the name menu, the
   sidebar menus, card breakdowns, hover details, searchable
   lists, the Activity Center jump, the cancelled reminder on
   Schedules & Trips and its list) and on the schedule page's
   Latest trips window, which looks out over the page like a
   window. Solid where the browser can't blur, or when the
   person asked for less see-through. --milo-glass is a token,
   so the dark theme switches it in milo-dark.css.
   ========================================================= */

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {

    .milo-today-panel,
    .milo-user-menu,
    .milo-flyout,
    .milo-kpi-breakdown-panel,
    .milo-activity-jump,
    .milo-cancel-list,
    .ts-wrapper .ts-dropdown {
        background: var(--milo-glass);
        -webkit-backdrop-filter: saturate(160%) blur(12px);
        backdrop-filter: saturate(160%) blur(12px);
    }

    .milo-detail-popover {
        --bs-popover-bg: var(--milo-glass);
        -webkit-backdrop-filter: saturate(160%) blur(12px);
        backdrop-filter: saturate(160%) blur(12px);
    }

    /* The name and bell menus open inside the top bar, itself glass: a
       blur inside a blur can't reach the page below, so they stay
       solid, or what's under them (the weather card) reads through
       their words */
    .milo-user-menu {
        background: var(--milo-surface);
    }

}

@media (prefers-reduced-transparency: reduce) {

    .milo-today-panel,
    .milo-user-menu,
    .milo-flyout,
    .milo-kpi-breakdown-panel,
    .milo-activity-jump,
    .milo-cancel-list,
    .ts-wrapper .ts-dropdown {
        background: var(--milo-surface);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .milo-detail-popover {
        --bs-popover-bg: var(--milo-surface);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

}


/* =========================================================
   PRESS NUDGE
   Press a row in a stacked list and it slides along; the rows
   either side follow a little (:has(+ …:active) reaches the one
   above, + the one below), springing back on release. On the
   Latest trips window, the Schedules calendar (its chips in a
   day, its list rows) and the bell's approvals. Still for
   reduced motion.
   ========================================================= */

.milo-today-list > li,
.milo-calendar .fc-daygrid-event-harness,
.milo-calendar .fc-list-event,
.milo-bell-menu > .dropdown-item {
    transition: translate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Only where motion is welcome: a "still" rule for reduced motion lost
   to :active (more specific), so pressed rows still jumped, unslid */
@media (prefers-reduced-motion: no-preference) {

    .milo-today-list > li:active,
    .milo-calendar .fc-daygrid-event-harness:active,
    .milo-calendar .fc-list-event:active,
    .milo-bell-menu > .dropdown-item:active {
        translate: 12px 0;
    }

    .milo-today-list > li:has(+ li:active),
    .milo-today-list > li:active + li,
    .milo-bell-menu > .dropdown-item:has(+ .dropdown-item:active),
    .milo-bell-menu > .dropdown-item:active + .dropdown-item,
    .milo-calendar .fc-daygrid-event-harness:has(+ .fc-daygrid-event-harness:active),
    .milo-calendar .fc-daygrid-event-harness:active + .fc-daygrid-event-harness,
    .milo-calendar .fc-list-event:has(+ .fc-list-event:active),
    .milo-calendar .fc-list-event:active + .fc-list-event {
        translate: 4px 0;
    }

}

@media (prefers-reduced-motion: reduce) {

    .milo-today-list > li,
    .milo-calendar .fc-daygrid-event-harness,
    .milo-calendar .fc-list-event,
    .milo-bell-menu > .dropdown-item {
        transition: none;
    }

}

/* Pointing at a row nudges it the same way (with a mouse; a tap on a
   touch screen would leave it slid), so it's clear which record you're
   on. Everywhere: Latest trips, the bell's list and the Schedules
   calendar (its list rows; a chip in a day half as far, 6 px, so it
   never covers the next day's chips, and pressing still pushes it the
   whole way). And on every page of the Command Center, Operations and
   Transport (the layout marks them data-milo-hover-nudge; never
   Intelligence or Governance), a row you can open or act on (a link, or
   one with a link or button in it): a table's rows, the lanes' cards
   (inside their lane's padding), the hover panels' lines, the Cockpit's
   review and condition rows, Classis's items, and the Requests planner's
   day cards (one you're typing a remark in stays put) and notes. A row
   with nothing to click (an insight, a count, a cost line) stays still.
   The ones either side follow a row you can click (never one you
   can't: pointing at a plain row moves nothing). A table's rows slide only while it
   fits its box (the layout's script marks it .is-roomy, clipped then,
   so a row never scrolls it sideways); its last column keeps room for
   the slide, and a hover panel never scrolls sideways. Classis's vehicle
   cards keep their own grow, and a job's timeline its line. Still for
   reduced motion and Calm motion. */
[data-milo-hover-nudge] :is(
    .table-responsive > table > tbody > tr,
    .milo-breakdown-row,
    .milo-review-row,
    .milo-condition-list > .milo-condition,
    .milo-classis-item,
    .milo-mini-day > .milo-mini-item,
    .milo-notes > li
) {
    transition: translate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* The lanes' cards keep their own border and shadow fade */
[data-milo-hover-nudge] .milo-classis-lane > .milo-classis-trip {
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        translate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-milo-hover-nudge] .table-responsive.is-roomy {
    overflow-x: clip;
}

[data-milo-hover-nudge] .table-responsive > table > :is(thead, tbody) > tr > :last-child {
    padding-right: calc(0.5rem + 12px);
}

[data-milo-hover-nudge] .milo-kpi-breakdown-panel {
    overflow-x: hidden;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {

    html:not([data-milo-calm]) :is(
        .milo-today-list > li,
        .milo-bell-menu > .dropdown-item,
        .milo-calendar .fc-list-event
    ):hover,
    html:not([data-milo-calm]) [data-milo-hover-nudge] :is(
        .table-responsive.is-roomy > table > tbody > tr,
        .milo-classis-lane > .milo-classis-trip,
        .milo-breakdown-row,
        .milo-review-row,
        .milo-condition-list > .milo-condition,
        .milo-classis-item,
        .milo-mini-day > .milo-mini-item:not(:focus-within),
        .milo-notes > li
    ):is(a, button, :has(a, button)):hover {
        /* Over its neighbours too: the slide makes each row its own layer,
           and the next one (sliding a little) painted over this row's hover
           note (Cockpit's Release & Receipt list) */
        position: relative;
        z-index: 1;

        translate: 12px 0;
    }

    html:not([data-milo-calm]) .milo-calendar .fc-daygrid-event-harness:hover:not(:active) {
        translate: 6px 0;
    }

    html:not([data-milo-calm]) .milo-calendar .fc-daygrid-event-harness:has(+ .fc-daygrid-event-harness:hover:not(:active)),
    html:not([data-milo-calm]) .milo-calendar .fc-daygrid-event-harness:hover:not(:active) + .fc-daygrid-event-harness {
        translate: 2px 0;
    }

    /* The ones either side: above (:has(+ …:hover)) and below (+) */
    html:not([data-milo-calm]) :is(
        .milo-today-list > li:has(+ li:hover),
        .milo-today-list > li:hover + li,
        .milo-bell-menu > .dropdown-item:has(+ .dropdown-item:hover),
        .milo-bell-menu > .dropdown-item:hover + .dropdown-item,
        .milo-calendar .fc-list-event:has(+ .fc-list-event:hover),
        .milo-calendar .fc-list-event:hover + .fc-list-event
    ),
    html:not([data-milo-calm]) [data-milo-hover-nudge] :is(
        .table-responsive.is-roomy > table > tbody > tr:has(+ tr:hover :is(a, button)),
        .table-responsive.is-roomy > table > tbody > tr:has(a, button):hover + tr,
        .milo-classis-lane > .milo-classis-trip:has(+ .milo-classis-trip:hover),
        .milo-classis-lane > .milo-classis-trip:hover + .milo-classis-trip,
        .milo-breakdown-row:has(+ a.milo-breakdown-row:hover),
        .milo-breakdown-row:has(+ .milo-breakdown-row:hover :is(a, button)),
        .milo-breakdown-row:is(a, :has(a, button)):hover + .milo-breakdown-row,
        .milo-review-row:has(+ .milo-review-row:hover),
        .milo-review-row:hover + .milo-review-row,
        .milo-condition-list > .milo-condition:has(+ .milo-condition:hover :is(a, button)),
        .milo-condition-list > .milo-condition:has(a, button):hover + .milo-condition,
        .milo-classis-item:has(+ .milo-classis-item:hover),
        .milo-classis-item:hover + .milo-classis-item,
        .milo-mini-day > .milo-mini-item:has(+ .milo-mini-item:hover:not(:focus-within) :is(a, button)),
        .milo-mini-day > .milo-mini-item:has(a, button):hover:not(:focus-within) + .milo-mini-item,
        .milo-notes > li:has(+ li:hover :is(a, button)),
        .milo-notes > li:has(a, button):hover + li
    ) {
        translate: 4px 0;
    }

}


/* =========================================================
   LANDING NUDGE
   A link to one record (#vehicle-3, #trip-12) lands on it and
   the record slides as a pressed row does, twice, the records
   either side following a little, so the eye finds which one
   the link opened. Set by the layout's script; classes, not an
   animation, so a record's own :target highlight still plays.
   Nothing slides sideways out of its box. Still for reduced
   motion.
   ========================================================= */

.milo-arriving {
    transition: translate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.milo-arriving.milo-arrived {
    translate: 14px 0;
}

.milo-arriving.milo-arrived-near {
    translate: 4px 0;
}

.milo-content:has(.milo-arriving),
.table-responsive:has(.milo-arriving) {
    overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {

    .milo-arriving,
    .milo-arriving.milo-arrived,
    .milo-arriving.milo-arrived-near {
        transition: none;
        translate: none;
    }

}


/* =========================================================
   LANDING QUAKE
   A list marked data-milo-nudge-style="quake" (Requests' "N
   requests need your action") greets you with its records
   shaking side to side together, hard at first and dying down,
   as the ground does in a quake: once, 0.9 s, over an amber
   wash that fades by 1.6 s. Set by the layout's LANDING NUDGE
   script. Reduced motion: the wash alone. Calm motion: the
   sage band, as any landing.
   ========================================================= */

@keyframes milo-quake {
    0%   { translate: 0 0; }
    6%   { translate: -10px 1px; }
    12%  { translate: 10px -1px; }
    18%  { translate: -10px 1px; }
    24%  { translate: 9px 0; }
    30%  { translate: -9px -1px; }
    36%  { translate: 8px 1px; }
    44%  { translate: -7px 0; }
    52%  { translate: 6px -1px; }
    60%  { translate: -5px 1px; }
    68%  { translate: 4px 0; }
    76%  { translate: -3px 0; }
    84%  { translate: 2px 0; }
    92%  { translate: -1px 0; }
    100% { translate: 0 0; }
}

@keyframes milo-quake-wash {
    0%, 70% { background-color: rgba(233, 167, 72, 0.16); }
    100% { background-color: transparent; }
}

.milo-quaking {
    animation: milo-quake 0.9s linear, milo-quake-wash 1.6s ease-out;
}

/* A table's cells paint over their row: the wash goes on them too */
.milo-quaking > td {
    animation: milo-quake-wash 1.6s ease-out;
}

.milo-content:has(.milo-quaking),
.table-responsive:has(.milo-quaking) {
    overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {

    .milo-quaking {
        animation: milo-quake-wash 1.6s ease-out;
    }

}

/* "N requests need your action" as a link: the amber chip, a
   pointer, an arrow that nudges on hover; ringed while its list
   is the one shown */
a.milo-chip-link {
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

a.milo-chip-link:hover,
a.milo-chip-link:focus-visible {
    filter: brightness(0.96);
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25);
}

a.milo-chip-link.is-on {
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.45);
}

.milo-chip-link-arrow {
    transition: translate 0.15s ease;
}

a.milo-chip-link:hover .milo-chip-link-arrow {
    translate: 3px 0;
}


/* =========================================================
   PAGE GUIDE (x-milo.page-guide)
   A how-to in Latest trips' window. Minimized, its icon does
   the bell's snooze (colours flow as it squishes, then 5 s of
   rest) to say "open me"; opened, a numbered list that scrolls.
   ========================================================= */

.milo-guide {
    --milo-guide-amber: #d97706;

    width: 360px;
    max-width: 100%;
}

.milo-guide .milo-today-bar {
    cursor: pointer;
}

.milo-guide-icon {
    font-size: 1rem;
}

.milo-guide.is-minimized .milo-guide-icon::before {
    background: linear-gradient(90deg, var(--milo-green-600), var(--milo-sage-200), var(--milo-guide-amber), var(--milo-green-600));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: milo-bell-rest-5 8.2s ease-in-out infinite, milo-bell-squish-5 8.2s ease-out infinite;
}

.milo-guide .milo-today-count {
    white-space: nowrap;
}

.milo-guide-hint {
    margin-left: auto;

    color: var(--milo-gray-700);

    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
}

.milo-guide:not(.is-minimized) .milo-guide-hint {
    display: none;
}

.milo-guide .milo-today-toggle {
    margin-left: 0;
}

/* Opened: maximize, then minimize, at the right of the title bar */
.milo-guide-max {
    display: none;
}

.milo-guide:not(.is-minimized) .milo-guide-max {
    display: flex;
    margin-left: auto;
}

/* Its place in the header is the title bar's height (the bar's padding,
   its 28 px buttons and the border), so the opened steps cover the page
   below instead of pushing it down; over the page, under the top bar */
.milo-guide-slot {
    position: relative;

    width: 360px;
    max-width: 100%;
    height: calc(1.1rem + 30px);

    flex-shrink: 0;
}

.milo-guide-slot > .milo-guide {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 90;
}

.milo-guide:not(.is-minimized) {
    box-shadow: var(--milo-shadow-lg);
}

/* Maximized: half the screen, half its width and half its height, at
   the top right under the top bar; never the whole screen */
.milo-guide-slot > .milo-guide.is-maximized {
    position: fixed;
    top: calc(64px + 1rem);
    right: 1rem;
    z-index: 95;

    width: min(calc(100vw - 2rem), max(360px, 50vw));
}

.milo-guide.is-maximized .milo-guide-steps {
    max-height: calc(50vh - 3rem);
}

.milo-guide-steps {
    max-height: 340px;
    overflow-y: auto;

    margin: 0;
    padding: 0 0.25rem;

    list-style: none;
    counter-reset: step;
}

.milo-guide-steps li {
    display: grid;
    grid-template-columns: 1.6rem 1fr;
    gap: 0.5rem;

    padding: 0.5rem 0;

    border-bottom: 1px solid var(--milo-border);

    font-size: 0.84rem;
    line-height: 1.45;

    counter-increment: step;
}

.milo-guide-steps li:last-child {
    border-bottom: 0;
}

.milo-guide-steps li::before {
    content: counter(step);

    width: 1.45rem;
    height: 1.45rem;

    display: grid;
    place-items: center;

    color: var(--milo-green-850);
    background: var(--milo-sage-soft);
    border-radius: 50%;

    font-size: 0.72rem;
    font-weight: 700;
}

.milo-guide-steps li.is-tip::before {
    content: "!";

    color: #8a5a12;
    background: rgba(233, 167, 72, 0.2);
}

.milo-guide-steps strong {
    display: block;

    font-weight: 600;
}

.milo-guide-steps span {
    color: var(--milo-gray-700);
}

@media (prefers-reduced-motion: reduce) {
    .milo-guide.is-minimized .milo-guide-icon::before {
        animation: none;
    }
}


/* =========================================================
   DATE RANGE (x-milo.date-range)
   One box that reads the range in words and opens a small
   calendar: quick ranges on the left, the month on the right;
   the first and last day picked, the days between lit.
   ========================================================= */

.milo-date-range {
    position: relative;
}

.milo-date-range-box {
    display: flex;
    align-items: center;
    gap: 0.55rem;

    text-align: left;
    cursor: pointer;
}

.milo-date-range-box > span {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.milo-date-range-box > i:last-child {
    margin-left: auto;

    color: var(--milo-gray-700);
}

.milo-date-range-pop {
    position: absolute;
    z-index: 1060;
    top: calc(100% + 0.4rem);
    left: 0;

    display: flex;
    gap: 1rem;

    padding: 0.9rem;

    background: var(--milo-surface);
    border: 1px solid var(--milo-border);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(5, 45, 33, 0.22);
}

.milo-date-range-pop[hidden] {
    display: none;
}

.milo-date-range-presets {
    display: grid;
    align-content: start;
    gap: 0.2rem;

    min-width: 8.5rem;
    padding-right: 0.8rem;

    border-right: 1px solid var(--milo-border);
}

.milo-date-range-presets button,
.milo-date-range-head button,
.milo-date-range-grid button {
    color: var(--milo-ink);
    background: none;
    border: 0;
    border-radius: 8px;
}

.milo-date-range-presets button {
    padding: 0.3rem 0.5rem;

    font-size: 0.85rem;
    text-align: left;
}

.milo-date-range-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 0.4rem;

    font-size: 0.9rem;
    font-weight: 600;
}

.milo-date-range-head button {
    width: 2rem;
    height: 2rem;
}

.milo-date-range-presets button:hover,
.milo-date-range-head button:hover,
.milo-date-range-grid button:hover {
    background: var(--milo-surface-soft);
}

.milo-date-range-grid {
    display: grid;
    grid-template-columns: repeat(7, 2.1rem);
    gap: 2px;
}

.milo-date-range-grid .is-weekday {
    padding-bottom: 0.2rem;

    color: var(--milo-gray-700);

    font-size: 0.68rem;
    text-align: center;
}

.milo-date-range-grid button {
    height: 2.1rem;

    font-size: 0.82rem;
}

.milo-date-range-grid button.is-in {
    background: rgba(157, 213, 174, 0.28);
    border-radius: 0;
}

.milo-date-range-grid button.is-end {
    color: #ffffff;
    background: var(--milo-green-600);
}

.milo-date-range-grid button.is-today {
    box-shadow: inset 0 0 0 1px var(--milo-sage-200);
}

.milo-date-range-grid button:disabled {
    opacity: 0.3;
}

.milo-date-range-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;

    margin-top: 0.6rem;

    color: var(--milo-gray-700);

    font-size: 0.78rem;
}

.milo-date-range-foot > span:last-child {
    display: flex;
    align-items: center;
    gap: 0.25rem;

    white-space: nowrap;
}

/* A phone: the quick ranges above the month */
@media (max-width: 575.98px) {
    .milo-date-range-pop {
        flex-direction: column;
    }

    .milo-date-range-presets {
        display: flex;
        flex-wrap: wrap;

        padding: 0 0 0.6rem;

        border-right: 0;
        border-bottom: 1px solid var(--milo-border);
    }
}


/* =========================================================
   OUTSIDE TRANSPORT
   Why a Lalamove or Hauling job went outside the company fleet:
   MILO's check of the fleet that day on the job's form and page
   (.milo-fleet-check, verdict ok / off / plain), and Classis's
   "Why work went outside the fleet" (.milo-outside-*). A reason
   that doesn't match is amber (worth a look), never red.
   ========================================================= */

.milo-fleet-check {
    padding: 0.7rem 0.85rem;

    border: 1px dashed var(--milo-border);
    border-radius: 0.7rem;

    font-size: 0.84rem;
}

.milo-fleet-check.is-plain {
    padding: 0;

    border: 0;
}

.milo-fleet-check-title {
    margin-bottom: 0.35rem;

    color: var(--milo-gray-700);

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.milo-fleet-check-title i {
    margin-right: 0.25rem;
}

.milo-fleet-check-title span {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.milo-fleet-check-lines {
    margin: 0;
    padding-left: 1.1rem;
}

.milo-fleet-check-verdict {
    margin-top: 0.45rem;

    font-weight: 600;
}

.milo-fleet-check-verdict.is-ok {
    color: var(--milo-green-600);
}

.milo-fleet-check-verdict.is-off {
    color: var(--milo-warning);
}

.milo-fleet-check-verdict.is-plain {
    color: var(--milo-gray-700);

    font-weight: 500;
}

.milo-outside-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 0.86rem;
}

.milo-outside-table th {
    padding: 0 0.5rem 0.45rem;

    border-bottom: 1px solid var(--milo-border);
    color: var(--milo-gray-700);

    font-size: 0.72rem;
    font-weight: 600;
    text-align: left;
}

.milo-outside-table td {
    padding: 0.6rem 0.5rem;

    border-bottom: 1px solid var(--milo-border);

    vertical-align: middle;
}

.milo-outside-table tr:last-child td {
    border-bottom: 0;
}

.milo-outside-table .milo-meter {
    width: 110px;
}

.milo-outside-reason {
    font-weight: 600;
}

.milo-outside-reason small {
    display: block;

    color: var(--milo-gray-700);

    font-size: 0.74rem;
    font-weight: 400;
}

.milo-outside-count {
    width: 3rem;

    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.milo-outside-check {
    color: var(--milo-gray-700);

    font-size: 0.8rem;
}

.milo-outside-check > span {
    display: block;
}

.milo-outside-check i {
    margin-right: 0.25rem;
}

.milo-outside-check .is-ok {
    color: var(--milo-green-600);
}

.milo-outside-check .is-off {
    color: var(--milo-warning);
}

.milo-outside-see {
    font-size: 0.76rem;
    white-space: nowrap;
}

.milo-outside-mismatch {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;

    margin-top: 0.9rem;
    padding: 0.65rem 0.8rem;

    border: 1px solid rgba(233, 167, 72, 0.35);
    border-radius: 0.7rem;
    background: rgba(233, 167, 72, 0.12);

    font-size: 0.83rem;
}

.milo-outside-mismatch > i {
    color: var(--milo-warning);

    font-size: 1rem;
    line-height: 1.2;
}

.milo-outside-mismatch ul {
    margin: 0.35rem 0 0.25rem;
    padding-left: 1.1rem;
}

.milo-outside-routes {
    margin-top: 1rem;
}

.milo-outside-routes-title {
    margin-bottom: 0.4rem;

    color: var(--milo-gray-700);

    font-size: 0.78rem;
    font-weight: 700;
}

.milo-outside-routes-title span {
    font-weight: 400;
}

.milo-outside-route {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(0, 1.2fr) minmax(0, 1.5fr);
    gap: 0.25rem 1rem;

    padding: 0.5rem 0;

    border-top: 1px solid var(--milo-border);

    font-size: 0.84rem;
}

.milo-outside-route i {
    margin-right: 0.25rem;

    color: var(--milo-gray-700);
}

@media (max-width: 575.98px) {
    .milo-outside-route {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* =========================================================
   CALM MOTION
   The switch in My Profile (Display), kept by this browser like
   Lights: theme-head sets html[data-milo-calm] before anything is
   drawn. Same place, same colour, standing still: a running light
   becomes a still green ring, a bubble keeps its number without
   the pulse, sections open at once, nothing slides or wobbles.
   The bell and the Requests tabs' waiting icons keep their snooze:
   they ask for a decision. Where the slide itself was the message
   (a link landing on a record), a sage band marks the record for
   3 s, then fades (the layout's LANDING NUDGE script). A device set
   to reduce motion keeps what it does today.
   ========================================================= */

html[data-milo-calm] {
    --milo-landed-bg: var(--milo-sage-soft);
    --milo-landed-edge: var(--milo-green-600);
}

/* Top bar title: the page title and MILO's meaning swap with a fade,
   no slide (TOP BAR TITLE) */
@supports (animation-timeline: scroll()) and (animation-range: 0px 1px) {

    html[data-milo-calm] .milo-app-swap:has(.milo-app-page) > .milo-app-meaning {
        animation-name: milo-app-meaning-fade;
    }

    html[data-milo-calm] .milo-app-page {
        animation-name: milo-app-page-fade;
    }

}

/* Create button: it appears, folds and opens at once (CREATE BUTTON) */
html[data-milo-calm] :is(.milo-fab, .milo-fab-button, .milo-fab-label) {
    transition: none;
}

/* Form names rise and boxes underline at once (FLOATING LABELS) */
html[data-milo-calm] :is(.milo-content, .milo-auth-card) form[method="post" i] :is(.form-label, .form-control, .form-select) {
    transition: none;
}

/* Running lights: the green light stands still all round the edge */
html[data-milo-calm] :is(.milo-running, .milo-live.is-moving)::before,
html[data-milo-calm] .milo-calendar .milo-event.milo-on-road:not(.fc-list-event)::after,
html[data-milo-calm] .milo-calendar tr.milo-on-road::after,
html[data-milo-calm] .milo-badge.milo-on-road::after,
html[data-milo-calm] .milo-trip-card.milo-on-road::after {
    animation: none;
    background: #1f9d55;
}

html[data-milo-calm] .milo-rail-icon.milo-running::before {
    background: #7ee2a8;
}

/* Count bubbles: the number stays, the ring stops pulsing */
html[data-milo-calm] .milo-bubble {
    animation: none;
}

/* Wave rings: the share stays, the wave stops drifting, no flash */
html[data-milo-calm] .milo-wave-ring::before,
html[data-milo-calm] .milo-wave-ring.is-flash {
    animation: none;
}

/* Pointing at an icon: its colour answers, nothing wobbles (the bell keeps its own) */
html[data-milo-calm] :is(.milo-icon-link, .milo-trend-card-go, .milo-row-go, .milo-theme-toggle):not(.milo-bell .milo-theme-toggle) > i::before,
html[data-milo-calm] .milo-classis-tile .milo-next-icon > i::before,
html[data-milo-calm] .milo-page-back-arrow > .milo-back-arrow-svg {
    animation: none !important;
    transition: none;
}

/* A trip's or job's corner icon fills at once, without rising */
html[data-milo-calm] .milo-classis-trip .milo-next-icon.milo-water-icon {
    transition: none;
}

/* The Activity Center's water: its level stays, the wave stops drifting */
html[data-milo-calm] .milo-water-icon > :is(.milo-water, .milo-water-wet) {
    animation: none;
}

/* Long names: no slide; the layout's script puts the full name in a
   hover note. A device set to reduce motion wraps the name instead */
@media (prefers-reduced-motion: no-preference) {
    html[data-milo-calm] .milo-marquee:is(:hover, :focus-within),
    html[data-milo-calm] a:is(:hover, :focus-visible) > .milo-marquee {
        mask-image: linear-gradient(to right, #000 calc(100% - 1.25rem), transparent);
    }

    html[data-milo-calm] .milo-marquee:is(:hover, :focus-within) > *,
    html[data-milo-calm] a:is(:hover, :focus-visible) > .milo-marquee > * {
        animation: none;
    }
}

/* Classis daily check due: the amber icon, still */
html[data-milo-calm] .milo-classis-daily.is-due .milo-classis-daily-icon {
    animation: none;
}

/* The page guide's icon: MILO's colours, still; "Open me" stays */
html[data-milo-calm] .milo-guide.is-minimized .milo-guide-icon::before {
    animation: none;
    background-position: 40% 0;
}

/* Loading: dimmed and still; the words say it */
html[data-milo-calm] .milo-loading,
html[data-milo-calm] .milo-day-card[data-state="loading"] .milo-day-now,
html[data-milo-calm] .milo-report-loading .milo-report-toolbar ~ * :is(.card-body, .milo-report-stat) {
    animation: none;
    background-image: none;
    opacity: 0.65;
}

/* Sections, menus and windows open and close at once */
html[data-milo-calm] details.milo-disclosure[open] > summary ~ * {
    animation: none;
}

html[data-milo-calm] :is(
    [aria-expanded] > .bi-chevron-down,
    .milo-disclosure-chevron,
    .milo-today-panel,
    .milo-today-alert,
    .milo-activity-jump,
    .milo-flyout,
    .milo-flyout-group > .milo-flyout-link,
    .milo-flyout-sub,
    .milo-flyout-sub .milo-flyout-link,
    .milo-flyout-count,
    .milo-flyout-count i,
    .milo-ring
),
html[data-milo-calm] .milo-rail-nav.has-spot.is-ready::after {
    transition: none;
}

/* A pressed row stays put */
html[data-milo-calm] :is(
    .milo-today-list > li,
    .milo-calendar .fc-daygrid-event-harness,
    .milo-calendar .fc-list-event,
    .milo-bell-menu > .dropdown-item
) {
    transition: none;
    translate: none;
}

/* Landing on a record: a sage band with a green edge, then it fades */
html[data-milo-calm] .milo-landing,
html[data-milo-calm] tr.milo-landing > :is(td, th) {
    transition: background-color 0.6s ease, box-shadow 0.6s ease;
}

html[data-milo-calm] .milo-landing.milo-landed:not(tr) {
    background-color: var(--milo-landed-bg);
    box-shadow: inset 3px 0 0 var(--milo-landed-edge);
    transition: none;
}

/* A table row: Bootstrap paints its cells with an inset shadow */
html[data-milo-calm] tr.milo-landing.milo-landed > :is(td, th) {
    box-shadow: inset 0 0 0 9999px var(--milo-landed-bg);
    transition: none;
}

html[data-milo-calm] tr.milo-landing.milo-landed > :is(td, th):first-child {
    box-shadow: inset 3px 0 0 var(--milo-landed-edge), inset 0 0 0 9999px var(--milo-landed-bg);
}
