/* Roadie Driver Web App — mobile-app-like UI */

:root {
    /* Light-only app: also set here so Chrome's force-dark opts out even if the
       meta tag is stripped by a proxy/translator. */
    color-scheme: light;
    --rd-primary: #004f50;
    --rd-primary-dark: #003a3b;
    --rd-bg: #F5F5F5;
    --rd-card: #FFFFFF;
    --rd-text: #1A1A1A;
    --rd-text-secondary: #666666;
    --rd-border: #E0E0E0;
    --rd-success: #4CAF50;
    --rd-danger: #F44336;
    --rd-warning: #FF9800;
    --rd-blue: #2196F3;
    --rd-radius: 8px;
    --rd-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#rdApp {
    max-width: 960px;
    margin: 0 auto;
    background: var(--rd-bg);
    border-radius: var(--rd-radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--rd-text);
    position: relative;
}

/* Hero section with a dismissible X. Closing collapses it to a thin full-width
   bar ("Show intro") that restores the hero when clicked. */
#rdHero {
    position: relative;
}
.rd-hero-restore {
    display: none;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    text-align: center;
}
.rd-hero-restore::after { content: ' \25BE'; opacity: .85; }
.rd-hero-restore:hover { background: rgba(255, 255, 255, 0.1); }
#rdHero.rd-hero-collapsed { padding: 0 !important; }
#rdHero.rd-hero-collapsed .container,
#rdHero.rd-hero-collapsed .rd-hero-close { display: none; }
#rdHero.rd-hero-collapsed .rd-hero-restore { display: block; }

/* Backstop: never let the dashboard content push the page wider than the screen
   (clip, not hidden/scroll, so sticky positioning is unaffected). */
.driver-page--bot { overflow-x: clip; }
.rd-hero-close {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 5;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    transition: background .15s;
}
.rd-hero-close:hover { background: rgba(255, 255, 255, 0.32); }

/* Shown instead of the login form while a saved session is being resumed */
#rdRestoring {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    background: linear-gradient(135deg, #004f50 0%, #1a7a7b 100%);
}

html[data-rd-restoring] #rdRestoring {
    display: flex;
}

html[data-rd-restoring] #rdLogin {
    display: none !important;
}

.rd-restoring-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: rd-restoring-spin 0.9s linear infinite;
}

@keyframes rd-restoring-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .rd-restoring-spinner {
        animation: none;
    }
}

/* Login Screen */
#rdLogin {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    padding: 40px 24px;
    background: linear-gradient(135deg, #004f50 0%, #1a7a7b 100%);
}

#rdLogin .rd-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

#rdLogin .rd-logo svg {
    width: 48px;
    height: 48px;
    fill: var(--rd-primary);
}

#rdLogin h2 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

#rdLogin .rd-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin-bottom: 32px;
}

.rd-input-group {
    width: 100%;
    max-width: 420px;
    margin-bottom: 16px;
}

.rd-input-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.rd-input-group input,
.rd-input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.rd-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.rd-input-group input:focus,
.rd-input-group select:focus {
    border-color: white;
    background: rgba(255, 255, 255, 0.25);
}

.rd-input-group select {
    appearance: none;
    cursor: pointer;
}

.rd-input-group select option {
    color: var(--rd-text);
    background: white;
}

.rd-btn {
    width: 100%;
    max-width: 420px;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.rd-btn-login {
    background: white;
    color: var(--rd-primary);
    margin-top: 8px;
}

.rd-btn-login:hover {
    background: #F0F0F0;
    transform: translateY(-1px);
}

.rd-btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#rdLoginError {
    color: #FFE0E0;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 12px;
    max-width: 420px;
    text-align: center;
    display: none;
}

/* Main App Layout */
#rdMain {
    display: none;
    flex-direction: column;
    height: 700px;
    max-height: 85vh;
    min-height: 460px;
    overflow: hidden;
    text-align: left;
}

/* Top Bar — height matches #rdAutoMain/#rdAutoLogMain .rd-auto-header so the two
   cards' header rows line up. */
.rd-topbar {
    background: var(--rd-primary);
    color: white;
    padding: 0 16px;
    min-height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rd-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rd-driver-name {
    font-size: 15px;
    font-weight: 600;
}

.rd-company-badge {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Visibility Toggle */
.rd-topbar-actions {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.4vw, 18px);
}

/* Content Area */
.rd-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 0;
}

/* Gig cards flow in a responsive grid, several per row filling the full width. */
.rd-orders-list {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: 8px;
}
.rd-orders-list > .rd-order-card {
    margin: 0;
}
/* The empty state and the sync badge span the full width of the grid. */
.rd-orders-list > .rd-empty-state,
.rd-orders-list > .rd-sync-countdown {
    grid-column: 1 / -1;
}
/* Sync badge pinned to the top-centre of the list: order:-1 renders it first (the top)
   even though it is appended last, and position:sticky keeps it there while scrolling. */
.rd-sync-countdown {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: .3px;
    background: #FFF3E0;
    color: #E65100;
    position: sticky;
    top: 0px;
    justify-self: center;
    order: -1;
    margin: 0;
    z-index: 2;
    text-align: center;
}
.rd-sync-countdown::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FF9800;
    flex-shrink: 0;
}
.rd-sync-countdown.live {
    background: #E8F5E9;
    color: #2E7D32;
}
.rd-sync-countdown.live::before {
    background: #4CAF50;
    box-shadow: 0 0 4px #4CAF50;
}
.rd-sync-countdown.syncing {
    background: #E3F2FD;
    color: #1565C0;
}
.rd-sync-countdown.syncing::before {
    background: #42A5F5;
    animation: rd-sync-pulse 1s ease-in-out infinite;
}
@keyframes rd-sync-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}
.rd-ellipsis span {
    animation: rd-ellipsis-fade 1.4s infinite;
    opacity: 0;
}
.rd-ellipsis span:nth-child(1) { animation-delay: 0s; }
.rd-ellipsis span:nth-child(2) { animation-delay: .2s; }
.rd-ellipsis span:nth-child(3) { animation-delay: .4s; }
@keyframes rd-ellipsis-fade {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}
.rd-sync-countdown[hidden] {
    display: none;
}

/* Filter bar — one row holding the search status + search/sort/Filters, always shown. */
.rd-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--rd-text-secondary);
    padding: 8px 12px;
    background: var(--rd-card);
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    margin: 0 0 10px;
}
.rd-filter-bar[hidden] { display: none; }
/* search status merged into the bar: inline text, not its own card */
.rd-filter-bar > .rd-search-status {
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    border-radius: 0;
}
.rd-filter-search,
.rd-filter-select {
    padding: 6px 8px;
    border: 1px solid var(--rd-border);
    border-radius: 4px;
    font-size: 13px;
    background: var(--rd-bg);
    color: var(--rd-text);
    outline: none;
    box-sizing: border-box;
    height: 32px;
}
.rd-filter-search {
    flex: 3 1 140px;
    min-width: 110px;
}
/* Numeric filters surfaced in the bar (moved from the drawer). The placeholder doubles
   as the label, so every control is the same 32px height, and they all flex to fill the
   row at any screen width. */
