/* Emto portal theme, on top of Bootstrap 5.3 (light and dark via data-bs-theme) */

:root {
    --emto-navy: #0b2234;
    --emto-navy-2: #12385a;
    --emto-green: #16a34a;
    --emto-green-strong: #15803d;
    --emto-green-bright: #22c55e;
    --emto-green-soft: rgba(22, 163, 74, .12);
    --portal-radius: 16px;
    --portal-radius-sm: 10px;
    --portal-sidebar-width: 264px;
    --portal-topbar-height: 64px;
    --portal-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
    --portal-shadow-lg: 0 16px 48px rgba(11, 34, 52, .22);
    --bs-body-font-family: "Inter", "Segoe UI Variable Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-border-radius: .625rem;
    --bs-border-radius-sm: .5rem;
    --bs-border-radius-lg: .875rem;
    --bs-primary: var(--emto-green);
    --bs-primary-rgb: 22, 163, 74;
    --bs-focus-ring-color: rgba(22, 163, 74, .25);
}

[data-bs-theme=light] {
    --bs-body-bg: #f4f6fa;
    --bs-body-bg-rgb: 244, 246, 250;
    --bs-body-color: #1f2937;
    --bs-secondary-color: #6b7280;
    --bs-border-color: #e6e8ee;
    --bs-link-color: var(--emto-green-strong);
    --bs-link-color-rgb: 21, 128, 61;
    --bs-link-hover-color: #166534;
    --portal-surface: #ffffff;
    --portal-surface-2: #f6f7fa;
    --portal-topbar-bg: rgba(244, 246, 250, .82);
}

[data-bs-theme=dark] {
    --bs-body-bg: #0a1120;
    --bs-body-bg-rgb: 10, 17, 32;
    --bs-body-color: #e5e7eb;
    --bs-secondary-color: #94a3b8;
    --bs-border-color: #1e293b;
    --bs-link-color: #4ade80;
    --bs-link-color-rgb: 74, 222, 128;
    --bs-link-hover-color: #86efac;
    --portal-surface: #111a2c;
    --portal-surface-2: #16213a;
    --portal-topbar-bg: rgba(10, 17, 32, .78);
}

body {
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.005em;
}

h1:focus, h1:focus-visible {
    outline: none;
}

.min-w-0 {
    min-width: 0;
}

/* Buttons */
.btn {
    --bs-btn-font-weight: 600;
    border-radius: var(--portal-radius-sm);
}

.btn-primary {
    --bs-btn-bg: var(--emto-green);
    --bs-btn-border-color: var(--emto-green);
    --bs-btn-hover-bg: var(--emto-green-strong);
    --bs-btn-hover-border-color: var(--emto-green-strong);
    --bs-btn-active-bg: #166534;
    --bs-btn-active-border-color: #166534;
    --bs-btn-disabled-bg: var(--emto-green);
    --bs-btn-disabled-border-color: var(--emto-green);
    --bs-btn-focus-shadow-rgb: 22, 163, 74;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bs-border-color);
    background: var(--portal-surface);
    color: var(--bs-body-color);
    font-size: 1.1rem;
}

    .btn-icon:hover {
        background: var(--portal-surface-2);
        color: var(--bs-body-color);
    }

[data-bs-theme=dark] .theme-icon-to-dark,
[data-bs-theme=light] .theme-icon-to-light {
    display: none;
}

.form-control:focus, .form-select:focus {
    border-color: #86efac;
    box-shadow: 0 0 0 .25rem rgba(22, 163, 74, .18);
}

/* Cards and tiles */
.portal-card {
    background: var(--portal-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
}

    .portal-card .card-body {
        padding: 1.25rem;
    }

.portal-tile {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    padding: 1.125rem;
    height: 100%;
    transition: transform .15s ease, box-shadow .15s ease;
}

a.portal-tile:hover,
button.portal-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--portal-shadow-lg);
}

button.portal-tile {
    color: inherit;
    font: inherit;
}

.portal-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--emto-green-soft);
    color: var(--emto-green);
    font-size: 1.25rem;
}

.portal-tile-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 1rem;
}

.portal-soon-badge {
    background: var(--portal-surface-2);
    color: var(--bs-secondary-color);
    border: 1px solid var(--bs-border-color);
    font-weight: 600;
}

.portal-section-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--bs-secondary-color);
    margin-bottom: .75rem;
}

.portal-hero {
    position: relative;
    overflow: hidden;
    padding: 1.75rem;
    border-radius: var(--portal-radius);
    color: #fff;
    background: radial-gradient(900px 320px at 0% 0%, rgba(34, 197, 94, .32), transparent 60%), linear-gradient(135deg, var(--emto-navy) 0%, var(--emto-navy-2) 100%);
    box-shadow: var(--portal-shadow-lg);
}

    .portal-hero h2 {
        font-weight: 700;
        letter-spacing: -.02em;
    }

    .portal-hero p {
        color: rgba(255, 255, 255, .78);
    }

.portal-hero-session {
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--portal-radius-sm);
    background: rgba(255, 255, 255, .08);
}

    .portal-hero-session .card-body {
        padding: 1rem 1.25rem;
    }

    .portal-hero-session .portal-dl dt {
        color: rgba(255, 255, 255, .65);
    }

/* Home: the wallet's balances, under the greeting */
.wallet-card {
    display: block;
    max-width: 440px;
    padding: .75rem 1rem;
    color: #fff;
    text-decoration: none;
}

    .wallet-card:hover {
        color: #fff;
        border-color: rgba(255, 255, 255, .32);
    }

.wallet-card-head {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.wallet-card-total {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.wallet-card-lines {
    display: grid;
    gap: .25rem;
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: .875rem;
}

.wallet-card-line {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    color: rgba(255, 255, 255, .78);
    font-variant-numeric: tabular-nums;
}

/* Account > Wallet: each balance opens its transactions (the app's coin details page) */
.wallet-asset {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .625rem .5rem;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    background: none;
    color: inherit;
    text-align: start;
}

    .wallet-asset:hover,
    .wallet-asset[aria-expanded="true"] {
        background: var(--portal-surface-2);
    }

.wallet-transactions {
    padding: .25rem 0 .75rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.wallet-transactions-status {
    margin: .75rem .5rem .25rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bs-secondary-color);
}

.wallet-transaction {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .5rem;
    border-radius: var(--portal-radius-sm);
    color: inherit;
    text-decoration: none;
}

    a.wallet-transaction[href]:hover {
        color: inherit;
        background: var(--portal-surface-2);
    }

.wallet-transaction-icon {
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .875rem;
}

.wallet-transaction-main {
    flex: 1;
    min-width: 0;
}

.wallet-transaction-amount {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Home: the app's pending payment banner and prompts (check-in, credit, mobile pin, referral, rental) */
.pending-payments {
    padding: .75rem 1rem;
    border-radius: var(--portal-radius-sm);
    background: #ea580c;
    color: #fff;
}

.pending-payments-failed {
    background: #dc2626;
}

    .pending-payments a {
        color: #fff;
    }

.pending-payments-list {
    display: grid;
    gap: .5rem;
    margin: .75rem 0 0;
    padding: .75rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, .3);
    list-style: none;
}

    .pending-payments-list li {
        display: flex;
        align-items: center;
        gap: .75rem;
    }

.home-prompt .portal-tile-icon {
    width: 44px;
    height: 44px;
}

.home-prompt-checkin {
    border-color: rgba(22, 163, 74, .45);
    background: linear-gradient(135deg, rgba(22, 163, 74, .1), transparent 60%), var(--portal-surface);
}

/* Home: invoices falling due, under New booking */
.invoice-due-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .875rem;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
}

.invoice-due-date {
    color: rgba(255, 255, 255, .65);
}

.invoice-due-overdue {
    color: #fca5a5;
    font-weight: 600;
}

.invoice-due-link {
    color: rgba(255, 255, 255, .85);
}

    .invoice-due-link:hover {
        color: #fff;
    }

.invoice-due-notice {
    padding: .5rem .75rem;
    border-radius: var(--portal-radius-sm);
    background: rgba(34, 197, 94, .2);
    color: #fff;
}

    .invoice-due-notice.is-error {
        background: rgba(245, 158, 11, .24);
    }

.portal-dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .5rem 1rem;
    margin: 0;
}

    .portal-dl dt {
        font-weight: 500;
        color: var(--bs-secondary-color);
    }

    .portal-dl dd {
        margin: 0;
        word-break: break-word;
    }

.portal-empty {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--bs-secondary-color);
}

    .portal-empty > i {
        font-size: 2.5rem;
        color: var(--emto-green);
    }

    .portal-empty h2 {
        color: var(--bs-body-color);
    }

.portal-loading {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

/* Brand, avatar and account menu */
.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    color: inherit;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -.02em;
}

.portal-logo {
    display: block;
    height: 22px;
    width: auto;
}

/* Dark lettering on the light top bar; white lettering in dark mode and on the navy panels */
.portal-logo-dark {
    display: none;
}

[data-bs-theme=dark] .portal-logo-light {
    display: none;
}

[data-bs-theme=dark] .portal-logo-dark {
    display: block;
}

    .portal-brand small {
        margin-left: .4rem;
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: #86efac;
    }

.portal-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--emto-green-bright), var(--emto-green-strong));
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
}

.portal-menu {
    position: relative;
}

    .portal-menu > summary {
        list-style: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: .5rem;
        padding: 2px 6px 2px 2px;
        border-radius: 999px;
    }

        .portal-menu > summary::-webkit-details-marker {
            display: none;
        }

        .portal-menu > summary:hover {
            background: var(--portal-surface-2);
        }

.portal-menu-name {
    font-weight: 600;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    min-width: 250px;
    padding: .5rem;
    z-index: 1060;
    background: var(--portal-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    box-shadow: var(--portal-shadow-lg);
}

.portal-menu-header {
    padding: .5rem .75rem .75rem;
    margin-bottom: .25rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.portal-menu-roles {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    max-width: 18rem;
    margin-top: .25rem;
}

.portal-menu-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    width: 100%;
    padding: .55rem .75rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--bs-body-color);
    text-align: left;
    text-decoration: none;
}

    .portal-menu-item:hover {
        background: var(--portal-surface-2);
    }

    .portal-menu-item.active {
        font-weight: 600;
    }

/* Console environment pill: Live, Test (staging) or Local */
.portal-menu > summary.env-pill {
    gap: .35rem;
    padding: .25rem .65rem;
    font-size: .8rem;
    font-weight: 700;
}

    .portal-menu > summary.env-pill .bi-chevron-down {
        font-size: .7rem;
    }

.portal-menu > summary.env-pill-live,
.portal-menu > summary.env-pill-live:hover {
    background: var(--emto-green-soft);
    color: var(--emto-green-strong);
}

.portal-menu > summary.env-pill-test,
.portal-menu > summary.env-pill-test:hover {
    background: rgba(245, 158, 11, .18);
    color: #b45309;
}

.portal-menu > summary.env-pill-local,
.portal-menu > summary.env-pill-local:hover {
    background: var(--portal-surface-2);
    color: var(--bs-secondary-color);
}

/* Console Region menu: green while narrowed to some regions, muted on pages it doesn't narrow */
.region-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .65rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background: var(--portal-surface);
    color: var(--bs-secondary-color);
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

.portal-menu > summary.region-pill {
    gap: .35rem;
    padding: .25rem .65rem;
}

    .region-pill .bi-chevron-down {
        font-size: .7rem;
    }