.rd-filter-bar .rd-filter-num {
    flex: 1 1 78px;
    min-width: 58px;
    height: 32px;
    padding: 5px 8px;
    border: 1px solid var(--rd-border);
    border-radius: 4px;
    font-size: 13px;
    background: var(--rd-bg);
    color: var(--rd-text);
    box-sizing: border-box;
    text-align: center;
}
.rd-filter-bar .rd-filter-num:focus {
    outline: none;
    border-color: var(--rd-primary);
}
.rd-filter-select {
    cursor: pointer;
    flex: 2 1 130px;
    min-width: 110px;
}
.rd-filter-search:focus,
.rd-filter-select:focus {
    border-color: var(--rd-primary);
}

/* Filter toggle button */
.rd-bar-filter-toggle {
    padding: 6px 12px;
    border: 1px solid var(--rd-border);
    border-radius: 4px;
    font-size: 13px;
    background: var(--rd-bg);
    color: var(--rd-text-secondary);
    cursor: pointer;
    height: 32px;
    flex: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.rd-bar-filter-toggle:hover { background: var(--rd-border); }
.rd-bar-filter-toggle[aria-expanded="true"] {
    background: var(--rd-primary);
    color: #fff;
    border-color: var(--rd-primary);
}
.rd-bar-filter-toggle.has-active {
    border-color: var(--rd-primary);
    color: var(--rd-primary);
    font-weight: 600;
}
.rd-bar-filter-toggle[aria-expanded="true"].has-active { color: #fff; }

/* Filter drawer — scrolls on its own; every control uses the filter bar's 32px metrics */
.rd-bar-filter-drawer {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 12px;
    max-height: min(360px, 45vh);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    box-sizing: border-box;
    min-width: 0;
    padding: 6px 12px 12px;
    /* Sit snug under the filter bar (which has a 10px bottom margin) so the drawer reads as
       an expansion of the Filters button, not a detached panel. */
    margin: -8px 0 10px;
    text-align: center;
    background: whitesmoke;
    color: #1c1c1c;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: var(--rd-radius);
}
.rd-bar-filter-drawer[hidden] { display: none; }
/* Plain beige drawer: dark, readable contents. */
.rd-bar-filter-drawer .rd-bar-section-title,
.rd-bar-filter-drawer .rd-bar-count,
.rd-bar-filter-drawer .rd-bar-toggle,
.rd-bar-filter-drawer .rd-bar-toggle span,
.rd-bar-filter-drawer .rd-bar-field > label,
.rd-bar-filter-drawer .rd-bar-label {
    color: #1c1c1c;
}
.rd-bar-filter-drawer .rd-bar-field input {
    background: #fff;
    color: var(--rd-text);
    border-color: rgba(0, 0, 0, 0.22);
}
/* Sticky header row inside the drawer: Clear all on the left, close (X) on the right. */
.rd-bar-filter-drawer .rd-bar-drawer-head {
    position: sticky;
    top: 0;
    z-index: 4;
    grid-row: 1;
    grid-column: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 0;
    background: transparent;   /* the lead section fills the centre of this row; the buttons float at its ends */
    pointer-events: none;      /* let clicks reach the fields lifted up behind it */
}
.rd-bar-filter-drawer .rd-bar-clear,
.rd-bar-filter-drawer .rd-bar-close { pointer-events: auto; }
/* Lift the first filter section up into the header row, so "Clear all" and the X flank it
   and consume the otherwise-empty middle of that row instead of sitting above a blank band. */
.rd-bar-filter-drawer .rd-bar-section--lead {
    grid-row: 1;
    grid-column: 1;
    padding: 0 104px;          /* reserve room at both ends for the flanking buttons */
}
.rd-bar-filter-drawer .rd-bar-clear {
    width: fit-content;
    margin: 0;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #1c1c1c;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.28);
    border-radius: 999px;
    cursor: pointer;
}
.rd-bar-filter-drawer .rd-bar-clear:hover { background: rgba(0, 0, 0, 0.12); }
.rd-bar-filter-drawer .rd-bar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    color: #1c1c1c;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.28);
    border-radius: 999px;
    cursor: pointer;
}
.rd-bar-filter-drawer .rd-bar-close:hover { background: rgba(0, 0, 0, 0.12); }
.rd-bar-filter-drawer .rd-bar-hint { color: var(--rd-text-secondary); }
.rd-bar-filter-drawer .rd-bar-section + .rd-bar-section,
.rd-bar-filter-drawer .rd-bar-actions {
    border-top-color: rgba(0, 0, 0, 0.12);
}
/* Selected size chip uses the primary fill. */
.rd-bar-filter-drawer .rd-size-chip.selected,
.rd-bar-filter-drawer .rd-bar-size-chip.selected,
.rd-bar-filter-drawer .rd-size-chip[aria-pressed="true"] {
    background: var(--rd-primary);
    color: #fff;
    border-color: var(--rd-primary);
}

.rd-bar-section { min-width: 0; margin: 0; }
.rd-bar-section + .rd-bar-section,
.rd-bar-actions {
    padding-top: 12px;
    border-top: 1px solid var(--rd-border);
}
.rd-bar-section-title {
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--rd-text-secondary);
    margin: 0 0 8px;
}
.rd-bar-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.rd-bar-field { flex: 0 1 124px; min-width: 0; margin: 0; }
.rd-bar-field.full { flex-basis: 100%; }
.rd-bar-filter-drawer .rd-bar-field > label,
.rd-bar-filter-drawer .rd-bar-label {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    color: #1c1c1c;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rd-bar-field input,
.rd-bar-toggle,
.rd-bar-size-chips .rd-size-chip,
.rd-bar-clear {
    height: 32px;
    box-sizing: border-box;
    margin: 0;
    border: 1px solid var(--rd-border);
    border-radius: 4px;
    background: var(--rd-bg);
    color: var(--rd-text);
    font-size: 13px;
    font-weight: 500;
}
.rd-bar-field input {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0 8px;
    text-align: center;
}
.rd-bar-field input::placeholder { color: var(--rd-text-secondary); opacity: .6; }
.rd-bar-field input:focus,
.rd-bar-toggle:focus-within,
.rd-bar-size-chips .rd-size-chip:focus-visible,
.rd-bar-clear:focus-visible { border-color: var(--rd-primary); outline: none; }
.rd-bar-field input[type="number"] { -moz-appearance: textfield; }
.rd-bar-field input[type="number"]::-webkit-inner-spin-button,
.rd-bar-field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.rd-bar-size-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.rd-bar-size-chips .rd-size-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 124px;
    min-width: 0;
    padding: 0 12px;
    line-height: 1;
    cursor: pointer;
}
.rd-bar-size-chips .rd-size-chip.selected {
    background: var(--rd-primary);
    border-color: var(--rd-primary);
    color: #fff;
}

.rd-bar-filter-drawer .rd-bar-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 150px;
    min-width: 0;
    padding: 0 10px;
    text-align: left;
    cursor: pointer;
}
.rd-bar-toggle input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--rd-primary); }
.rd-bar-toggle span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-bar-toggle:has(input:checked) { border-color: var(--rd-primary); color: var(--rd-primary); }

.rd-bar-hint {
    font-size: 12px;
    line-height: 16px;
    color: var(--rd-text-secondary);
    margin: 8px 0 0;
}

.rd-bar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.rd-bar-count { font-size: 12px; color: var(--rd-text-secondary); }
.rd-bar-clear {
    margin-left: auto;
    padding: 0 12px;
    color: var(--rd-text-secondary);
    cursor: pointer;
}
.rd-bar-clear:hover { color: var(--rd-primary); border-color: var(--rd-primary); }

/* Empty State */
.rd-empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--rd-text-secondary);
}

.rd-empty-state svg {
    width: 64px;
    height: 64px;
    fill: #CCC;
    margin-bottom: 16px;
}

.rd-empty-orders-animation {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.rd-empty-orders-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 2px solid transparent;
    border-radius: 50%;
}

.rd-empty-orders-orbit-primary {
    width: 60px;
    height: 60px;
    border-top-color: #0d6efd;
    border-right-color: rgba(13, 110, 253, .24);
    animation: rd-empty-orders-orbit-primary 2.8s linear infinite;
}

.rd-empty-orders-orbit-primary::after {
    position: absolute;
    top: 3px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #004f50;
    box-shadow: 0 0 0 3px rgba(0, 79, 80, .14);
    content: '';
}

.rd-empty-orders-orbit-secondary {
    width: 42px;
    height: 42px;
    border-bottom-color: #4caf50;
    border-left-color: rgba(76, 175, 80, .2);
    border-style: dashed;
    animation: rd-empty-orders-orbit-secondary 3.6s linear infinite;
}

.rd-empty-orders-package {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 21px;
    border: 2px solid #004f50;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(72, 81, 92, .16);
    animation: rd-empty-orders-package 1.1s ease-in-out infinite;
}

.rd-empty-orders-package::before {
    position: absolute;
    top: -6px;
    left: -4px;
    width: 28px;
    height: 6px;
    border: 2px solid #004f50;
    border-radius: 3px 3px 1px 1px;
    background: #fff;
    content: '';
}

.rd-empty-orders-package::after {
    position: absolute;
    top: -4px;
    bottom: 0;
    left: 8px;
    width: 4px;
    background: rgba(0, 79, 80, .22);
    content: '';
}

.rd-empty-orders-spark {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #4caf50;
    animation: rd-empty-orders-spark 1.4s ease-in-out infinite;
}

.rd-empty-orders-spark-one {
    top: 8px;
    left: 13px;
}

.rd-empty-orders-spark-two {
    right: 11px;
    bottom: 8px;
    width: 4px;
    height: 4px;
    background: #0d6efd;
    animation-delay: .7s;
}

@keyframes rd-empty-orders-orbit-primary {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes rd-empty-orders-orbit-secondary {
    from {
        transform: translate(-50%, -50%) rotate(360deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

@keyframes rd-empty-orders-package {

    0%,
    100% {
        transform: translate(-50%, -50%) translateY(2px) scale(.96);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-2px) scale(1.04);
    }
}

@keyframes rd-empty-orders-spark {

    0%,
    100% {
        transform: scale(.65);
        opacity: .45;
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

.rd-empty-state h3 {
    font-size: 18px;
    color: var(--rd-text);
    margin-bottom: 8px;
}

.rd-empty-state p {
    font-size: 14px;
}

.rd-empty-state .rd-offline-prompt {
    color: #c62828;
    font-size: 15px;
    font-weight: 900;
}

#rdOrdersList .rd-empty-state h3 .rd-empty-orders-ellipsis>span {
    display: inline-block;
    width: .38em;
    opacity: .25;
    -webkit-animation: rd-empty-orders-ellipsis-pulse .9s ease-in-out infinite;
    animation-name: rd-empty-orders-ellipsis-pulse;
    animation-duration: .9s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

#rdOrdersList .rd-empty-state h3 .rd-empty-orders-ellipsis>span:nth-child(2) {
    animation-delay: .16s;
}

#rdOrdersList .rd-empty-state h3 .rd-empty-orders-ellipsis>span:nth-child(3) {
    animation-delay: .32s;
}

@-webkit-keyframes rd-empty-orders-ellipsis-pulse {

    0%,
    70%,
    100% {
        opacity: .25;
    }

    35% {
        opacity: 1;
    }
}

@keyframes rd-empty-orders-ellipsis-pulse {

    0%,
    70%,
    100% {
        opacity: .25;
    }

    35% {
        opacity: 1;
    }
}

/* Order Cards */
/* Cards auto-fit their content height; the grid's default align-items:stretch makes
   every card in a row match the tallest one, so each row is uniform without scrolling. */
.rd-order-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: var(--rd-card);
    margin: 8px 12px;
    border-radius: var(--rd-radius);
    box-shadow: var(--rd-shadow);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--rd-border);
}

.rd-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rd-border);
}

.rd-order-id {
    flex: 1;
    min-width: 0;
    font-weight: 700;
    font-size: 14px;
    /* Keep the order/title on a single line; truncate with an ellipsis instead of wrapping. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rd-order-status {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.rd-order-status.unassigned,
.rd-order-status.assigned {
    background: #E3F2FD;
    color: #1565C0;
}

.rd-order-status.picked-up,
.rd-order-status.comp-for-arriving {
    background: #FFF3E0;
    color: #E65100;
}

.rd-order-status.accepted {
    background: #E8F5E9;
    color: #2E7D32;
}

.rd-order-status.completed {
    background: #E0F2F1;
    color: #00695C;
}

.rd-order-pay {
    display: flex;
    gap: 1px;
    background: var(--rd-border);
    border-bottom: 1px solid var(--rd-border);
}

.rd-order-pay-cell {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--rd-card);
    padding: 10px 10px;
    text-align: center;
}

.rd-order-pay-label {
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--rd-text-secondary);
}

.rd-order-pay-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--rd-text);
    margin-top: 2px;
    white-space: nowrap;
}

.rd-order-pay-cell.primary .rd-order-pay-value {
    color: var(--rd-success);
}

.rd-order-body {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    text-align: center;
}
/* pickup + drop-off side by side (50/50), centered; the meta row spans full width */
.rd-order-body > .rd-order-row {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
    margin-bottom: 0;
    justify-content: flex-start;
    text-align: left;
}
.rd-order-body > .rd-order-meta {
    flex: 1 1 100%;
}

.rd-order-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.rd-order-row:last-child {
    margin-bottom: 0;
}

.rd-order-icon {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
    font-size: 14px;
}

.rd-order-icon.pickup {
    color: var(--rd-success);
}

.rd-order-icon.dropoff {
    color: var(--rd-danger);
}

.rd-order-icon.time {
    color: var(--rd-blue);
}

.rd-order-icon.items {
    color: var(--rd-warning);
}

.rd-order-label {
    font-size: 11px;
    color: var(--rd-text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.rd-order-value {
    font-size: 14px;
    color: var(--rd-text);
}

.rd-order-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--rd-border);
}

.rd-order-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.rd-order-btn.accept {
    background: var(--rd-success);
    color: white;
}

.rd-order-btn.decline {
    background: #F5F5F5;
    color: var(--rd-danger);
    border: 1px solid var(--rd-border);
}

.rd-order-btn.navigate {
    background: var(--rd-blue);
    color: white;
}

.rd-order-btn.complete {
    background: var(--rd-primary);
    color: white;
}

.rd-order-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Bottom Navigation */
.rd-bottomnav {
    display: flex;
    background: white;
    border-top: 1px solid var(--rd-border);
    padding: 4px 0;
    flex-shrink: 0;
}

.rd-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    color: var(--rd-text-secondary);
    font-size: 11px;
    font-weight: 500;
    border: none;
    background: none;
    transition: color .2s;
}