.region-pill-text {
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.region-pill-on,
.portal-menu > summary.region-pill-on:hover {
    border-color: var(--emto-green);
    background: var(--emto-green-soft);
    color: var(--emto-green-strong);
}

[data-bs-theme=dark] .region-pill-on { color: #86efac; }

.region-pill-off {
    opacity: .6;
}

.region-menu-panel {
    max-height: min(70vh, 32rem);
    overflow-y: auto;
}

@media (max-width: 575.98px) {
    .region-pill-text {
        display: none;
    }
}

/* Console layout */
.portal-admin {
    display: flex;
    min-height: 100vh;
}

.portal-nav-toggle,
.portal-scrim {
    display: none;
}

.portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--portal-sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 1rem .75rem;
    z-index: 1045;
    color: #cbd5e1;
    background: linear-gradient(180deg, var(--emto-navy) 0%, #0d2b44 100%);
    transition: transform .25s ease;
}

    .portal-sidebar .portal-brand {
        color: #fff;
        padding: .375rem .75rem 1rem;
    }

.portal-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.portal-nav-section {
    padding: 1rem .75rem .375rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #6b86a0;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .75rem;
    border-radius: 10px;
    color: #cbd5e1;
    font-weight: 500;
    text-decoration: none;
}

    .portal-nav-link i {
        font-size: 1.05rem;
    }

    .portal-nav-link:hover {
        background: rgba(255, 255, 255, .06);
        color: #fff;
    }

    .portal-nav-link.active {
        color: #fff;
        background: rgba(34, 197, 94, .16);
        box-shadow: inset 3px 0 0 var(--emto-green-bright);
    }

    .portal-nav-link.disabled {
        opacity: .55;
        pointer-events: none;
    }

/* What's waiting on a page: the sidebar is dark in both themes */
.portal-nav-count {
    flex-shrink: 0;
    margin-left: auto;
    min-width: 1.5rem;
    padding: .05rem .45rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: #0b1220;
    background: var(--emto-green-bright);
}

.portal-soon {
    margin-left: auto;
    padding: .1rem .45rem;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94a3b8;
    background: rgba(255, 255, 255, .08);
}

.portal-segmented {
    display: flex;
    gap: 3px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .07);
}

    .portal-segmented button {
        flex: 1;
        padding: .4rem .5rem;
        border: 0;
        border-radius: 8px;
        background: none;
        color: #94a3b8;
        font-size: .8rem;
        font-weight: 700;
    }

        .portal-segmented button.active {
            background: #fff;
            color: var(--emto-navy);
            box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
        }

.portal-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--portal-sidebar-width);
    display: flex;
    flex-direction: column;
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--portal-topbar-height);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.5rem;
    background: var(--portal-topbar-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--bs-border-color);
}

.portal-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.015em;
}

.portal-content {
    width: 100%;
    max-width: 1440px;
    padding: 1.5rem;
}

@media (max-width: 991.98px) {
    .portal-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--portal-shadow-lg);
    }

    .portal-nav-toggle:checked ~ .portal-sidebar {
        transform: none;
    }

    .portal-nav-toggle:checked ~ .portal-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(2, 6, 23, .5);
    }

    .portal-main {
        margin-left: 0;
    }

    .portal-topbar {
        padding: 0 1rem;
    }

    .portal-content {
        padding: 1rem;
    }
}

/* Shipper layout */
.portal-shipper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container-app {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1rem;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--portal-topbar-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--bs-border-color);
}

    .app-topbar .container-app {
        height: var(--portal-topbar-height);
    }

.app-nav {
    gap: .25rem;
    margin-left: 1.25rem;
}

.app-nav-link {
    padding: .5rem .85rem;
    border-radius: 10px;
    color: var(--bs-secondary-color);
    font-weight: 600;
    text-decoration: none;
}

    .app-nav-link:hover {
        color: var(--bs-body-color);
        background: var(--portal-surface-2);
    }

    .app-nav-link.active {
        color: var(--emto-green);
        background: var(--emto-green-soft);
    }

    .app-nav-link.disabled {
        opacity: .45;
        pointer-events: none;
    }

.portal-business-badge {
    background: var(--emto-green-soft);
    color: var(--emto-green);
    font-weight: 700;
    padding: .45em .8em;
}

.app-content {
    flex: 1;
    padding-top: 1.5rem;
    padding-bottom: 6.5rem;
}

.app-page-title {
    margin-bottom: 1.25rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.025em;
}

.app-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: end;
    padding: .4rem .25rem calc(.4rem + env(safe-area-inset-bottom));
    background: var(--portal-surface);
    border-top: 1px solid var(--bs-border-color);
    box-shadow: 0 -6px 24px rgba(16, 24, 40, .06);
}

.app-bottom-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: .25rem 0;
    font-size: .7rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-decoration: none;
}

    .app-bottom-link i {
        font-size: 1.3rem;
    }

    .app-bottom-link.active {
        color: var(--emto-green);
    }

    .app-bottom-link.disabled {
        opacity: .45;
    }

.app-bottom-cta {
    display: flex;
    justify-content: center;
}

    .app-bottom-cta > span {
        width: 52px;
        height: 52px;
        margin-top: -22px;
        border-radius: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 1.5rem;
        background: linear-gradient(135deg, var(--emto-green-bright), var(--emto-green-strong));
        box-shadow: 0 8px 20px rgba(22, 163, 74, .38);
    }

    .app-bottom-cta.disabled > span {
        filter: saturate(.6);
        opacity: .75;
    }

/* Public pages (sign-in) */
.portal-public {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.portal-public-brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 3rem;
    color: #fff;
    background: radial-gradient(900px 520px at 10% 5%, rgba(34, 197, 94, .3), transparent 60%), linear-gradient(160deg, var(--emto-navy) 0%, var(--emto-navy-2) 100%);
}

    .portal-public-brand h1 {
        max-width: 34rem;
        font-size: clamp(1.9rem, 3.2vw, 3rem);
        font-weight: 800;
        line-height: 1.12;
        letter-spacing: -.035em;
    }

    .portal-public-brand .lead {
        max-width: 32rem;
        color: rgba(255, 255, 255, .78);
    }

.portal-public-points {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    display: grid;
    gap: .875rem;
}

    .portal-public-points li {
        display: flex;
        align-items: center;
        gap: .75rem;
        color: rgba(255, 255, 255, .9);
        font-weight: 500;
    }

    .portal-public-points i {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, .1);
        color: #86efac;
    }

.portal-public-footnote {
    color: rgba(255, 255, 255, .55);
}

.portal-public-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
}

.portal-public-card {
    width: 100%;
    max-width: 420px;
}

@media (max-width: 991.98px) {
    .portal-public {
        grid-template-columns: 1fr;
    }

    .portal-public-brand {
        padding: 1.5rem;
    }

        .portal-public-brand h1 {
            font-size: 1.6rem;
        }

    .portal-public-points,
    .portal-public-footnote {
        display: none !important;
    }
}

/* Blazor error bar */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 2000;
    padding: .75rem 1rem;
    border-radius: 12px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    box-shadow: var(--portal-shadow-lg);
}

    #blazor-error-ui .reload {
        margin-left: .5rem;
        font-weight: 600;
    }

    #blazor-error-ui .dismiss {
        margin-left: .75rem;
        cursor: pointer;
        font-size: 1.1rem;
    }

/* Blazor's built-in reconnect dialog: a white box whose text inherits the page colour */
#components-reconnect-modal {
    color: #000;
}

/* Sign-in */
.portal-otp-input {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .5em;
}

/* Page title back link */
.portal-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: .5rem;
    border-radius: 9px;
    color: var(--bs-body-color);
    text-decoration: none;
}

    .portal-back:hover {
        background: var(--portal-surface-2);
    }

.portal-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1rem;
}

.portal-avatar-xl {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
}

/* A file input laid over its button: the button's look, the input's click and keyboard */
.photo-upload {
    position: relative;
    overflow: hidden;
}

    .photo-upload input[type=file] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

    .photo-upload:focus-within {
        box-shadow: var(--bs-btn-focus-box-shadow);
    }

/* Driver photo over the initials; the initials show if it doesn't load */
.portal-avatar-photo {
    position: relative;
    overflow: hidden;
}

    .portal-avatar-photo img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        background: var(--portal-surface);
    }

/* Status badges */
.portal-status {
    font-weight: 600;
    padding: .4em .75em;
}