.rd-nav-item:hover {
    background: rgba(0, 79, 80, .08);
    color: var(--rd-text);
}

.rd-nav-item:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid var(--rd-primary);
    outline-offset: -2px;
}

.rd-nav-item.active {
    color: var(--rd-primary);
}

.rd-nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
}

/* Tab Panels */
.rd-tab-panel {
    display: none;
}

.rd-tab-panel.active {
    display: block;
}

/* Profile Panel */
.rd-profile {
    padding: 16px;
}

.rd-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: var(--rd-radius);
    box-shadow: var(--rd-shadow);
    margin-bottom: 16px;
}

.rd-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--rd-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}

.rd-profile-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.rd-profile-info p {
    color: var(--rd-text-secondary);
    font-size: 14px;
    margin: 0;
}

.rd-profile-section {
    background: white;
    border-radius: var(--rd-radius);
    box-shadow: var(--rd-shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.rd-profile-section-title {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--rd-text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--rd-border);
}

.rd-profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rd-border);
}

.rd-profile-row:last-child {
    border-bottom: none;
}

.rd-profile-row-label {
    font-size: 14px;
    color: var(--rd-text-secondary);
}

.rd-profile-row-value {
    font-size: 14px;
    font-weight: 600;
}

#rdProfileTimezone {
    text-align: right;
}

.rd-profile-location-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    max-width: 65%;
}

.rd-profile-location-value span {
    overflow-wrap: anywhere;
    text-align: right;
}

.rd-logout-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    background: white;
    color: #8c2f25;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--rd-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
}

.rd-logout-btn:hover {
    background: #8c2f25;
    color: white;
}

/* Loading Spinner */
.rd-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: rdSpin 0.8s linear infinite;
}

.rd-spinner.dark {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--rd-primary);
}

@keyframes rdSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Profile tab lazy-load overlay */
#rdProfilePanel {
    position: relative;
}

.rd-profile-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.82);
    color: #6b6b6b;
    font-size: 13px;
    z-index: 5;
}

.rd-profile-loading p {
    margin: 0;
}

/* History List */
.rd-history-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--rd-text-secondary);
    font-size: 14px;
}

.rd-history-loading .rd-spinner {
    width: 28px;
    height: 28px;
    border-width: 3px;
    margin-bottom: 12px;
}

.rd-history-loading p {
    margin: 0;
}

.rd-history-more {
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--rd-text-secondary);
}

.rd-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    margin: 4px 12px;
    border-radius: 8px;
    box-shadow: var(--rd-shadow);
}

.rd-history-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #E8F5E9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rd-history-item-details {
    flex: 1;
    min-width: 0;
}

.rd-history-item-id {
    font-weight: 600;
    font-size: 14px;
}

.rd-history-item-addr {
    font-size: 12px;
    color: var(--rd-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rd-history-item-time {
    font-size: 12px;
    color: var(--rd-text-secondary);
    text-align: right;
    flex-shrink: 0;
}

/* Notification Toast */
.rd-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 12px 16px;
    background: #f0fff4;
    color: #2e7d32;
    border: 1px solid currentColor;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    transform: translate(-50%, calc(-50% - 12px));
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-align: center;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
    pointer-events: none;
}

.rd-toast.show {
    transform: translate(-50%, -50%);
    opacity: 1;
}

.rd-toast.success {
    background: #f0fff4;
    color: #2e7d32;
}

.rd-toast.error {
    background: #fff5f5;
    color: #c62828;
}

/* Responsive */
@media (max-width: 520px) {
    #rdApp {
        max-width: 100%;
        margin: 8px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    }

    #rdMain {
        height: calc(100vh - 96px);
        height: calc(100dvh - 96px);
        max-height: none;
    }
}

@media (min-width: 521px) and (max-width: 767px) {
    #rdApp {
        max-width: 100%;
        margin: 8px;
    }
}

@media (min-width: 768px) {
    #rdApp {
        margin-top: 16px;
        margin-bottom: 16px;
    }
}

@media (min-width: 961px) {
    #rdApp {
        max-width: 100%;
    }
}

@media (min-width: 700px) {
    #rdOrdersList {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px 12px;
    }

    #rdOrdersList>.rd-empty-state {
        grid-column: 1 / -1;
    }

    .rd-order-card {
        margin: 0;
    }

    .rd-history-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 4px 12px;
    }

    .rd-history-list>.rd-empty-state {
        grid-column: 1 / -1;
    }

    .rd-history-item {
        margin: 0;
    }

    .rd-profile {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Route panel */
#rdRoutePanel {
    padding: 12px;
}

.rd-profile-row[hidden] {
    display: none;
}

/* Automation — lives at the bottom of the Orders tab and uses the same card language as the order cards */
#rdOrdersList>.rd-empty-state {
    padding: 28px 24px 20px;
}

.rd-auto-section {
    padding: 4px 0 8px;
}

#rdAppShell #rdAutoPanel,
#rdAppShell #rdAutoPanel * {
    text-align: left;
}

.rd-auto-header {
    position: relative;
    display: none;
}

.rd-auto-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

#rdAppShell .rd-auto-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--rd-text);
    margin: 0;
}

.rd-auto-info {
    display: inline-flex;
    flex-shrink: 0;
}

.rd-auto-info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    cursor: help;
}

.rd-auto-info-glyph {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.rd-auto-info-button:focus-visible {
    outline: 2px solid #084298;
    outline-offset: 2px;
}

.rd-auto-tooltip {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    width: min(320px, calc(100vw - 56px));
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #335c53;
    border-radius: 6px;
    background: #183b34;
    box-shadow: 0 6px 18px rgba(13, 35, 30, .24);
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    visibility: hidden;
    opacity: 0;
    transition: opacity .16s ease;
    pointer-events: none;
}

.rd-auto-info-button:hover+.rd-auto-tooltip,
.rd-auto-info-button:focus+.rd-auto-tooltip {
    visibility: visible;
    opacity: 1;
}

.rd-auto-group {
    background: var(--rd-card);
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    box-shadow: var(--rd-shadow);
    padding: 12px 16px;
    margin: 0;
}
.rd-auto-group + .rd-auto-group {
    margin-top: 6px;
}

.rd-auto-group-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--rd-text-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rd-border);
}

.rd-auto-settings {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.rd-auto-settings-block {
    min-width: 0;
}

.rd-auto-settings-block+.rd-auto-settings-block {
    padding-top: 14px;
    border-top: 1px solid var(--rd-border);
}

.rd-auto-actions {
    grid-area: actions;
}

.rd-auto-schedule {
    grid-area: schedule;
}

.rd-auto-filters {
    grid-area: filters;
    text-align: left;
}

.rd-auto-filters .rd-auto-hint {
    text-align: left;
}

#rdAppShell .rd-auto-filters .rd-auto-filter-text label {
    align-items: flex-start;
    text-align: left;
}