.portal-status-primary { background: rgba(37, 99, 235, .12); color: #1d4ed8; }
.portal-status-info { background: rgba(14, 165, 233, .12); color: #0369a1; }
.portal-status-success { background: var(--emto-green-soft); color: var(--emto-green-strong); }
.portal-status-warning { background: rgba(245, 158, 11, .15); color: #b45309; }
.portal-status-danger { background: rgba(239, 68, 68, .12); color: #b91c1c; }
.portal-status-secondary { background: var(--portal-surface-2); color: var(--bs-secondary-color); border: 1px solid var(--bs-border-color); }
.portal-status-cod { background: rgba(147, 51, 234, .12); color: #7e22ce; }

[data-bs-theme=dark] .portal-status-primary { color: #93c5fd; }
[data-bs-theme=dark] .portal-status-info { color: #7dd3fc; }
[data-bs-theme=dark] .portal-status-success { color: #86efac; }
[data-bs-theme=dark] .portal-status-warning { color: #fcd34d; }
[data-bs-theme=dark] .portal-status-danger { color: #fca5a5; }
[data-bs-theme=dark] .portal-status-cod { color: #d8b4fe; }

/* Tabs */
.portal-tabs {
    display: flex;
    gap: .375rem;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.portal-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background: var(--portal-surface);
    color: var(--bs-secondary-color);
    font-weight: 600;
    white-space: nowrap;
}

    .portal-tab.active {
        border-color: var(--emto-green);
        background: var(--emto-green-soft);
        color: var(--emto-green-strong);
    }

.portal-tab-count {
    min-width: 1.4rem;
    padding: 0 .4rem;
    border-radius: 999px;
    background: var(--portal-surface-2);
    font-size: .75rem;
    text-align: center;
}

/* Booking rows */
.booking-row {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .875rem 1rem;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

    .booking-row:hover {
        color: inherit;
        border-color: rgba(22, 163, 74, .45);
        transform: translateY(-1px);
    }

.booking-row-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--emto-green-soft);
    color: var(--emto-green);
    font-size: 1.15rem;
}

.booking-row-icon-warning {
    background: rgba(245, 158, 11, .15);
    color: #b45309;
}

.booking-row-main {
    flex: 1;
    min-width: 0;
}

.booking-row-amount {
    text-align: right;
    white-space: nowrap;
}

/* Booking cards (the app's trip card) */
.booking-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.booking-card-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .875rem 1rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--bs-border-color);
}

    .booking-card-head:hover {
        color: inherit;
        background: var(--portal-surface-2);
    }

/* The app's search for a vehicle: the vehicle pulses, a dash runs round the card's head and the tips turn */
.booking-card-trace {
    position: absolute;
    inset: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    overflow: visible;
    pointer-events: none;
}

    .booking-card-trace rect {
        fill: none;
        stroke: var(--emto-green);
        stroke-width: 3;
        stroke-linecap: round;
        stroke-dasharray: 5 95;
        animation: booking-card-trace 2s linear infinite;
    }

.booking-card-searching .booking-card-vehicle,
.booking-card-searching .booking-row-icon {
    animation: booking-card-pulse 1.2s ease-in-out infinite;
}

.booking-card-search {
    margin-top: .375rem;
    font-size: .8125rem;
    overflow-wrap: anywhere;
}

.booking-card-search-tip {
    margin-top: .25rem;
    color: #7c3aed;
    font-weight: 600;
    animation: booking-card-tip .5s ease-out;
}

[data-bs-theme=dark] .booking-card-search-tip {
    color: #c4b5fd;
}

@keyframes booking-card-trace {
    to { stroke-dashoffset: -100; }
}

@keyframes booking-card-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes booking-card-tip {
    from { opacity: 0; transform: translateY(.25rem); }
}

@media (prefers-reduced-motion: reduce) {
    .booking-card-trace rect,
    .booking-card-searching .booking-card-vehicle,
    .booking-card-searching .booking-row-icon,
    .booking-card-search-tip {
        animation: none;
    }
}

/* The app's fare changer, offered when the search runs long */
.booking-card-fare {
    padding: .75rem;
    border: 1px solid var(--bs-success-border-subtle);
    border-radius: var(--portal-radius-sm);
    background: var(--bs-success-bg-subtle);
}

.booking-card-fare-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .5rem;
}

.booking-card-fare-amount {
    min-width: 5.5rem;
    padding: .2rem .5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    background: var(--bs-body-bg);
    font-size: 1.125rem;
    font-weight: 700;
    text-align: center;
}

/* The app's ETA box while the vehicle is on its way to a stop */
.booking-card-eta {
    display: flex;
    align-items: center;
    gap: .5rem;
    align-self: flex-start;
    padding: .375rem .75rem;
    border: 1px solid var(--bs-danger-border-subtle);
    border-radius: var(--portal-radius-sm);
    font-size: .875rem;
}

    .booking-card-eta .bi {
        color: var(--bs-danger);
    }

/* The app's loading and unloading timer, with the extra time charges once the free time is used */
.booking-card-clock {
    padding: .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    background: var(--portal-surface-2);
}

.booking-card-clock-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
    gap: .5rem;
    margin: .625rem 0 0;
}

    .booking-card-clock-figures > div {
        padding: .375rem .5rem;
        border: 1px solid var(--bs-border-color);
        border-radius: var(--portal-radius-sm);
        background: var(--bs-body-bg);
        text-align: center;
    }

    .booking-card-clock-figures dt {
        font-size: .75rem;
        font-weight: 400;
        color: var(--bs-secondary-color);
    }

    .booking-card-clock-figures dd {
        margin: 0;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

.booking-card-clock-extra {
    margin-top: .5rem;
    color: var(--bs-warning-text-emphasis);
    font-size: .875rem;
}

/* The app's yellow tabs on the card's top edge: new customer (admins) left, pickup time and inbound right */
.booking-card-chips {
    display: flex;
    gap: .375rem;
    padding: 0 1rem;
}

.booking-card-chip {
    padding: .1rem .625rem .15rem;
    border-radius: 0 0 .5rem .5rem;
    background: #ffcc00;
    color: #1f1300;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

[data-bs-theme=dark] .booking-card-chip {
    background: #ffd60a;
}

/* The app's card row for a payment still due, with Pay now */
.booking-card-due {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem .75rem;
    border-radius: 8px;
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
    font-size: .875rem;
}

.booking-card-vehicle {
    width: 64px;
    height: 42px;
    flex-shrink: 0;
    object-fit: contain;
}

.booking-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: .875rem 1rem 1rem;
}

/* Pickup and last drop, joined like the map's green and red pins */
.booking-card-stops {
    list-style: none;
    display: grid;
    gap: .625rem;
    margin: 0;
    padding: 0;
}

    .booking-card-stops li {
        position: relative;
        min-width: 0;
        padding-left: 1.25rem;
        overflow-wrap: anywhere;
    }

        .booking-card-stops li::before {
            content: "";
            position: absolute;
            top: .45rem;
            left: .15rem;
            width: .6rem;
            height: .6rem;
            border-radius: 50%;
            background: #16a34a;
        }

        .booking-card-stops li + li::before {
            background: #dc2626;
        }

        .booking-card-stops li:first-child:not(:last-child)::after {
            content: "";
            position: absolute;
            top: 1.2rem;
            bottom: -.5rem;
            left: .4rem;
            border-left: 2px dotted var(--bs-border-color);
        }

.booking-card-address {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* A stop's pills above it on a card, as on the booking page */
.booking-card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .35rem;
}

    .booking-card-pills .badge {
        white-space: normal;
        text-align: left;
    }

/* The status of the stop under way: a dash runs round it, as round a card finding a vehicle */
.stop-pill-live {
    position: relative;
    overflow: visible;
}

.stop-pill-trace {
    position: absolute;
    inset: -3px;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    overflow: visible;
    pointer-events: none;
}

    .stop-pill-trace rect {
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-dasharray: 14 86;
        animation: booking-card-trace 2s linear infinite;
    }

@media (prefers-reduced-motion: reduce) {
    .stop-pill-trace rect {
        animation: none;
        stroke-dasharray: none;
        opacity: .5;
    }
}

.booking-card-progress {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
}

    .booking-card-progress .badge {
        white-space: normal;
        text-align: left;
    }

.booking-card-driver {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--bs-border-color);
}

.booking-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: auto;
}

.booking-card-confirm,
.booking-card-rating {
    padding: .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    background: var(--portal-surface-2);
}

/* The app's prize wheel: its card (RatingsViewTemplate) opens the panel (HomePage PostBookingWheel) with the wheel (SpinWheelView) */
.wheel-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    width: 100%;
    height: 150px;
    padding: 0;
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    overflow: hidden;
    background: #02042e url(wheel/wheel-card.webp) right center / auto 100% no-repeat;
    color: #fff;
    text-align: start;
}

    .wheel-card:disabled {
        opacity: .65;
    }

.wheel-card-text {
    align-self: center;
    margin: 0 10px;
    font-size: 1rem;
    line-height: 1.3;
}

.wheel-card-play {
    grid-row: 2;
    margin: 0 10px 10px;
    padding: 5px;
    border-radius: 10px;
    background: #34c759;
    font-size: .8125rem;
    text-align: center;
}

.wheel-overlay {
    position: fixed;
    inset: 0;
    z-index: 1070;
    background: rgba(0, 0, 0, .5);
}

.wheel-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1080;
    display: grid;
    row-gap: 20px;
    width: min(420px, calc(100vw - 20px));
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    overflow: hidden;
    background: url(wheel/celebration-bg.webp) center / cover no-repeat;
}

.wheel-panel-stage {
    position: relative;
}

.wheel-panel-dim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, .5);
}

.wheel-message {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: max-content;
    max-width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    background: #0b2234;
    color: #fff;
    font-size: 1rem;
    text-align: center;
}

.wheel-message-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.wheel-celebration {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: bottom;
    pointer-events: none;
}

.wheel-panel-close {
    position: relative;
    z-index: 2;
    margin: 0 10px 10px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: #0b2234;
    color: #fff;
    font-weight: 600;
}

[data-bs-theme=dark] .wheel-overlay,
[data-bs-theme=dark] .wheel-panel-dim {
    background: rgba(0, 0, 0, .7);
}

[data-bs-theme=dark] .wheel-card,
[data-bs-theme=dark] .wheel-panel,
[data-bs-theme=dark] .wheel-message {
    border-color: #48484a;
}

/* 200 view-box units across under 20 for the pointer; 94% of the panel less 30px, as the app sizes it, and short of the screen's height */
.spin-wheel {
    position: relative;
    width: min(calc((100% - 30px) * .94), 400px, calc((100vh - 110px) / 1.1));
    aspect-ratio: 200 / 220;
    margin: 0 auto;
}

.spin-wheel-rim,
.spin-wheel-disc {
    position: absolute;
    left: 0;
    top: 9.0909%;
    width: 100%;
    height: 90.9091%;
}

.spin-wheel-disc {
    transition: transform var(--spin-ms, 4s) cubic-bezier(.33, 1, .68, 1);
    user-select: none;
}

.spin-wheel-pointer {
    position: absolute;
    left: 50%;
    top: 4.8485%;
    width: 9.3333%;
    overflow: visible;
    transform: translateX(-50%);
}

/* Sized against the wheel's box (1.1 times as tall as wide): WebKit ignores aspect-ratio on buttons */
.spin-wheel-hub {
    position: absolute;
    left: 50%;
    top: 54.5455%;
    width: 35%;
    height: 31.8182%;
    transform: translate(-50%, -50%);
    padding: 4.375%;
    border: 3px solid #d0d0d0;
    border-radius: 50%;
    background: #fff url(wheel/hand-touch.gif) center / contain no-repeat;
    background-origin: content-box;
}

.spin-wheel.is-spinning .spin-wheel-hub {
    opacity: .4;
    background-image: none;
}

@media (prefers-reduced-motion: reduce) {
    .spin-wheel-disc {
        transition-duration: .2s;
    }
}

/* Sections scrolled to stay clear of the sticky top bar */
.booking-anchor {
    scroll-margin-top: calc(var(--portal-topbar-height) + 1rem);
}

.portal-filters .card-body {
    padding: 1rem;
}

/* Console search: the view, the search box, filter chips with their editors (popovers; sheets on phones) */
.search-header .card-body {
    display: grid;
    gap: .85rem;
    padding: 0 1.25rem 1rem;
}

/* The views as tabs across the top of the card; they scroll sideways when the card is narrow */
.search-top {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    margin: 0 -1.25rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.search-top-actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

.search-top-label {
    margin-left: .3rem;
}

.search-scope {
    position: relative;
    display: flex;
    align-self: stretch;
    gap: .25rem;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

    .search-scope::-webkit-scrollbar {
        display: none;
    }

.search-scope-item {
    flex: none;
    padding: .85rem .75rem .75rem;
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
    font-weight: 600;
    white-space: nowrap;
}

    .search-scope-item:hover {
        color: var(--bs-emphasis-color);
    }

    .search-scope-item.active {
        color: var(--emto-green-strong);
        box-shadow: inset 0 -2px 0 var(--emto-green);
    }

    .search-scope-item:focus-visible {
        outline: 2px solid var(--emto-green);
        outline-offset: -4px;
        border-radius: 8px;
    }

[data-bs-theme=dark] .search-scope-item.active { color: #86efac; }

/* Without the sidebar's room: Views and Actions as icons */
@media (max-width: 991.98px) {
    .search-top-label {
        display: none;
    }
}

.search-form {
    display: flex;
    gap: .5rem;
    min-width: 0;
}

.search-box {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

    .search-box > .bi-search {
        position: absolute;
        top: 50%;
        left: .9rem;
        transform: translateY(-50%);
        color: var(--bs-secondary-color);
        pointer-events: none;
    }

    .search-box .form-control {
        height: 2.75rem;
        padding-left: 2.5rem;
        padding-right: 2.5rem;
        border-radius: 12px;
    }

.search-kbd {
    position: absolute;
    top: 50%;
    right: .75rem;
    transform: translateY(-50%);
    padding: .05rem .45rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    background: var(--portal-surface-2);
    color: var(--bs-secondary-color);
    font-size: .75rem;
    pointer-events: none;
}

.search-box .form-control:focus ~ .search-kbd,
.search-box .form-control:not(:placeholder-shown) ~ .search-kbd {
    display: none !important;
}

.search-go {
    min-width: 6.5rem;
    height: 2.75rem;
    border-radius: 12px;
}

.search-filterbar,
.search-options,
.search-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
    min-width: 0;
}

.search-chip-wrap {
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.search-chip {
    display: inline-flex;
    align-items: stretch;
    max-width: min(26rem, 100%);
    border: 1px solid rgba(22, 163, 74, .35);
    border-radius: 999px;
    background: var(--emto-green-soft);
    color: var(--emto-green-strong);
    font-size: .8125rem;
    font-weight: 600;
}

    .search-chip.open,
    .search-chip:focus-within {
        border-color: var(--emto-green);
        box-shadow: 0 0 0 .2rem var(--emto-green-soft);
    }

[data-bs-theme=dark] .search-chip { color: #86efac; }

.search-chip-edit,
.search-chip-remove {
    display: inline-flex;
    align-items: center;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
}

.search-chip-edit {
    gap: .4rem;
    min-width: 0;
    padding: .3rem .3rem .3rem .75rem;
}

.search-chip-remove {
    padding: 0 .6rem 0 .3rem;
    border-radius: 0 999px 999px 0;
    font-size: .65rem;
}

    .search-chip-edit:hover,
    .search-chip-remove:hover {
        color: var(--bs-emphasis-color);
    }

.search-add {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .8rem;
    border: 1px dashed var(--bs-border-color);
    border-radius: 999px;
    color: var(--bs-secondary-color);
    font-weight: 600;
}

    .search-add:hover,
    .search-add[aria-expanded=true] {
        border-color: var(--emto-green);
        background: var(--emto-green-soft);
        color: var(--emto-green-strong);
    }

.search-clear {
    color: var(--bs-secondary-color);
}

/* Phones only: elsewhere a press outside the editor closes it and still reaches what it was on (portal.js) */
.search-popover-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1064;
}

.search-popover {
    position: absolute;
    top: calc(100% + .4rem);
    left: 0;
    z-index: 1065;
    display: flex;
    flex-direction: column;
    width: min(24rem, calc(100vw - 2rem));
    max-height: min(72vh, 36rem);
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-lg);
    outline: none;
}

.search-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .55rem .55rem .35rem 1rem;
}

.search-popover-title {
    margin: 0;
    font-size: .9rem;
    font-weight: 700;
}

.search-popover-body {
    padding: .25rem 1rem 1rem;
    overflow-y: auto;
}

.search-popover-footer {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .6rem 1rem;
    border-top: 1px solid var(--bs-border-color);
}

/* Phones: the editors are sheets from the bottom */
@media (max-width: 575.98px) {
    .search-popover-scrim {
        display: block;
        background: rgba(2, 6, 23, .45);
    }

    .search-popover {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 82vh;
        border-radius: 16px 16px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
}

.search-kinds,
.search-views,
.search-list {
    display: grid;
    gap: .1rem;
}

.search-list {
    max-height: 16rem;
    overflow-y: auto;
}

    .search-kinds .search-group-title,
    .search-views .search-group-title {
        margin: .5rem 0 .15rem .55rem;
    }

.search-kind,
.search-list-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .45rem .55rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    font-size: .875rem;
    text-align: left;
}

    .search-kind:hover,
    .search-kind:focus-visible,
    .search-list-item:hover,
    .search-list-item:focus-visible {
        background: var(--portal-surface-2);
    }

    .search-kind > .bi {
        color: var(--bs-secondary-color);
    }

    .search-list-item.active {
        color: var(--emto-green-strong);
        font-weight: 600;
    }

/* Yes and No for a yes-or-no filter, in its row of the Add menu */
.search-yesno {
    display: inline-flex;
    flex: none;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    overflow: hidden;
}

    .search-yesno button {
        padding: .15rem .7rem;
        border: 0;
        background: var(--portal-surface);
        color: var(--bs-body-color);
        font-size: .8rem;
        font-weight: 600;
    }

        .search-yesno button + button {
            border-left: 1px solid var(--bs-border-color);
        }

        .search-yesno button:hover {
            background: var(--portal-surface-2);
        }

        .search-yesno button.active {
            background: var(--emto-green-soft);
            color: var(--emto-green-strong);
        }

[data-bs-theme=dark] .search-yesno button.active { color: #86efac; }

.search-saved {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.search-checklist .search-list {
    max-height: 18rem;
}

.search-checklist-footer {
    position: sticky;
    bottom: -1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .75rem -1rem -1rem;
    padding: .6rem 1rem;
    border-top: 1px solid var(--bs-border-color);
    background: var(--portal-surface);
}

/* Console cards open their page from anywhere on them (portal.js) */
[data-card-href] {
    cursor: pointer;
}

.search-group-title {
    margin-bottom: .375rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.search-dirty {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .45rem .75rem;
    border-radius: 10px;
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
    font-size: .8125rem;
}

/* Console search results: their summary, states while searching or after a problem, the tables */
.search-results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin-bottom: .75rem;
}

.search-results-summary {
    font-weight: 700;
}

.search-results.updating {
    opacity: .7;
    transition: opacity .2s;
}

.search-updating {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    color: var(--bs-secondary-color);
    font-size: .875rem;
}

.search-state {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
}

    .search-state > .bi {
        font-size: 1.5rem;
    }

.search-suggestions {
    justify-content: center;
    margin-top: 1rem;
}

.search-skeleton {
    height: 9.5rem;
    background: linear-gradient(90deg, var(--portal-surface-2) 25%, var(--portal-surface) 37%, var(--portal-surface-2) 63%);
    background-size: 400% 100%;
    animation: search-shimmer 1.4s ease infinite;
}

@keyframes search-shimmer {
    from { background-position: 100% 50%; }
    to { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .search-skeleton { animation: none; }
}

.search-more {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: 1rem;
}

/* Facts on the results' company and driver cards */
.search-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-top: .5rem;
}

.search-card-chip {
    display: inline-flex;
    align-items: center;
    gap: .3em;
    font-weight: 500;
}

.search-table th {
    white-space: nowrap;
}

.search-table-wide {
    max-width: 16rem;
}

.search-sort {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.search-map {
    height: min(65vh, 560px);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
}

.search-actions {
    position: relative;
}

.search-actions-menu {
    position: absolute;
    top: calc(100% + .35rem);
    right: 0;
    z-index: 1050;
    display: grid;
    min-width: 15rem;
    padding: .35rem;
    background: var(--portal-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    box-shadow: var(--portal-shadow-lg);
}

.search-actions-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .65rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    font-size: .875rem;
    text-align: left;
    text-decoration: none;
}

    .search-actions-item:hover,
    .search-actions-item:focus-visible {
        background: var(--portal-surface-2);
        color: inherit;
    }

    /* Google's popups are white in both themes */
    .search-map .gm-style-iw {
        color: #212529;
    }

/* The map filter's area, as the app draws it */
.search-area-map {
    height: 260px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
}

/* Console trip page: the driver app's TripDetailsPage */
.trip-map {
    height: 320px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
}

.trip-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: .5rem;
}

.trip-metric {
    min-width: 0;
    padding: .5rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    background: var(--portal-surface-2);
    overflow-wrap: anywhere;
}

.trip-stars {
    color: #fbbf24;
    white-space: nowrap;
}

.trip-driver-photo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--bs-border-color);
}

/* Booking detail */
.booking-detail-pay {
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}

.booking-detail-total {
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.booking-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}

    .booking-detail-actions:empty {
        display: none;
    }

.booking-vehicle-image {
    width: 112px;
    height: 72px;
    flex-shrink: 0;
    object-fit: contain;
}

.route-stops {
    list-style: none;
    margin: 0;
    padding: 0;
}

.route-stop {
    min-width: 0;
    padding: .875rem 0;
    overflow-wrap: anywhere;
}

    .route-stop:first-child {
        padding-top: 0;
    }

    .route-stop:last-child {
        padding-bottom: 0;
    }

    .route-stop + .route-stop {
        border-top: 1px solid var(--bs-border-color);
    }

.route-stop-status {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: .4rem;
}

    .route-stop-status .badge {
        white-space: normal;
        text-align: left;
    }

/* The picture viewer (portal.js emtoViewer): the whole window, the toolbar above the picture and the set's thumbnails below */
[data-view-image] {
    cursor: zoom-in;
}

    /* Above a card's stretched link */
    .portal-avatar-photo img[data-view-image] {
        z-index: 2;
    }

html:has(dialog.image-viewer[open]) {
    overflow: hidden;
}

dialog.image-viewer {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #0a0d14;
    color: #f3f4f6;
    overflow: hidden;
    overscroll-behavior: contain;
}

    dialog.image-viewer:focus {
        outline: none;
    }

    dialog.image-viewer[open] {
        display: flex;
        flex-direction: column;
    }

    dialog.image-viewer::backdrop {
        background: rgba(0, 0, 0, .6);
    }

.image-viewer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem 1rem;
    padding: .5rem .75rem;
    padding-top: max(.5rem, env(safe-area-inset-top));
}

.image-viewer-heading {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    flex: 1 1 12rem;
    min-width: 0;
}

.image-viewer-title {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-viewer-count {
    flex-shrink: 0;
    font-size: .85rem;
    color: rgba(243, 244, 246, .7);
}

.image-viewer-tools {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-left: auto;
}

    .image-viewer-tools button,
    .image-viewer-tools a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 2.5rem;
        height: 2.5rem;
        padding: 0 .5rem;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: inherit;
        font-size: 1.1rem;
        text-decoration: none;
    }

        .image-viewer-tools button:hover,
        .image-viewer-tools a:hover {
            background: rgba(255, 255, 255, .12);
        }

        .image-viewer-tools button:focus-visible,
        .image-viewer-tools a:focus-visible,
        .image-viewer-nav:focus-visible,
        .image-viewer-thumb:focus-visible {
            outline: 2px solid #fff;
            outline-offset: 2px;
        }

    .image-viewer-tools .image-viewer-zoom {
        min-width: 3.75rem;
        font-size: .85rem;
        font-variant-numeric: tabular-nums;
    }

.image-viewer-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

    .image-viewer-stage.zoomed {
        cursor: grab;
    }

        .image-viewer-stage.zoomed:active {
            cursor: grabbing;
        }

/* White behind it, so a signature's dark ink on a clear background shows */
.image-viewer-image {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: none;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
    -webkit-user-drag: none;
}

    .image-viewer-image.animate {
        transition: transform .2s ease, width .2s ease, height .2s ease;
    }

    .image-viewer-stage.loading .image-viewer-image,
    .image-viewer-stage.failed .image-viewer-image {
        visibility: hidden;
    }

.image-viewer-status {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    pointer-events: none;
}

    .image-viewer-stage.loading .image-viewer-status,
    .image-viewer-stage.failed .image-viewer-status {
        display: flex;
    }

    .image-viewer-stage.loading .image-viewer-status::before {
        content: "";
        width: 2rem;
        height: 2rem;
        border: .25rem solid rgba(255, 255, 255, .25);
        border-top-color: #fff;
        border-radius: 50%;
        animation: image-viewer-spin .8s linear infinite;
    }

@keyframes image-viewer-spin {
    to {
        transform: rotate(360deg);
    }
}

.image-viewer-nav {
    position: absolute;
    top: 50%;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, .7);
    color: #fff;
    font-size: 1.25rem;
    transform: translateY(-50%);
}

    .image-viewer-nav:hover {
        background: rgba(17, 24, 39, .92);
    }

    .image-viewer-nav.prev { left: .75rem; }
    .image-viewer-nav.next { right: .75rem; }

dialog.image-viewer.single .image-viewer-nav,
dialog.image-viewer.single .image-viewer-thumbs {
    display: none;
}

.image-viewer-thumbs {
    display: flex;
    gap: .5rem;
    padding: .5rem .75rem;
    padding-bottom: max(.5rem, env(safe-area-inset-bottom));
    overflow-x: auto;
}

    /* Centred while they fit, scrolling from the first when they don't */
    .image-viewer-thumbs > :first-child {
        margin-left: auto;
    }

    .image-viewer-thumbs > :last-child {
        margin-right: auto;
    }

.image-viewer-thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
    opacity: .7;
}

    .image-viewer-thumb.active {
        border-color: var(--emto-green);
        opacity: 1;
    }

    .image-viewer-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