.rd-auto-filters input {
    text-align: left;
}

.rd-auto-filters .rd-auto-filter-text>.rd-auto-hint {
    margin: 6px 0 8px;
}

#rdAppShell .rd-auto-toggle-row {
    display: flex;
    position: relative;
    margin: 0;
    gap: 10px;
    text-align: left;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 0;
    cursor: pointer;
    user-select: none;
}

.rd-auto-toggle-row+.rd-auto-toggle-row {
    border-top: 1px solid #F0F0F0;
}

.rd-auto-label {
    font-size: 14px;
    color: var(--rd-text);
    text-align: left;
}

#rdAppShell .rd-auto-checkbox {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

#rdAppShell .rd-auto-checkbox:focus-visible+.rd-auto-switch {
    outline: 2px solid var(--rd-primary);
    outline-offset: 2px;
}

.rd-auto-switch {
    display: block;
    position: relative;
    width: 44px;
    height: 24px;
    background: #CFCFCF;
    border-radius: 12px;
    flex-shrink: 0;
    transition: background .2s;
}

.rd-auto-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s;
}

.rd-auto-checkbox:checked+.rd-auto-switch {
    background: var(--rd-success);
}

.rd-auto-checkbox:checked+.rd-auto-switch::after {
    transform: translateX(20px);
}

.rd-auto-hint {
    font-size: 12px;
    color: var(--rd-text-secondary);
    margin: -6px 0 8px;
    line-height: 1.4;
}

.rd-auto-actions>.rd-auto-hint {
    text-align: left;
}

.rd-auto-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 100px), 116px));
    justify-content: center;
    gap: 8px;
    margin: 4px 0 12px;
}

.rd-auto-filter-pair {
    min-width: 0;
}

#rdAppShell .rd-auto-filter-pair label,
#rdAppShell .rd-auto-filter-text label {
    margin: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#rdAppShell .rd-auto-filter-pair label {
    align-items: flex-start;
    text-align: left;
}

.rd-auto-filter-pair label span,
.rd-auto-filter-text label span {
    font-size: 12px;
    font-weight: 600;
    color: var(--rd-text-secondary);
}

.rd-auto-filter-pair input,
.rd-auto-filter-text input,
.rd-auto-filter-text select,
#rdScheduleConfig select {
    background: #FAFAFA;
    border: 1px solid var(--rd-border);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 14px;
    color: var(--rd-text);
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.rd-auto-timezone-value {
    display: block;
    padding: 9px 10px;
    border: 1px solid var(--rd-border);
    border-radius: 8px;
    background: #f7f8f6;
    color: var(--rd-text);
    font-size: 14px;
    font-weight: 600;
}

.rd-auto-filter-pair input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.rd-auto-filter-pair input[type="number"]::-webkit-inner-spin-button,
.rd-auto-filter-pair input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rd-auto-filter-pair input:focus,
.rd-auto-filter-text input:focus,
.rd-auto-filter-text select:focus,
#rdScheduleConfig select:focus {
    border-color: var(--rd-primary);
    background: #fff;
}

.rd-auto-filter-pair input::placeholder,
.rd-auto-filter-text input::placeholder {
    color: #AAAAAA;
}

.rd-auto-filter-text {
    margin-bottom: 10px;
}

#rdAppShell #rdScheduleConfig label {
    margin: 0 0 8px;
    color: var(--rd-text-secondary);
    font-size: 11px;
    text-align: left;
}

.rd-auto-add-slot {
    background: transparent;
    border: 1px dashed #BDBDBD;
    border-radius: 8px;
    color: var(--rd-primary);
    padding: 10px;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

.rd-auto-add-slot:hover {
    border-color: var(--rd-primary);
    background: #E6F5F5;
}

.rd-schedule-slot {
    background: #FAFAFA;
    border: 1px solid var(--rd-border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    container-type: inline-size;
}

.rd-schedule-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rd-schedule-slot-header span {
    font-size: 12px;
    font-weight: 600;
    color: var(--rd-text-secondary);
}

.rd-schedule-slot-remove {
    background: transparent;
    border: none;
    color: var(--rd-danger);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
}

.rd-schedule-days {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

#rdAppShell .rd-schedule-day {
    width: 38px;
    height: 28px;
    padding: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border-radius: 6px;
    border: 1px solid var(--rd-border);
    color: var(--rd-text-secondary);
    cursor: pointer;
    background: #fff;
    transition: all .15s;
}

#rdAppShell .rd-schedule-day.selected {
    background: var(--rd-success);
    border-color: var(--rd-success);
    color: #fff;
}

.rd-schedule-times {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 6px;
}

.rd-schedule-times span {
    text-align: center;
    font-size: 12px;
    color: var(--rd-text-secondary);
}

.rd-schedule-times input {
    background: #fff;
    border: 1px solid var(--rd-border);
    border-radius: 8px;
    padding: 6px 6px;
    font-size: 14px;
    color: var(--rd-text);
    outline: none;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* In a narrow card (the desktop two-column layout) the two times stack instead of truncating. */
@container (max-width: 270px) {
    .rd-schedule-times {
        grid-template-columns: 1fr;
    }

    .rd-schedule-times span {
        text-align: left;
    }
}

/* Full-width log: a responsive grid of compact cards, side by side, instead of a tall
   single-column list — so the entries use the width rather than one per row. */
.rd-auto-log {
    max-height: 340px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    align-content: start;
    gap: 10px;
    padding: 4px;
}

.rd-auto-log-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--rd-text-secondary);
    font-size: 13px;
    padding: 4px 0;
}

/* Activity-log card: tighter, symmetric padding (it is usually just the empty note). */
#rdAppShell #rdAutoLogMain .rd-auto-section {
    padding: 12px;
}

#rdAppShell #rdAutoLogMain .rd-auto-group {
    padding: 10px 12px;
}

.rd-auto-log-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    /* Keep cards a compact, uniform height; a card with many reasons scrolls vertically
       inside itself (never horizontally) rather than stretching the whole row tall. */
    max-height: 170px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.rd-auto-log-item::-webkit-scrollbar { width: 6px; }
.rd-auto-log-item::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.18); border-radius: 3px; }
.rd-auto-log-item::-webkit-scrollbar-track { background: transparent; }
.rd-auto-log-item:hover {
    border-color: var(--rd-primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}
.rd-auto-log-item:focus-visible {
    outline: 2px solid var(--rd-primary);
    outline-offset: 2px;
}

.rd-auto-log-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.rd-auto-log-icon.accept {
    background: #E8F5E9;
    color: #2E7D32;
}

.rd-auto-log-icon.decline {
    background: #FFEBEE;
    color: #C62828;
}

.rd-auto-log-icon.skip {
    background: #FFF3E0;
    color: #E65100;
}

/* Inside each card: icon on the left, then the label, details, reasons and time stacked. */
.rd-auto-log-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rd-auto-log-details .rd-auto-log-action {
    font-weight: 600;
    color: var(--rd-text);
}

.rd-auto-log-details .rd-auto-log-info {
    color: var(--rd-text-secondary);
}

.rd-auto-log-details .rd-auto-log-time {
    color: #999;
    font-size: 11px;
    margin-top: 2px;
}

/* Keep the settings sections in one column at every width. */
@media (min-width: 700px) {
    .rd-auto-section {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "header header"
            "settings settings"
            "activity activity";
        gap: 0 8px;
        align-items: start;
        padding: 0;
    }

    .rd-auto-header {
        grid-area: header;
    }

    .rd-auto-settings {
        grid-area: settings;
        display: flex;
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
    }

    .rd-auto-settings-block+.rd-auto-settings-block {
        padding-top: 0;
        border-top: 0;
    }

    .rd-auto-schedule {
        padding-top: 14px;
        border-top: 1px solid var(--rd-border);
    }

    .rd-auto-filters {
        grid-row: auto;
        padding-left: 0;
        border-left: 0;
    }

    .rd-auto-activity {
        grid-area: activity;
    }
}

.rd-app-section {
    --driver-section-space: 12px;
    padding: 12px;
    background: linear-gradient(130deg, #122825 0%, #1a3935 54%, #204841 100%);
}

.rd-app-container {
    width: 100%;
    padding: 0;
}

#rdApp {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
    scroll-margin-top: 76px;
}

#rdApp.rd-login-mode {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
}

html[data-rd-restoring] #rdApp.rd-login-mode {
    width: 100%;
    margin-inline: 0;
}

#rdRestoring,
#rdLogin {
    min-height: 520px;
}

#rdLogin {
    width: min(528px, calc(100vw - 32px));
    max-width: 100%;
    margin-inline: auto;
    padding: clamp(32px, 6vw, 64px) 24px;
}

#rdLogin .rd-input-group,
#rdLogin .rd-btn,
#rdLoginError {
    max-width: 480px;
}

#rdMain {
    height: min(1140px, 92vh);
    max-height: none;
    min-height: 360px;
}

/* Automation + activity-log panels: their own cards beside/below the app, matching
   #rdApp's chrome and #rdMain's teal topbar. Shown only when signed in (JS toggles). */
#rdAutoMain,
#rdAutoLogMain {
    display: none;
    width: 100%;
    margin-top: 16px;
    background: var(--rd-bg);
    border-radius: var(--rd-radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    text-align: left;
}

#rdAutoMain .rd-auto-section,
#rdAutoLogMain .rd-auto-section {
    padding: 16px;
    overflow-x: hidden;
}

/* Panel header as a teal top bar matching #rdMain's .rd-topbar (same padding, so the
   two cards' headers line up). Direct child of the card, above the scrolling section. */
#rdAutoMain > .rd-auto-header,
#rdAutoLogMain > .rd-auto-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--rd-primary);
    padding: 0 16px;
    min-height: 44px;
    box-sizing: border-box;
    flex: none;
}

#rdAppShell #rdAutoMain .rd-auto-header h3,
#rdAppShell #rdAutoLogMain .rd-auto-header h3 {
    color: #fff;
    font-size: 15px;
}

/* Keep the activity-log content left-aligned (the app's centering label rule
   otherwise reaches it now that it lives outside #rdAutoPanel). */
#rdAppShell #rdAutoLogMain,
#rdAppShell #rdAutoLogMain * {
    text-align: left;
}

/* Signed-in layout: #rdApp + #rdAutoMain side by side (50/50) when the viewport can
   fit both, stacked when it can't; the activity log always takes its own full row. */
#rdAppShell.rd-authed {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

#rdAppShell.rd-authed > #rdApp,
#rdAppShell.rd-authed > #rdAutoMain,
#rdAppShell.rd-authed > #rdAutoLogMain {
    max-width: 100%;
    margin-top: 0;
}

/* Signed in: the automation panels are shown (and become flex columns side by side
   at wider widths below). Visibility is class-driven so the media rule can win. */
#rdAppShell.rd-authed > #rdAutoMain,
#rdAppShell.rd-authed > #rdAutoLogMain {
    display: block;
}

/* #rdApp 75% / #rdAutoMain 25% when side by side; each keeps a usable min width and
   wraps to stacked, full width, when both can't fit. */
#rdAppShell.rd-authed > #rdApp {
    flex: 1 1 calc(75% - 8px);
    min-width: min(440px, 100%);
    width: auto;
}

#rdAppShell.rd-authed > #rdAutoMain {
    flex: 1 1 calc(25% - 8px);
    min-width: min(280px, 100%);
    width: auto;
}

#rdAppShell.rd-authed > #rdAutoLogMain {
    flex: 1 1 100%;
}

/* Side by side: give #rdAutoMain the same fixed height as #rdApp (#rdMain) and scroll
   its settings vertically (never horizontally); the teal header stays fixed above the
   scroll, mirroring #rdApp's topbar. */
@media (min-width: 760px) {
    #rdAppShell.rd-authed > #rdAutoMain {
        height: min(1140px, 92vh);
        display: flex;
        flex-direction: column;
    }

    #rdAppShell.rd-authed > #rdAutoMain > .rd-auto-section {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Driver name + code on one line in the topbar, like the single-line panel headers. */
.rd-topbar-left > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.rd-content {
    background: #f3f5f2;
}

.rd-auto-group {
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(23, 40, 35, .06);
}

.rd-profile-row-value,
.rd-order-value {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (min-width: 700px) {
    .rd-profile {
        max-width: none;
        margin: 0;
        display: grid;
        grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
        gap: 12px;
    }

    .rd-profile-header,
    .rd-profile-section {
        margin: 0;
    }
}

@media (min-width: 1200px) {
    .rd-content {
        overflow: hidden;
    }

    /* Single full-width column now the automation panel lives outside #rdMain. */
    #rdGigsPanel.active {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr);
        gap: 0;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        padding: 4px 12px 12px;
    }

    #rdGigsPanel > .rd-filter-bar { grid-row: 1; }
    #rdGigsPanel > .rd-bar-filter-drawer { grid-row: 2; }

    #rdGigsList {
        grid-row: 3;
        height: 100%;
        max-height: 100%;
        min-width: 0;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scrollbar-gutter: stable;
    }
}

@media (max-width: 520px) {
    #rdApp {
        margin: 0;
    }

    #rdMain {
        height: calc(100dvh - 96px);
        min-height: 360px;
    }

    .rd-auto-section {
        padding-inline: 8px;
    }
}

#rdAppShell #rdAutoPanel,
#rdAppShell #rdAutoPanel * {
    text-align: left !important;
}

#rdAppShell #rdAutoPanel .rd-auto-filter-grid .rd-auto-filter-pair label>span {
    align-self: stretch;
    text-align: center !important;
}