@media (max-width: 575.98px) {
    .image-viewer-tools {
        justify-content: space-between;
        width: 100%;
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .image-viewer-image.animate {
        transition: none;
    }
}

/* A drop's goods, under its contact */
.route-stop-goods {
    margin-top: .35rem;
    padding: .45rem .65rem;
    border-radius: 8px;
    background: var(--portal-surface-2);
}

/* An extra charge on the booking page's Additional charges: its reason and notes, and the amount (green paid, red not) */
.extra-charge {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    padding: .4rem 0;
    border-bottom: 1px dashed var(--bs-border-color);
    font-variant-numeric: tabular-nums;
}

    .extra-charge:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

.booking-map {
    height: 260px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
}

    .booking-map iframe {
        width: 100%;
        height: 100%;
        border: 0;
    }

.booking-charges {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .4rem 1rem;
    margin: 0;
}

    .booking-charges dt {
        font-weight: 500;
        color: var(--bs-secondary-color);
    }

    .booking-charges dd {
        margin: 0;
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

.booking-charges-total {
    padding-top: .5rem;
    border-top: 1px solid var(--bs-border-color);
    font-weight: 700 !important;
    color: var(--bs-body-color) !important;
}

.booking-pay {
    padding: .75rem;
    border-radius: 10px;
    background: var(--portal-surface-2);
}

.booking-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .6rem;
}

    .booking-timeline li {
        display: flex;
        align-items: center;
        gap: .6rem;
    }

    .booking-timeline i {
        color: var(--emto-green);
    }

.booking-problem {
    padding: .75rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

    .booking-problem:last-of-type {
        border-bottom: 0;
    }

/* Opens the problem in the Report a problem dialog through its title (stretched-link), keeping its photo links */
.booking-problem-link {
    position: relative;
}

    .booking-problem-link:hover .stretched-link {
        color: var(--emto-green) !important;
    }

/* The app's Report a Problem page, as a dialog: claim items, their photos and receipts, the claim's FAQ */
.report-problem {
    width: min(640px, calc(100vw - 2rem));
}

.report-problem-box {
    padding: .65rem .8rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    white-space: pre-line;
}

.report-problem-insurance {
    border-color: var(--emto-green);
}

.report-problem-status {
    border-color: var(--bs-warning-border-subtle);
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
}

.report-problem-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    background: var(--portal-surface);
    color: inherit;
    text-align: left;
}

    .report-problem-item:hover {
        border-color: var(--emto-green);
    }

.report-problem-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.report-problem-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--portal-surface-2);
}

    .report-problem-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .report-problem-thumb .btn {
        position: absolute;
        top: 2px;
        right: 2px;
        padding: 0 .3rem;
        line-height: 1.4;
    }