/* Order card: Pick-up Time and Items share one 50/50 row */
.rd-order-row-split {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.rd-order-row-split:last-child {
    margin-bottom: 0;
}

.rd-order-split-cell {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* Order card: center the Items cell content in its half of the row */
.rd-order-split-cell.rd-split-center {
    justify-content: center;
    text-align: center;
}

/* Automation log: the reason(s) an order was declined or skipped, as a bulleted list */
.rd-auto-log-reasons {
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rd-auto-log-reason {
    position: relative;
    padding-left: 12px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--rd-text-secondary);
}

.rd-auto-log-reason::before {
    content: '\2022';
    position: absolute;
    left: 2px;
    color: var(--rd-text-secondary);
}

/* ---- Activity-log entry modal (click a card to read it larger) ---- */
.rd-log-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2vh 16px;
    animation: rd-fade-in 0.2s ease;
}
.rd-log-modal-overlay[hidden] { display: none; }
.rd-log-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    height: 96vh;
    background: var(--rd-card);
    color: var(--rd-text);
    border-radius: 16px;
    overflow-y: auto;
    padding: 30px 28px 32px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: rd-slide-up 0.25s ease;
    -webkit-overflow-scrolling: touch;
}
.rd-log-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    color: var(--rd-text-secondary);
    background: var(--rd-bg);
    border: 1px solid var(--rd-border);
    cursor: pointer;
}
.rd-log-modal-close:hover { background: rgba(0, 0, 0, 0.08); }
.rd-log-modal-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.rd-log-modal-status {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.rd-log-modal-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 700;
    flex-shrink: 0;
}
.rd-log-modal-badge.accept { background: #E8F5E9; color: #2E7D32; }
.rd-log-modal-badge.decline { background: #FFEBEE; color: #C62828; }
.rd-log-modal-badge.skip { background: #FFF3E0; color: #E65100; }
.rd-log-modal-status-label {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rd-log-modal-status.accept .rd-log-modal-status-label { color: #2E7D32; }
.rd-log-modal-status.decline .rd-log-modal-status-label { color: #C62828; }
.rd-log-modal-status.skip .rd-log-modal-status-label { color: #E65100; }
.rd-log-modal-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--rd-text);
}
.rd-log-modal-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
    gap: 12px;
}
.rd-log-modal-metric {
    text-align: center;
    padding: 16px 12px;
    background: var(--rd-bg);
    border-radius: 10px;
}
.rd-log-modal-metric.primary { background: var(--rd-primary); color: #fff; }
.rd-log-modal-metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rd-text-secondary);
    margin-bottom: 6px;
}
.rd-log-modal-metric.primary .rd-log-modal-metric-label { color: rgba(255, 255, 255, 0.85); }
.rd-log-modal-metric-value { font-size: 24px; font-weight: 700; }
.rd-log-modal-section {
    margin: 0;
}
.rd-log-modal-kv {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.rd-log-modal-kv:last-child {
    margin-bottom: 0;
}
.rd-log-modal-kv-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
}
.rd-log-modal-kv-label {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--rd-text-secondary);
}
.rd-log-modal-kv-value {
    font-size: 15px;
    font-weight: 600;
    text-align: right;
}
.rd-log-modal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.rd-log-modal-chip {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--rd-bg);
    border: 1px solid var(--rd-border);
    color: var(--rd-text);
}
.rd-log-modal-chip--none {
    font-weight: 500;
    color: var(--rd-text-secondary);
}
.rd-log-modal-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rd-text-secondary);
    margin: 0 0 10px;
}
.rd-log-modal-reasons {
    margin: 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rd-log-modal-reasons li {
    font-size: 16px;
    line-height: 1.4;
    color: var(--rd-text);
}
.rd-log-modal-note {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--rd-text-secondary);
}
.rd-log-modal-time {
    margin-top: auto;
    padding-top: 10px;
    font-size: 14px;
    color: var(--rd-text-secondary);
}

/* ------------------------------------------------------------------ */
/* Roadie-specific additions (not present in the CartWheel base)        */
/* ------------------------------------------------------------------ */

/* MFA verification screen — styled to match the login card */
#rdMfa {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 40px 28px 32px;
}

#rdApp.rd-mfa-mode #rdLogin {
    display: none;
}

#rdApp.rd-mfa-mode #rdMfa {
    display: flex;
}

/* ---- Auth modal: login + MFA shown over the demo dashboard ---- */
.rd-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.rd-auth-modal[hidden] { display: none; }
.rd-auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 24, 24, 0.6);
}
.rd-auth-modal-card {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    max-height: 92vh;
    overflow: hidden auto;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.rd-auth-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 3;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 22px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
}
.rd-auth-modal-close:hover { background: rgba(0, 0, 0, 0.4); }
/* Login + MFA fit the modal card instead of filling the screen. */
.rd-auth-modal #rdLogin,
.rd-auth-modal #rdMfa {
    min-height: auto;
}
.rd-auth-modal #rdMfa {
    background: var(--rd-card);
}

#rdMfa .rd-mfa-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rd-primary) 0%, #1a7a7b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

#rdMfa .rd-mfa-icon svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

#rdMfa h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--rd-text);
}

#rdMfa .rd-subtitle {
    color: var(--rd-text-secondary);
    font-size: 14px;
    margin-bottom: 22px;
    text-align: center;
}

#rdMfaCode {
    width: 100%;
    max-width: 240px;
    text-align: center;
    letter-spacing: 8px;
    font-size: 26px;
    font-weight: 700;
    padding: 14px;
    border: 2px solid var(--rd-border);
    border-radius: var(--rd-radius);
    margin-bottom: 18px;
    color: var(--rd-text);
}

#rdMfaCode:focus {
    outline: none;
    border-color: var(--rd-primary);
}

#rdMfaResend {
    background: none;
    border: none;
    color: var(--rd-primary);
    font-weight: 600;
    cursor: pointer;
    margin-top: 14px;
    font-size: 14px;
}

#rdMfaResend:disabled {
    color: var(--rd-text-secondary);
    cursor: default;
}

#rdMfaError,
#rdLoginError {
    color: var(--rd-danger);
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
    display: none;
}

/* Search-area control (Roadie needs a center + radius + vehicle to find gigs) */
.rd-search-status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--rd-text-secondary);
    padding: 8px 12px;
    margin: 0;
    background: var(--rd-card);
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
}
.rd-search-status i {
    font-size: 12px;
    color: var(--rd-primary);
}


.rd-search-sep {
    display: inline-block;
    width: 1px;
    height: 12px;
    background: var(--rd-border);
    margin: 0 4px;
}

/* Gig requirement badges + decision chip + filter-reason lines on a gig card */
.rd-gig-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 0 14px 12px;
}

.rd-gig-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    background: #E6F2F2;
    color: var(--rd-primary-dark);
    border: 1px solid #B3D9D9;
    white-space: nowrap;
}

.rd-gig-badge.warn {
    background: #FFF4E5;
    color: #B26A00;
    border-color: #FFE0B2;
}

.rd-gig-badge.info {
    background: #E9F3FF;
    color: #1565C0;
    border-color: #CFE4FF;
}


.rd-decision-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.rd-decision-chip.match {
    background: #E8F5E9;
    color: #2E7D32;
}

.rd-decision-chip.reject {
    background: #FDECEA;
    color: #C62828;
}

.rd-decision-chip.skip {
    background: #FFF8E1;
    color: #B26A00;
}

.rd-gig-reasons {
    padding: 0 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rd-gig-reason {
    font-size: 12px;
    color: var(--rd-danger);
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.rd-gig-reason::before {
    content: '•';
    color: var(--rd-danger);
}

.rd-gig-reason.missing {
    color: var(--rd-text-secondary);
}

.rd-gig-reason.missing::before {
    color: var(--rd-text-secondary);
}

/* Claim / Submit Offer button */
.rd-order-btn.claim {
    background: var(--rd-primary);
    color: #fff;
}

.rd-order-btn.claim:hover {
    background: var(--rd-primary-dark);
}

.rd-order-btn.claim:disabled {
    opacity: .6;
    cursor: default;
}

/* "How auto-skip works" note in the automation actions block */
.rd-auto-note {
    font-size: 12px;
    color: var(--rd-text-secondary);
    background: #F0F7F7;
    border: 1px solid #C6E0E0;
    border-radius: var(--rd-radius);
    padding: 10px 12px;
    margin-top: 8px;
    line-height: 1.45;
}

/* Hero: one uniform chip style for the eyebrow + every trust item, uniform
   copy, and a CTA weight that matches the chips (all scoped to #rdHero). */
#rdHero .hero-eyebrow,
#rdHero .hero-trust-item {
    display: inline-block;
    background: rgba(0, 79, 80, .18);
    color: #B3D9D9;
    border: 1px solid rgba(0, 79, 80, .4);
    border-radius: 50rem;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
    padding: 7px 14px;
    white-space: nowrap;
}

#rdHero .hero-eyebrow i,
#rdHero .hero-trust-item i {
    color: #B3D9D9;
}

#rdHero .hero-trust {
    font-size: 13px;
}

#rdHero p {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
}

#rdHero .download-btn {
    font-weight: 600;
}

/* Equal-height hero halves: the content column and the video are the same size.
   Side-by-side only from xl up, where the video's 16:9 height already matches the
   content block closely; below that the two stack full-width (no small video). */
@media (min-width: 1200px) {
    #rdHero .col-xl-6:last-child {
        display: flex;
    }

    /* Let the video fill the full height of its column instead of a fixed 16:9 box,
       so it matches the content column exactly. */
    #rdHero .col-xl-6:last-child .ratio {
        height: 100%;
        width: 100%;
    }

    #rdHero .col-xl-6:last-child .ratio::before {
        display: none;
    }
}

/* Login footer note */
.rd-login-foot {
    font-size: 12px;
    color: #000;
    text-align: center;
    margin: 16px auto 0;
    max-width: 320px;
    line-height: 1.5;
}

.rd-mfa-back {
    background: none;
    border: none;
    color: var(--rd-text-secondary);
    font-size: 13px;
    cursor: pointer;
    margin-top: 6px;
}

.rd-driver-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, .75);
}

/* Size chips */
.rd-size-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}
/* The sizes hint sits under the centered chips, so center it too (must beat the
   blanket `#rdAppShell #rdAutoPanel * { text-align:left !important }` rule). */
#rdAppShell #rdAutoPanel .rd-auto-filter-text:has(.rd-size-chips) .rd-auto-hint { text-align: center !important; }

.rd-size-chip {
    border: 1px solid var(--rd-border);
    background: #fff;
    color: var(--rd-text-secondary);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.rd-size-chip.selected {
    background: var(--rd-primary);
    color: #fff;
    border-color: var(--rd-primary);
}

/* Requirement toggle grid (2-up) + compact rows */
.rd-auto-req-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
    margin-top: 6px;
}

.rd-auto-toggle-row.compact {
    padding: 7px 0;
}

@media (max-width: 520px) {
    .rd-auto-req-grid {
        grid-template-columns: 1fr;
    }
}

/* Gig card meta row (stops · drive time · deadline · size) */
.rd-order-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    padding: 4px 14px 2px;
}

.rd-order-meta span {
    font-size: 12px;
    color: var(--rd-text-secondary);
    font-weight: 600;
}

.rd-order-meta span+span {
    position: relative;
}

.rd-order-icon.dropoff {
    color: var(--rd-primary);
}

.rd-order-btn.claim.claimed {
    background: var(--rd-success);
}

/* ---- Gig detail modal ---- */
.rd-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: rd-fade-in 0.2s ease;
}

@keyframes rd-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rd-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.rd-detail-sheet {
    background: var(--rd-card);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 520px;
    height: auto;
    max-height: 94vh;
    overflow-y: auto;
    animation: rd-slide-up 0.25s ease;
    -webkit-overflow-scrolling: touch;
}

.rd-detail-header {
    position: sticky;
    top: 0;
    background: var(--rd-card);
    padding: 16px;
    border-bottom: 1px solid var(--rd-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.rd-detail-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.rd-detail-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--rd-text-secondary);
    cursor: pointer;
    padding: 4px 8px;
}

.rd-detail-body {
    padding: 0;
}

.rd-detail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--rd-text-secondary);
    font-size: 14px;
    gap: 8px;
}

.rd-detail-section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--rd-border);
}

.rd-detail-section:last-child {
    border-bottom: none;
}

.rd-detail-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rd-text-secondary);
    margin: 0 0 8px;
}

.rd-detail-pay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 100px), 1fr));
    gap: 8px;
}

.rd-detail-pay-item {
    text-align: center;
    padding: 10px 8px;
    background: var(--rd-bg);
    border-radius: 6px;
}

.rd-detail-pay-item.primary {
    background: var(--rd-primary);
    color: #fff;
}

.rd-detail-pay-item .label {
    font-size: 11px;
    color: var(--rd-text-secondary);
    margin-bottom: 2px;
}

.rd-detail-pay-item.primary .label {
    color: rgba(255, 255, 255, 0.8);
}

.rd-detail-pay-item .value {
    font-size: 18px;
    font-weight: 700;
}

.rd-detail-route-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rd-detail-stop {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.rd-detail-stop-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.rd-detail-stop-dot.pickup {
    background: var(--rd-success);
}

.rd-detail-stop-dot.dropoff {
    background: var(--rd-primary);
}

.rd-detail-stop-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--rd-text-secondary);
}

.rd-detail-stop-addr {
    font-size: 14px;
    margin-top: 2px;
}

.rd-detail-stop-city {
    font-size: 12px;
    color: var(--rd-text-secondary);
}

.rd-detail-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.rd-detail-meta-item {
    padding: 8px 10px;
    background: var(--rd-bg);
    border-radius: 6px;
}

.rd-detail-meta-item .label {
    font-size: 11px;
    color: var(--rd-text-secondary);
}

.rd-detail-meta-item .value {
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
}

.rd-detail-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rd-detail-items li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--rd-border);
    font-size: 14px;
}

.rd-detail-items li:last-child {
    border-bottom: none;
}

.rd-detail-items .qty {
    font-size: 12px;
    color: var(--rd-text-secondary);
    background: var(--rd-bg);
    padding: 2px 8px;
    border-radius: 10px;
}

.rd-detail-sender {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rd-detail-sender-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--rd-bg);
    object-fit: cover;
}

.rd-detail-sender-name {
    font-size: 14px;
    font-weight: 600;
}

.rd-detail-sender-rating {
    font-size: 12px;
    color: var(--rd-text-secondary);
}

.rd-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rd-detail-claim {
    padding: 14px 16px 2px;
}

.rd-detail-claim .rd-order-btn {
    width: 100%;
}

@media (min-width: 600px) {
    .rd-detail-sheet {
        border-radius: 16px;
        margin-bottom: 5vh;
        max-height: 80vh;
    }
    .rd-detail-overlay {
        align-items: center;
    }
}