.report-problem-faq details {
    padding: .5rem 0;
    border-top: 1px solid var(--bs-border-color);
}

    .report-problem-faq summary {
        color: var(--bs-secondary-color);
        cursor: pointer;
    }

    .report-problem-faq p,
    .report-problem-faq ol {
        margin: .5rem 0 0;
        font-size: .875rem;
    }

/* The app's admin section on a booking */
.booking-admin-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .65rem .25rem;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    background: none;
    color: inherit;
    text-align: left;
}

    .booking-admin-row:last-child {
        border-bottom: 0;
    }

    .booking-admin-row:hover {
        background: var(--portal-surface-2);
    }

.booking-admin-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.booking-admin-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.booking-events {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .booking-events li {
        display: flex;
        flex-direction: column;
        gap: .1rem;
        padding: .6rem 0;
        border-bottom: 1px solid var(--bs-border-color);
    }

        .booking-events li:last-child {
            border-bottom: 0;
        }

.booking-delay-form {
    margin-top: .5rem;
    padding: .75rem;
    border-radius: 10px;
    background: var(--portal-surface-2);
}

/* A trip delay still without its reason */
.booking-delay-card {
    border-color: var(--bs-warning-border-subtle);
    background: var(--bs-warning-bg-subtle);
}

    .booking-delay-card .booking-delay-form {
        background: var(--portal-surface);
    }

.booking-delay-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .booking-delay-list li {
        padding: .5rem 0;
    }

        .booking-delay-list li + li {
            border-top: 1px solid var(--bs-warning-border-subtle);
        }

.booking-margin-grid {
    display: grid;
    grid-template-columns: 1fr auto 8.5rem;
    gap: .4rem .75rem;
    align-items: center;
    font-variant-numeric: tabular-nums;
}

.photo-picker-preview {
    position: relative;
    display: inline-block;
}

    .photo-picker-preview img {
        display: block;
        max-width: 100%;
        max-height: 9rem;
        border-radius: 8px;
        border: 1px solid var(--bs-border-color);
    }

    .photo-picker-preview .btn {
        position: absolute;
        top: .35rem;
        right: .35rem;
        padding: .1rem .35rem;
    }

/* Operations pages */
.ops-search {
    max-width: 24rem;
}

/* Console shipper tabs */
.contact-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
}

    .contact-stats dt {
        font-size: .75rem;
        font-weight: 500;
        color: var(--bs-secondary-color);
    }

    .contact-stats dd {
        margin: 0;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

.payment-route {
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Console driver, vehicle and transporter pages: the app's figure cards and daily bars */
.ops-figures {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    gap: .75rem;
    margin: 0;
}

    .ops-figures > div {
        padding: .75rem 1rem;
        border: 1px solid var(--bs-border-color);
        border-radius: 10px;
        background: var(--portal-surface);
    }

    .ops-figures dt {
        font-size: .75rem;
        font-weight: 500;
        color: var(--bs-secondary-color);
    }

    .ops-figures dd {
        margin: 0;
        font-size: 1.125rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

.ops-bars {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .35rem;
}

.ops-bar {
    display: grid;
    grid-template-columns: 3.5rem 1fr 6.5rem;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

.ops-bar-track {
    height: .6rem;
    border-radius: 999px;
    overflow: hidden;
    background: var(--portal-surface-2);
}

.ops-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--emto-green);
}

/* A tile that opens a page through its title (stretched-link), so it can still hold other links */
.portal-tile-link {
    position: relative;
}

    .portal-tile-link:hover {
        transform: translateY(-2px);
        box-shadow: var(--portal-shadow-lg);
    }

tr[role=button] {
    cursor: pointer;
}

.ops-stops {
    list-style: none;
    padding-left: 0;
    display: grid;
    gap: .2rem;
}

.ops-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ops-docs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .75rem;
}

.ops-doc {
    margin: 0;
}

    .ops-doc > a {
        display: block;
    }

    .ops-doc img,
    .ops-doc-missing {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100px;
        object-fit: cover;
        border-radius: 8px;
        border: 1px solid var(--bs-border-color);
        background: var(--portal-surface-2);
    }

    .ops-doc-missing {
        border-style: dashed;
        color: var(--bs-secondary-color);
        font-size: 1.5rem;
    }

    .ops-doc .ops-doc-new {
        border: 2px solid var(--emto-green);
    }

    .ops-doc figcaption {
        display: grid;
        gap: .1rem;
        margin-top: .3rem;
        font-size: .8rem;
        color: var(--bs-secondary-color);
    }

.ops-doc-label {
    font-weight: 600;
    color: var(--bs-body-color);
}

/* When and where it was taken, or who replaced it */
.ops-doc-meta {
    display: flex;
    gap: .3rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.ops-doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .4rem;
}

/* Dialogs */
.portal-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1070;
    background: rgba(2, 6, 23, .5);
}

.portal-dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1080;
    width: min(520px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    background: var(--portal-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 18px;
    box-shadow: var(--portal-shadow-lg);
}

.portal-dialog-header,
.portal-dialog-footer {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem 1.25rem;
}

.portal-dialog-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--bs-border-color);
}

.portal-dialog-body {
    padding: 1.25rem;
    overflow-y: auto;
}

.portal-dialog-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--bs-border-color);
}

.portal-choice {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .8rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    cursor: pointer;
}

    .portal-choice.active {
        border-color: var(--emto-green);
        background: var(--emto-green-soft);
    }

    button.portal-choice:not(:disabled):hover {
        border-color: var(--emto-green);
    }

    /* One that can't be picked (the reservation page's vehicles on another trip, locked drivers) */
    button.portal-choice:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

/* The reservation page: vehicle type pictures, and each transporter's vehicles indented under it */
.reserve-type-image {
    width: 52px;
    height: 34px;
    flex-shrink: 0;
    object-fit: contain;
}

.reserve-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--portal-surface-2);
    color: var(--bs-secondary-color);
}

.reserve-vehicles {
    display: grid;
    gap: .4rem;
    padding-left: .75rem;
    border-left: 2px solid var(--bs-border-color);
}

.portal-stars {
    display: inline-flex;
    gap: .25rem;
}

.portal-star {
    border: 0;
    background: none;
    padding: 0;
    font-size: 1.75rem;
    line-height: 1;
    color: #f59e0b;
}

/* An offer's creative: its HTML on white, as the app's web view shows it, or its picture at full width */
.offer-creative {
    display: block;
    width: 100%;
    border: 0;
}

iframe.offer-creative {
    aspect-ratio: 12 / 5;
    background: #fff;
}

.portal-dialog-wide {
    width: min(720px, calc(100vw - 2rem));
}

.dispatch-map {
    height: min(50vh, 420px);
}

/* Console */
.portal-table {
    --bs-table-bg: transparent;
}

    .portal-table th {
        font-size: .75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--bs-secondary-color);
        white-space: nowrap;
    }

    .portal-table td {
        font-variant-numeric: tabular-nums;
    }

/* An invoice payment's share of a booking */
.invoice-share {
    max-width: 8rem;
}

/* Booking editor */
.editor-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.editor-stops {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.editor-stop {
    min-width: 0;
    margin: 0;
    padding: 1.25rem 0;
    border: 0;
}

    .editor-stop:first-child {
        padding-top: 0;
    }

    .editor-stop + .editor-stop {
        border-top: 1px solid var(--bs-border-color);
    }

    .editor-stop.dragging {
        opacity: .5;
    }

    .editor-stop.drop-target {
        outline: 2px dashed var(--bs-primary);
        outline-offset: 4px;
        border-radius: var(--portal-radius-sm);
    }

.editor-drag-handle {
    color: var(--bs-secondary-color);
    cursor: grab;
    touch-action: none;
}

.cargo-items {
    padding: .75rem;
    border-radius: var(--portal-radius-sm);
    background: var(--portal-surface-2);
}

.cargo-item + .cargo-item {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px dashed var(--bs-border-color);
}

.cargo-items .btn-link {
    margin-top: .5rem;
}

.address-picker {
    position: relative;
    min-width: 0;
}

.address-picker-value {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .5rem .5rem .85rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background: var(--portal-surface-2);
}

.address-picker-menu {
    position: absolute;
    z-index: 1040;
    left: 0;
    right: 0;
    top: calc(100% + .25rem);
    max-height: 20rem;
    overflow-y: auto;
    border-radius: var(--bs-border-radius);
}

.vehicle-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}

.vehicle-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .75rem .9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    background: var(--portal-surface);
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

    .vehicle-option:hover:not(:disabled) {
        border-color: rgba(var(--bs-primary-rgb), .55);
        transform: translateY(-1px);
    }

    .vehicle-option.selected {
        border-color: var(--emto-green);
        box-shadow: 0 0 0 .2rem var(--emto-green-soft);
    }

    .vehicle-option img {
        width: 3.75rem;
        height: 2.75rem;
        object-fit: contain;
        flex: 0 0 auto;
    }

.vehicle-option-icon {
    width: 3.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--emto-green);
    background: var(--emto-green-soft);
    border-radius: var(--portal-radius-sm);
}

.pay-option {
    display: flex;
    gap: .75rem;
    padding: .75rem .9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

    .pay-option:has(input:checked) {
        border-color: var(--emto-green);
        background: var(--emto-green-soft);
    }

.booking-summary-lines {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .35rem 1rem;
    margin-bottom: .75rem;
    font-variant-numeric: tabular-nums;
}

    .booking-summary-lines dt {
        font-weight: 500;
        color: var(--bs-secondary-color);
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .booking-summary-lines dd {
        margin: 0;
        text-align: right;
    }

    .booking-summary-lines .booking-summary-total {
        padding-top: .5rem;
        border-top: 1px solid var(--bs-border-color);
        font-size: 1.15rem;
        font-weight: 800;
        color: var(--bs-body-color);
    }

    .booking-summary-lines .booking-summary-due {
        font-weight: 700;
        color: var(--bs-body-color);
    }

@media (min-width: 992px) {
    .booking-action {
        position: sticky;
        top: calc(var(--portal-topbar-height) + 1rem);
        z-index: 5;
    }
}

.booking-action-total {
    font-size: 1.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.address-picker-heading {
    padding: .45rem .9rem .25rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    background: var(--portal-surface);
}

/* Live tracking: the map beside the booking's progress, driver, messages and stops; both start at the top and the map stays in view */
.track-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.track-map-card {
    position: relative;
    overflow: hidden;
}

@media (min-width: 992px) {
    .track-layout {
        grid-template-columns: minmax(0, 1fr) 380px;
    }

    .track-map-card {
        position: sticky;
        top: calc(var(--portal-topbar-height) + 1rem);
    }
}

.track-map {
    height: min(68vh, 620px);
    min-height: 320px;
}

.track-map-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--bs-secondary-color);
    background: var(--portal-surface-2);
}

    .track-map-empty > i {
        font-size: 2.25rem;
        color: var(--emto-green);
        margin-bottom: .75rem;
    }

.track-center {
    position: absolute;
    top: .75rem;
    right: .75rem;
    box-shadow: var(--portal-shadow);
}

.track-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem 1rem;
    padding: .75rem 1rem;
    border-top: 1px solid var(--bs-border-color);
}

.track-live {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

    .track-live.on {
        color: var(--emto-green-strong);
    }

.track-dot {
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: var(--bs-secondary-color);
}

.track-live.on .track-dot {
    background: var(--emto-green);
    animation: track-pulse 1.6s ease-out infinite;
}

@keyframes track-pulse {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); }
    100% { box-shadow: 0 0 0 .55rem rgba(22, 163, 74, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .track-live.on .track-dot {
        animation: none;
    }
}

/* Messages with the driver */
.driver-chat {
    overflow: hidden;
}

.driver-chat-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .875rem 1rem;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
}

    .driver-chat-head:hover {
        background: var(--portal-surface-2);
    }

.driver-chat-log {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-height: 22rem;
    overflow-y: auto;
    padding: .75rem 1rem;
    border-top: 1px solid var(--bs-border-color);
    background: var(--portal-surface-2);
}

.chat-msg {
    align-self: flex-start;
    max-width: 85%;
    padding: .45rem .7rem;
    border-radius: 12px 12px 12px 4px;
    background: var(--portal-surface);
    border: 1px solid var(--bs-border-color);
    overflow-wrap: anywhere;
}

    .chat-msg.mine {
        align-self: flex-end;
        border-radius: 12px 12px 4px 12px;
        border-color: transparent;
        background: var(--emto-green-soft);
    }

.chat-msg-who {
    font-size: .75rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
}

.chat-msg-reply {
    margin-bottom: .25rem;
    padding-left: .5rem;
    border-left: 3px solid var(--bs-border-color);
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.chat-msg-text {
    white-space: pre-wrap;
}

.chat-msg-image {
    display: block;
    max-width: 100%;
    max-height: 12rem;
    margin-top: .35rem;
    border-radius: 8px;
}

.chat-msg-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .25rem;
    margin-top: .15rem;
    font-size: .7rem;
    color: var(--bs-secondary-color);
}

.chat-msg-seen {
    color: #2563eb;
}

[data-bs-theme=dark] .chat-msg-seen {
    color: #93c5fd;
}

.driver-chat-compose {
    display: flex;
    gap: .5rem;
    padding: .75rem 1rem;
    border-top: 1px solid var(--bs-border-color);
}

.driver-chat-note {
    padding: 0 1rem .875rem;
}

.driver-chat-compose + .driver-chat-note,
.driver-chat-log + .driver-chat-note {
    padding-top: .75rem;
}

/* Share: one link, or a menu of the booking's and each drop's */
.share-menu {
    position: relative;
    display: inline-block;
}

    .share-menu > summary {
        list-style: none;
    }

        .share-menu > summary::-webkit-details-marker {
            display: none;
        }

    .share-menu .portal-menu-panel {
        left: 0;
        right: auto;
        min-width: 16rem;
        max-width: min(22rem, calc(100vw - 2rem));
    }

    .share-menu .portal-menu-item {
        white-space: normal;
    }

.portal-toast {
    position: fixed;
    left: 50%;
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
    z-index: 2000;
    transform: translateX(-50%);
    /* A longer note (a call that couldn't be placed) wraps across the screen, not within half of it */
    width: max-content;
    max-width: calc(100vw - 2rem);
    padding: .55rem 1rem;
    border-radius: 999px;
    background: var(--emto-navy);
    color: #fff;
    font-weight: 600;
    text-align: center;
    box-shadow: var(--portal-shadow-lg);
    transition: opacity .4s ease;
}

    .portal-toast.hide {
        opacity: 0;
    }

/* The shipper app's banner for a push while it's open: top of the page, above the bars */
.portal-snackbar-region {
    position: fixed;
    top: calc(.5rem + env(safe-area-inset-top));
    left: 50%;
    z-index: 2010;
    width: min(34rem, calc(100vw - 1.5rem));
    transform: translateX(-50%);
    pointer-events: none;
}

.portal-snackbar {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    width: 100%;
    padding: .75rem 1rem;
    border: 0;
    border-radius: 12px;
    background: #c71585;
    color: #fff;
    font: inherit;
    text-align: left;
    overflow-wrap: anywhere;
    box-shadow: var(--portal-shadow-lg);
    pointer-events: auto;
    cursor: pointer;
    animation: portal-snackbar-in .25s ease-out;
}

    .portal-snackbar:focus-visible {
        outline: 3px solid #fff;
        outline-offset: -5px;
    }

.portal-snackbar-title {
    font-weight: 700;
}

@keyframes portal-snackbar-in {
    from { opacity: 0; transform: translateY(-.75rem); }
}

@media (prefers-reduced-motion: reduce) {
    .portal-snackbar {
        animation: none;
    }
}

/* Top bar: the live connection pill */
.portal-live-badge {
    font-weight: 700;
    padding: .45em .8em;
}

/* Bookings search */
.bookings-search {
    position: relative;
}

    .bookings-search > i {
        position: absolute;
        top: 50%;
        left: .9rem;
        transform: translateY(-50%);
        color: var(--bs-secondary-color);
        pointer-events: none;
    }

    .bookings-search .form-control {
        padding-left: 2.4rem;
    }

/* Session details in the home page's greeting */
.session-stars {
    color: #fbbf24;
}

.session-tier {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.session-tier-swatch {
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .5);
}

/* EMTO Plus: the app's banner on the home page's greeting, and the plans */
.emto-plus-card {
    display: block;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(34, 197, 94, .75);
    border-radius: var(--portal-radius-sm);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    text-decoration: none;
    transition: background-color .15s ease;
}

    .emto-plus-card:hover {
        color: #fff;
        background: rgba(255, 255, 255, .12);
    }

.emto-plus-brand {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

    .emto-plus-brand img {
        display: block;
        width: auto;
    }

.emto-plus-status {
    background: var(--emto-green);
    color: #fff;
    font-weight: 700;
}

.emto-plus-expires {
    color: #fdba74;
}

.emto-plus-plan {
    display: block;
    width: 100%;
    padding: 1rem 1.125rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius);
    background: var(--portal-surface);
    color: inherit;
    font: inherit;
    text-align: left;
    box-shadow: var(--portal-shadow);
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .emto-plus-plan:hover:not(:disabled) {
        border-color: rgba(var(--bs-primary-rgb), .55);
    }

    .emto-plus-plan.selected {
        border-color: var(--emto-green);
        box-shadow: 0 0 0 .2rem var(--emto-green-soft);
    }

.emto-plus-benefits {
    margin: .6rem 0 0;
    padding-left: 1.1rem;
    font-size: .875rem;
    color: var(--bs-secondary-color);
}

    .emto-plus-benefits li + li {
        margin-top: .15rem;
    }

.emto-plus-yearly {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0;
    padding: .75rem .9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    cursor: pointer;
}

    .emto-plus-yearly.selected {
        border-color: var(--emto-green);
        background: var(--emto-green-soft);
    }

/* Console: vehicle types and campaigns */
.vehicle-type-thumb {
    width: 88px;
    height: 64px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: var(--portal-radius-sm);
    background: var(--portal-surface-2);
}

.vehicle-type-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    border-radius: var(--portal-radius-sm);
    background: var(--portal-surface-2);
    overflow: hidden;
}

    .vehicle-type-image img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.console-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto;
    gap: .5rem;
    align-items: end;
}

.console-rate-button {
    display: flex;
    align-items: center;
    gap: .4rem;
    width: 100%;
    min-height: calc(1.5em + .75rem + 2px);
    padding: .375rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background: var(--portal-surface);
    color: inherit;
    text-align: left;
}

    .console-rate-button:hover {
        border-color: var(--emto-green);
    }

    .console-rate-button.incomplete {
        border-color: var(--bs-danger-border-subtle);
        color: var(--bs-danger-text-emphasis);
    }

.console-subcard {
    padding: .75rem .9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    background: var(--portal-surface);
}

.campaign-thumb {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: var(--portal-radius-sm);
}

.campaign-card-frame {
    display: block;
    width: 100%;
    height: 200px;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    background: #fff;
    pointer-events: none;
}

.console-row-link {
    cursor: pointer;
}

    .console-row-link:hover > td {
        background: var(--portal-surface-2);
    }

.campaign-creative-frame {
    width: 100%;
    height: 420px;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    background: #fff;
}

.campaign-creative-image {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: var(--portal-radius-sm);
}

/* System Settings: a row per setting, changed rows tinted, and the save bar kept in view */
.system-setting {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

    .system-setting:last-child {
        border-bottom: 0;
    }

    .system-setting.changed {
        background: var(--bs-warning-bg-subtle);
    }

.system-setting-control {
    flex: 0 0 16rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .25rem;
}

    .system-setting-control .form-control {
        width: 100%;
    }

.console-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 1010;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    padding: .75rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--portal-radius-sm);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-lg);
}

/* Regions: the tree of places and the selected one's map */
.region-tree {
    padding: .35rem;
    max-height: calc(100vh - 13rem);
    overflow: auto;
}

.region-tree-item {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: 0 .35rem 0 calc(.35rem + var(--depth, 0) * 1.25rem);
    border-radius: var(--portal-radius-sm);
}

    .region-tree-item:hover {
        background: var(--portal-surface-2);
    }

    .region-tree-item.active {
        background: var(--bs-primary-bg-subtle);
    }

.region-tree-toggle {
    flex: 0 0 1.5rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
}

.region-tree-name {
    flex: 1;
    min-width: 0;
    padding: .3rem .25rem;
    border: 0;
    background: none;
    color: inherit;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.region-tree-changed {
    font-size: .5rem;
    color: var(--bs-warning);
}

/* A place's colour on the map */
.region-swatch {
    flex: 0 0 1rem;
    height: 1rem;
    border: 2px solid var(--swatch);
    border-radius: 50%;
    background: color-mix(in srgb, var(--swatch) 30%, transparent);
}

.region-map {
    height: 340px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
}

@media (max-width: 575.98px) {
    .system-setting {
        flex-direction: column;
        gap: .5rem;
    }

    .system-setting-control {
        flex-basis: auto;
        width: 100%;
        align-items: flex-start;
    }
}

/* Messaging: the conversations beside the open one, which fills the rest of the window */
.msg-live {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

    .msg-live i {
        font-size: .5rem;
        color: #9ca3af;
    }

    .msg-live.on i {
        color: var(--emto-green-bright);
        animation: msg-pulse 2s ease-in-out infinite;
    }

@keyframes msg-pulse {
    50% {
        opacity: .35;
    }
}

.msg-app {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1rem;
    height: calc(100dvh - var(--portal-topbar-height) - 3rem);
    min-height: 520px;
}

.msg-list,
.msg-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.msg-list-head {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: .75rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.msg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.msg-tab {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .6rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: none;
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    font-weight: 600;
}

    .msg-tab:hover {
        background: var(--portal-surface-2);
        color: var(--bs-body-color);
    }

    .msg-tab.active {
        border-color: var(--bs-border-color);
        background: var(--portal-surface-2);
        color: var(--bs-body-color);
    }

.msg-tab-count {
    min-width: 1.25rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: var(--bs-border-color);
    color: var(--bs-body-color);
    font-size: .7rem;
    line-height: 1.25rem;
    text-align: center;
}

    .msg-tab-count.hot {
        background: var(--emto-green);
        color: #fff;
    }

.msg-list-body {
    flex: 1;
    overflow-y: auto;
}

.msg-list-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--bs-secondary-color);
}

    .msg-list-empty i {
        display: block;
        margin-bottom: .5rem;
        font-size: 2rem;
        opacity: .5;
    }

.msg-item {
    display: flex;
    gap: .75rem;
    width: 100%;
    padding: .7rem .75rem;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    border-left: 3px solid transparent;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
}

    .msg-item:hover {
        background: var(--portal-surface-2);
    }

    .msg-item.active {
        border-left-color: var(--emto-green);
        background: var(--emto-green-soft);
    }

    .msg-item.unread .msg-item-name,
    .msg-item.unread .msg-item-preview {
        font-weight: 700;
        color: var(--bs-body-color);
    }

.msg-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: .875rem;
    font-weight: 700;
    color: #fff;
    background: var(--emto-navy-2);
}

.msg-avatar-driver {
    background: var(--emto-green-strong);
}

.msg-avatar-booking {
    background: #b45309;
    font-size: 1.05rem;
}

.msg-item-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.msg-item-top,
.msg-item-sub {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
}

.msg-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.msg-item-time {
    flex: 0 0 auto;
    font-size: .75rem;
    color: var(--bs-secondary-color);
}

.msg-item-preview {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .8125rem;
    color: var(--bs-secondary-color);
}

.msg-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: 0 .4rem;
    border-radius: 6px;
    background: var(--portal-surface-2);
    border: 1px solid var(--bs-border-color);
    font-size: .7rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.msg-chip-owner {
    color: #0369a1;
}

.msg-unread {
    flex: 0 0 auto;
    min-width: 1.25rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: var(--emto-green);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
}

.msg-pane {
    position: relative;
}

.msg-pane-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 2rem;
    text-align: center;
    color: var(--bs-secondary-color);
}

    .msg-pane-empty > i {
        font-size: 2.75rem;
        opacity: .45;
    }

.msg-pane-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.msg-pane-title {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 700;
}

.msg-pane-status {
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.msg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.msg-action-label {
    margin-left: .3rem;
}

.msg-banner {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .5rem 1rem 0;
    padding: .45rem .75rem;
    border-radius: var(--portal-radius-sm);
    font-size: .8125rem;
}

.btn-close-sm {
    width: .6rem;
    height: .6rem;
    background-size: .6rem;
    flex: 0 0 auto;
}

.msg-banner-ok {
    background: var(--emto-green-soft);
    color: var(--emto-green-strong);
}

.msg-banner-error {
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
}

.msg-context {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    font-size: .8125rem;
}

.msg-person,
.msg-shortcut {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: 100%;
    padding: .2rem .55rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background: var(--portal-surface);
}

.msg-person-role {
    font-weight: 700;
    color: var(--bs-secondary-color);
}

.msg-shortcut {
    color: var(--bs-link-color);
    text-decoration: none;
    font-weight: 600;
}

    .msg-shortcut:hover {
        background: var(--portal-surface-2);
    }

.msg-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
    background: var(--portal-surface-2);
}

.msg-log-empty {
    margin: auto;
    color: var(--bs-secondary-color);
}

.msg-day {
    display: flex;
    justify-content: center;
    margin: .75rem 0 .25rem;
}

    .msg-day span {
        padding: .15rem .65rem;
        border-radius: 999px;
        background: var(--portal-surface);
        border: 1px solid var(--bs-border-color);
        font-size: .72rem;
        font-weight: 600;
        color: var(--bs-secondary-color);
    }

.msg-event {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .75rem;
    color: var(--bs-secondary-color);
}

.msg-row {
    display: flex;
}

    .msg-row.out {
        justify-content: flex-end;
    }

.msg-bubble {
    position: relative;
    max-width: min(78%, 34rem);
    padding: .45rem .7rem .3rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 14px 14px 14px 4px;
    background: var(--portal-surface);
    overflow-wrap: anywhere;
    transition: box-shadow .3s;
}

.msg-row.out .msg-bubble {
    border-radius: 14px 14px 4px 14px;
    border-color: transparent;
    background: #dcfce7;
}

[data-bs-theme=dark] .msg-row.out .msg-bubble {
    background: #14532d;
}

.msg-row.out .msg-bubble:not(.mine) {
    background: #e0f2fe;
}

[data-bs-theme=dark] .msg-row.out .msg-bubble:not(.mine) {
    background: #0c4a6e;
}

.msg-flash .msg-bubble {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .6);
}

.msg-who {
    font-size: .75rem;
    font-weight: 700;
    color: var(--emto-green-strong);
}

.msg-row.out .msg-who {
    color: #0369a1;
}

.msg-quote {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    margin: .2rem 0 .35rem;
    padding: .3rem .5rem;
    border: 0;
    border-left: 3px solid var(--emto-green);
    border-radius: 6px;
    background: rgba(0, 0, 0, .05);
    color: inherit;
    font: inherit;
    text-align: left;
}

    .msg-quote img {
        width: 36px;
        height: 36px;
        object-fit: cover;
        border-radius: 4px;
    }

.msg-quote-who {
    display: block;
    font-size: .72rem;
    font-weight: 700;
}

.msg-quote-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.msg-photos {
    display: grid;
    gap: 4px;
    margin: .2rem 0;
}

    .msg-photos.many {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.msg-photo {
    padding: 0;
    border: 0;
    background: none;
    border-radius: 8px;
    overflow: hidden;
}

    .msg-photo img {
        display: block;
        width: 100%;
        max-height: 16rem;
        object-fit: cover;
    }

.msg-photos.many .msg-photo img {
    height: 8rem;
}

.msg-video {
    display: block;
    width: 100%;
    max-width: 22rem;
    max-height: 18rem;
    margin: .2rem 0;
    border-radius: 8px;
    background: #000;
}

.msg-audio {
    display: block;
    width: 16rem;
    max-width: 100%;
    margin: .25rem 0;
}

.msg-doc {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .2rem 0;
    padding: .45rem .6rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--portal-surface);
    color: inherit;
    text-decoration: none;
}

    .msg-doc > i:first-child {
        font-size: 1.4rem;
        color: #b91c1c;
    }

.msg-text {
    white-space: pre-wrap;
}

.msg-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .3rem;
    margin-top: .1rem;
    font-size: .7rem;
    color: var(--bs-secondary-color);
}

.msg-seen {
    color: #2563eb;
}

[data-bs-theme=dark] .msg-seen {
    color: #93c5fd;
}

.msg-reply-btn {
    padding: 0 .2rem;
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
    opacity: 0;
}

.msg-bubble:hover .msg-reply-btn,
.msg-reply-btn:focus-visible {
    opacity: 1;
}

.msg-new-below {
    position: absolute;
    left: 50%;
    bottom: 9rem;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .8rem;
    border: 0;
    border-radius: 999px;
    background: var(--emto-navy);
    color: #fff;
    font-size: .8rem;
    box-shadow: var(--portal-shadow);
}

.msg-compose {
    padding: .6rem .75rem .5rem;
    border-top: 1px solid var(--bs-border-color);
}

.msg-dropping .msg-compose {
    outline: 2px dashed var(--emto-green);
    outline-offset: -4px;
}

.msg-compose-reply {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
    padding: .35rem .6rem;
    border-left: 3px solid var(--emto-green);
    border-radius: 6px;
    background: var(--portal-surface-2);
    font-size: .8125rem;
}

.msg-files {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .5rem;
}

.msg-file {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    max-width: 16rem;
    padding: .25rem .4rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--portal-surface-2);
    font-size: .8rem;
}

    .msg-file img {
        width: 36px;
        height: 36px;
        object-fit: cover;
        border-radius: 4px;
    }

    .msg-file > i {
        font-size: 1.3rem;
        color: var(--bs-secondary-color);
    }

.msg-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .msg-file-name small {
        display: block;
        color: var(--bs-secondary-color);
    }

.msg-to {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin-bottom: .5rem;
}

.msg-to-person {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .15rem .55rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background: var(--portal-surface);
    color: var(--bs-secondary-color);
    font-size: .8rem;
}

    .msg-to-person.on {
        border-color: var(--emto-green);
        background: var(--emto-green-soft);
        color: var(--emto-green-strong);
        font-weight: 600;
    }

.msg-compose-row {
    display: flex;
    align-items: flex-end;
    gap: .4rem;
}

.msg-attach {
    margin: 0;
    cursor: pointer;
}

.msg-input {
    min-height: 40px;
    max-height: 180px;
    resize: none;
}

.msg-send {
    width: 44px;
    height: 40px;
    padding: 0;
    flex: 0 0 auto;
}

.msg-recording {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 40px;
    padding: 0 .5rem;
    border-radius: var(--portal-radius-sm);
    background: rgba(239, 68, 68, .08);
    font-weight: 600;
}

.msg-rec-dot {
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    background: #ef4444;
    animation: msg-pulse 1s ease-in-out infinite;
}

.msg-compose-error {
    margin-top: .35rem;
    font-size: .8rem;
    color: #b91c1c;
}

.msg-compose-hint {
    margin-top: .3rem;
    font-size: .7rem;
    color: var(--bs-secondary-color);
}

.msg-locked {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    border-top: 1px solid var(--bs-border-color);
    font-size: .875rem;
    color: var(--bs-secondary-color);
}

@media (max-width: 991.98px) {
    .msg-app {
        grid-template-columns: minmax(0, 1fr);
        height: calc(100dvh - var(--portal-topbar-height) - 2rem);
    }

    .msg-app .msg-pane,
    .msg-app-open .msg-list {
        display: none;
    }

    .msg-app-open .msg-pane {
        display: flex;
    }

    .msg-action-label,
    .msg-compose-hint {
        display: none;
    }
}

/* Console dashboard: filters, figure tiles, and charts (columns, rings, bars, heat) in the series colours dash-c1..8 */
.dash-c1 { --dash-color: #16a34a; }
.dash-c2 { --dash-color: #2563eb; }
.dash-c3 { --dash-color: #f59e0b; }
.dash-c4 { --dash-color: #dc2626; }
.dash-c5 { --dash-color: #7c3aed; }
.dash-c6 { --dash-color: #0891b2; }
.dash-c7 { --dash-color: #94a3b8; }
.dash-c8 { --dash-color: #db2777; }

[data-bs-theme=dark] .dash-c1 { --dash-color: #22c55e; }
[data-bs-theme=dark] .dash-c2 { --dash-color: #60a5fa; }
[data-bs-theme=dark] .dash-c3 { --dash-color: #fbbf24; }
[data-bs-theme=dark] .dash-c4 { --dash-color: #f87171; }
[data-bs-theme=dark] .dash-c5 { --dash-color: #a78bfa; }
[data-bs-theme=dark] .dash-c6 { --dash-color: #22d3ee; }
[data-bs-theme=dark] .dash-c7 { --dash-color: #64748b; }
[data-bs-theme=dark] .dash-c8 { --dash-color: #f472b6; }

.dash-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

.dash-presets {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .125rem;
    padding: .2rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background: var(--portal-surface);
}

.dash-preset {
    border: 0;
    border-radius: 999px;
    padding: .3rem .75rem;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
}

    .dash-preset:hover:not(:disabled):not(.active) {
        background: var(--portal-surface-2);
        color: var(--bs-body-color);
    }

    .dash-preset.active {
        background: var(--emto-green);
        color: #fff;
    }

    .dash-preset:disabled {
        opacity: .4;
    }

.dash-dates {
    display: flex;
    align-items: center;
    gap: .4rem;
}

    .dash-dates input {
        width: 9.25rem;
    }

.dash-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: .75rem;
}

.dash-kpi {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1rem 1.1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
    color: inherit;
    --dash-tone: var(--emto-green);
    --dash-tone-soft: var(--emto-green-soft);
}

a.dash-kpi {
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

    a.dash-kpi:hover {
        color: inherit;
        transform: translateY(-2px);
        border-color: var(--dash-tone);
        box-shadow: var(--portal-shadow-lg);
    }

.dash-tone-info { --dash-tone: #2563eb; --dash-tone-soft: rgba(37, 99, 235, .12); }
.dash-tone-warning { --dash-tone: #d97706; --dash-tone-soft: rgba(245, 158, 11, .15); }
.dash-tone-danger { --dash-tone: #dc2626; --dash-tone-soft: rgba(220, 38, 38, .12); }
.dash-tone-violet { --dash-tone: #7c3aed; --dash-tone-soft: rgba(124, 58, 237, .12); }
.dash-tone-secondary { --dash-tone: #64748b; --dash-tone-soft: rgba(100, 116, 139, .14); }

[data-bs-theme=dark] .dash-tone-info { --dash-tone: #60a5fa; }
[data-bs-theme=dark] .dash-tone-warning { --dash-tone: #fbbf24; }
[data-bs-theme=dark] .dash-tone-danger { --dash-tone: #f87171; }
[data-bs-theme=dark] .dash-tone-violet { --dash-tone: #a78bfa; }
[data-bs-theme=dark] .dash-tone-secondary { --dash-tone: #94a3b8; }

.dash-kpi-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    color: var(--bs-secondary-color);
    font-size: .8rem;
    font-weight: 600;
}

.dash-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--dash-tone-soft);
    color: var(--dash-tone);
}

.dash-kpi-value {
    margin-top: .55rem;
    font-size: 1.55rem;
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.dash-kpi-detail {
    margin-top: .2rem;
    color: var(--bs-secondary-color);
    font-size: .78rem;
}

.dash-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
}

    .dash-card-head .portal-section-title {
        margin: 0;
    }

.dash-card-note {
    color: var(--bs-secondary-color);
    font-size: .75rem;
}

.dash-empty {
    padding: 2rem 1rem;
    color: var(--bs-secondary-color);
    font-size: .875rem;
    text-align: center;
}

.dash-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    margin: .75rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--bs-secondary-color);
    font-size: .8rem;
}

    .dash-legend li {
        display: inline-flex;
        align-items: center;
        gap: .4rem;
    }

.dash-dot,
.dash-key {
    display: inline-block;
    flex-shrink: 0;
    width: .65rem;
    height: .65rem;
    border-radius: 3px;
    background: var(--dash-color);
}

.dash-key {
    margin: 0 .3rem 0 .15rem;
    vertical-align: -.05rem;
}

/* Columns: an axis with half and top lines; stacked series from the first up */
.dash-columns {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    height: calc(var(--dash-height, 200px) + 1.6rem);
    padding-bottom: 1.6rem;
}

.dash-axis {
    position: relative;
    width: 2.75rem;
}

    .dash-axis span {
        position: absolute;
        right: .5rem;
        transform: translateY(50%);
        color: var(--bs-secondary-color);
        font-size: .7rem;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

.dash-plot {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    border-bottom: 1px solid var(--bs-border-color);
}

.dash-gridline {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed var(--bs-border-color);
    pointer-events: none;
}

.dash-col {
    position: relative;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
    height: 100%;
}

.dash-col-bar {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    max-width: 44px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 5px 5px 0 0;
    transition: filter .15s ease;
}

    .dash-col-bar > span {
        display: block;
        flex-basis: 0;
        min-height: 0;
        background: var(--dash-color);
    }

.dash-col:hover .dash-col-bar {
    filter: brightness(1.12) saturate(1.1);
}

.dash-col-label {
    position: absolute;
    top: calc(100% + .35rem);
    left: 50%;
    transform: translateX(-50%);
    color: var(--bs-secondary-color);
    font-size: .68rem;
    white-space: nowrap;
}

/* Rings */
.dash-donut {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}

.dash-donut-ring {
    position: relative;
    flex-shrink: 0;
    width: var(--dash-size, 150px);
    aspect-ratio: 1;
}

    .dash-donut-ring svg {
        display: block;
        width: 100%;
        height: 100%;
    }

.dash-donut-track {
    stroke: var(--portal-surface-2);
}

.dash-donut-slice {
    stroke: var(--dash-color);
    transition: stroke-width .15s ease;
}

    .dash-donut-slice:hover {
        stroke-width: 6.5;
    }

.dash-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.dash-donut-value {
    font-size: 1.3rem;
    font-weight: 750;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.dash-donut-label {
    color: var(--bs-secondary-color);
    font-size: .72rem;
}

.dash-donut-legend {
    display: grid;
    flex: 1 1 11rem;
    gap: .4rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .85rem;
}

    .dash-donut-legend li {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto 3rem;
        align-items: center;
        gap: .5rem;
        font-variant-numeric: tabular-nums;
    }

.dash-share {
    color: var(--bs-secondary-color);
    font-size: .75rem;
    text-align: right;
}

/* Bars */
.dash-bars {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dash-bar {
    display: grid;
    grid-template-columns: minmax(6rem, 40%) minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    font-size: .85rem;
}

.dash-bar-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .dash-bar-label small {
        margin-left: .35rem;
        color: var(--bs-secondary-color);
    }

.dash-bar-track {
    height: .55rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--portal-surface-2);
}

.dash-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--dash-color);
}

.dash-bar-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* Heat: weekday by hour */
.dash-heat-wrap {
    overflow-x: auto;
}

.dash-heat {
    display: grid;
    grid-template-columns: 2.25rem repeat(24, minmax(0, 1fr));
    gap: 3px;
    min-width: 540px;
    color: var(--bs-secondary-color);
    font-size: .68rem;
}

.dash-heat-cell {
    display: block;
    min-height: 14px;
    aspect-ratio: 1.4;
    border-radius: 3px;
    background: rgba(22, 163, 74, calc(.06 + var(--dash-heat, 0) * .94));
}

[data-bs-theme=dark] .dash-heat-cell {
    background: rgba(34, 197, 94, calc(.08 + var(--dash-heat, 0) * .92));
}

.dash-heat-hour {
    overflow: visible;
    white-space: nowrap;
}

.dash-heat-day {
    align-self: center;
}

.dash-heat-scale {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .25rem;
    margin-top: .6rem;
    color: var(--bs-secondary-color);
    font-size: .72rem;
}

    .dash-heat-scale .dash-heat-cell {
        width: 14px;
        min-height: 0;
        height: 14px;
        aspect-ratio: auto;
    }

/* Money: the gross margin's lines */
.dash-ledger {
    display: grid;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .875rem;
    font-variant-numeric: tabular-nums;
}

    .dash-ledger li {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
    }

.dash-ledger-total {
    margin-top: .35rem;
    padding-top: .5rem;
    border-top: 1px solid var(--bs-border-color);
    font-weight: 700;
}

/* Transporters who keep carrying for the same shippers */
.dash-pairs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: .75rem;
}

.dash-pair {
    padding: .75rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    background: var(--portal-surface);
}

.dash-pair-list {
    display: grid;
    gap: .3rem;
    margin: .5rem 0 0;
    padding: 0;
    list-style: none;
    font-size: .85rem;
}

    .dash-pair-list li {
        display: flex;
        align-items: center;
        gap: .5rem;
    }

@media (max-width: 767.98px) {
    .dash-col-label-alt {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .dash-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-kpi-value {
        font-size: 1.25rem;
    }

    .dash-axis {
        width: 2.25rem;
    }

    .dash-bar {
        grid-template-columns: minmax(5rem, 38%) minmax(0, 1fr) auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    a.dash-kpi,
    .dash-col-bar,
    .dash-donut-slice {
        transition: none;
    }
}
