/* ==========================================================================
   Expedite (Dlivrd) driver dashboard — neon-green on near-black, app-like.
   Scoped under #exApp / #exAppShell / the ex- modals. Mirrors the Roadie &
   CartWheel driver UIs (closeable hero, auth modal over a demo dashboard,
   offered/accepted order cards, sibling automation + activity-log columns).
   ========================================================================== */

:root {
    --ex-green: #39ff14;
    --ex-green-2: #2ee00e;
    --ex-green-ink: #04140a;
    --ex-head: #0c3b1f;        /* header bars */
    --ex-head-2: #0f4a28;
    --ex-bg: #0c140f;          /* dashboard surface */
    --ex-surface: #121e17;     /* cards */
    --ex-surface-2: #17271d;
    --ex-surface-3: #1d3225;
    --ex-border: rgba(57, 255, 20, .16);
    --ex-border-soft: rgba(255, 255, 255, .08);
    --ex-text: #e9f5ec;
    --ex-muted: #a8c2b4;
    --ex-muted-2: #8ba699;
    --ex-accept: #39ff14;
    --ex-decline: #ff5d5d;
    --ex-release: #ffb020;
    --ex-shadow: 0 18px 48px rgba(0, 0, 0, .42);
    --ex-radius: 16px;
    --ex-header-h: 54px;
    --ex-maxw: 1320px;
    /* Spacing scale (4px base) — every inset/gap/margin snaps to one of these. */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --ex-gutter: 16px;     /* horizontal inset for every dashboard section */
    --ex-card-pad: 14px;   /* horizontal inset inside an order/log/filter card */
    --ex-list-maxh: 648px;  /* order list shows ~2 card rows (+ a sliver); the rest scrolls vertically */
    --ex-log-maxh: 200px;   /* activity log: ~2 log-card rows (+ a sliver), then scroll */
    --ex-logcard-h: 86px;   /* uniform activity-log card height */
    --ex-card-minh: 300px;  /* uniform card height at EVERY width — matches the natural content
                               height now the badges moved to the header (no dead space), pay strip
                               stays 4-col so a card is the same height on mobile and desktop */
}

/* ===================== Hero (closeable / re-openable) ===================== */
#exHero {
    position: relative;
    /* driver-shell forces `.driver-page .hero-section { padding: var(--driver-section-space) 0 !important }`
       (defaults to 48px) — shrink it here to a tight, uniform top/bottom instead. */
    --driver-section-space: 22px;
    padding: 22px 0;
}
/* Uniform vertical rhythm for the hero copy (one gap instead of mixed mb-* classes). */
#exHero .ex-hero-copy { gap: 14px; }
#exHero .ex-hero-copy > * { margin-bottom: 0; }
#exHero .ex-hero-copy h1 { line-height: 1.05; }   /* tight title so the gaps read evenly */
#exHero .ex-hero-cta-row { margin-top: 10px; }   /* set the CTA apart from the trust pills above (14px gap + 10px = 24px) */
#exHero .ex-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: center;
    white-space: nowrap;
    background: rgba(57, 255, 20, .14);
    border: 1px solid rgba(57, 255, 20, .42);
    color: #c9ffc0;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 50rem;
    margin-bottom: 0;
}
#exHero .ex-hero-eyebrow i { color: var(--ex-green); }
#exHero .ex-hero-lead {
    font-size: 1.22rem;
    line-height: 1.5;
    color: #fff;
    max-width: 34ch;
    margin-left: auto;
    margin-right: auto;
}
#exHero .ex-hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
#exHero .ex-hero-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    background: rgba(57, 255, 20, .12);
    border: 1px solid rgba(57, 255, 20, .34);
    color: #bdf7b2;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 50rem;
}
#exHero .ex-hero-trust-item i { color: var(--ex-green); }
/* driver-shell.css gives `.driver-page .download-btn` an orange bot-accent; restore the
   expedite theme's green so the hero CTA matches the rest of this neon-green page. */
#exHero .download-btn { font-weight: 600; background: var(--ex-green) !important; color: var(--ex-green-ink) !important; box-shadow: 0 8px 20px rgba(57, 255, 20, .3) !important; }
#exHero .download-btn:hover { background: var(--ex-green-2) !important; }
#exHero .ex-hero-shot { max-width: 250px; width: auto; margin: 0 auto; }
#exHero .ex-hero-shot img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: clamp(260px, 34vh, 380px);
    border: 1px solid rgba(57, 255, 20, .25);
}

.ex-hero-close,
.ex-hero-restore {
    position: absolute;
    z-index: 4;
    border: 1px solid rgba(255, 255, 255, .25);
    cursor: pointer;
    font-weight: 700;
}
.ex-hero-close {
    top: 14px; right: 16px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 20px;
    line-height: 1;
}
.ex-hero-close:hover { background: rgba(0, 0, 0, .6); }
.ex-hero-restore {
    top: 10px; left: 50%;
    transform: translateX(-50%);
    display: none;
    background: rgba(57, 255, 20, .16);
    color: #d6ffcf;
    border-radius: 50rem;
    padding: 6px 16px;
    font-size: 13px;
}
#exHero.ex-hero-hidden {
    /* driver-shell forces `.driver-page .hero-section { padding: var(--driver-section-space) 0 !important }`,
       so a plain `padding: 0` can't win — zero the var it reads AND override with !important. That collapses
       the hero to a slim strip hugging the re-open pill (8px air above/below), with no wasted black band. */
    --driver-section-space: 0;
    padding: 8px 0 !important;
    min-height: 0;
    background: #0a0f0c;
}
#exHero.ex-hero-hidden .container { display: none; }
#exHero.ex-hero-hidden .ex-hero-close { display: none; }
#exHero.ex-hero-hidden .ex-hero-restore { display: block; position: static; transform: none; margin: 0 auto; }

/* ===================== App section + 3-zone shell ===================== */
/* NONE of the dashboard wrappers (section, container, shell) carry a background. The dark
   surface lives on the page wrapper instead — `.driver-page:has(#exAppSection)` scopes it to
   THIS page only — and the section is forced transparent so that dark shows through the 12px
   gutter and the gaps between the panels (it also defeats driver-shell's forced beige here). */
.driver-page:has(#exAppSection) { background-color: #080c0a !important; }
#exAppSection.ex-app-section {
    --driver-section-space: 0;
    padding: 0;
    background: transparent !important;
}
.ex-app-container { width: 100%; padding: 0; }
.ex-app-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 12px;              /* uniform 12px gutter around the dashboard */
}
@media (min-width: 1200px) {
    .ex-app-shell {
        grid-template-columns: minmax(0, 1fr) 400px;
        grid-template-areas: "app auto" "log log";
        align-items: stretch;
    }
    #exApp { grid-area: app; }
    #exAutoMain { grid-area: auto; display: flex; flex-direction: column; min-height: 0; }
    #exAutoLogMain { grid-area: log; }
    /* The dashboard column (capped order list) drives the row height; the automation
       panel fills its parent to match and scrolls internally instead of imposing its
       own tall content height on the row. */
    #exAutoMain .ex-auto-section { flex: 1 1 0; min-height: 0; max-height: none; overflow-y: auto; }
}

/* ===================== Dashboard frame ===================== */
#exApp {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--ex-bg);
    border: 1px solid var(--ex-border);
    border-radius: var(--ex-radius);
    box-shadow: var(--ex-shadow);
    overflow: hidden;
    min-height: 560px;
    color: var(--ex-text);
}
#exMain { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

/* Toast */
.ex-toast {
    position: absolute;
    top: 14px; left: 50%;
    transform: translateX(-50%) translateY(-18px);
    z-index: 60;
    max-width: 90%;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    background: #16241d;
    border: 1px solid var(--ex-border);
    color: var(--ex-text);
}
.ex-toast.success { opacity: 1; transform: translateX(-50%) translateY(0); border-color: rgba(57, 255, 20, .5); }
.ex-toast.error { opacity: 1; transform: translateX(-50%) translateY(0); border-color: rgba(255, 93, 93, .55); color: #ffd4d4; }

/* Restoring spinner overlay */
#exRestoring {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--ex-bg);
}
html[data-ex-restoring] #exRestoring { display: flex; }
.ex-restoring-spinner {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(57, 255, 20, .2);
    border-top-color: var(--ex-green);
    animation: ex-spin .8s linear infinite;
}
@keyframes ex-spin { to { transform: rotate(360deg); } }

/* ===================== Auth modal ===================== */
.ex-auth-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ex-auth-modal[hidden] { display: none; }
.ex-auth-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .66); backdrop-filter: blur(3px); }
.ex-auth-modal-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--ex-surface);
    border: 1px solid var(--ex-border);
    border-radius: 18px;
    box-shadow: var(--ex-shadow);
    padding: 30px 26px 26px;
    color: var(--ex-text);
    animation: ex-pop .18s ease;
}
@keyframes ex-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.ex-auth-modal-close,
.ex-detail-close {
    position: absolute; top: 12px; right: 14px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .06);
    color: var(--ex-muted);
    font-size: 20px; line-height: 1;
    cursor: pointer;
}
.ex-auth-modal-close:hover,
.ex-detail-close:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.ex-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.ex-logo-mark {
    width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--ex-green), var(--ex-green-2));
    color: var(--ex-green-ink);
    box-shadow: 0 6px 16px rgba(57, 255, 20, .35);
}
.ex-subtitle { color: var(--ex-muted); font-size: 13.5px; margin: 6px 0 18px; }
.ex-input-group { margin-bottom: 14px; }
.ex-input-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ex-muted); margin-bottom: 6px; }
.ex-input-group input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid var(--ex-border-soft);
    background: #0d1712;
    color: var(--ex-text);
    font-size: 15px;
    transition: border-color .15s, box-shadow .15s;
}
.ex-input-group input:focus {
    outline: none;
    border-color: var(--ex-green);
    box-shadow: 0 0 0 3px rgba(57, 255, 20, .18);
}
#exLoginError { color: #ffb0b0; font-size: 13px; margin-top: 10px; min-height: 0; }
#exLoginError:not(:empty) { margin-top: 10px; }
.ex-login-note { display: flex; gap: 8px; font-size: 12px; color: var(--ex-muted-2); margin: 16px 0 0; }
.ex-login-note i { color: var(--ex-green); }

/* ===================== Buttons ===================== */
.ex-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: none; cursor: pointer; font-weight: 700;
    border-radius: 12px; padding: 12px 18px; font-size: 15px;
    transition: transform .08s, filter .15s, background .15s;
}
.ex-btn:active { transform: translateY(1px); }
.ex-btn-login, .ex-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--ex-green), var(--ex-green-2));
    color: var(--ex-green-ink);
    box-shadow: 0 8px 20px rgba(57, 255, 20, .3);
}
.ex-btn-login:hover, .ex-btn-primary:hover { filter: brightness(1.05); }
.ex-btn-login { margin-top: 6px; }
.ex-btn-ghost {
    background: transparent;
    border: 1px solid var(--ex-border);
    color: var(--ex-text);
}
.ex-btn-ghost:hover { background: rgba(57, 255, 20, .08); }
.ex-btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }

/* ===================== Topbar ===================== */
.ex-topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    height: var(--ex-header-h);
    padding: 0 16px;
    background: linear-gradient(90deg, var(--ex-head), var(--ex-head-2));
    border-bottom: 1px solid var(--ex-border);
}
.ex-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ex-avatar {
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center;
    background: rgba(57, 255, 20, .18);
    color: var(--ex-green);
    font-weight: 800; flex: none;
}
/* text-align:left defeats the inherited .driver-page center so the name doesn't float
   centered above the (longer) sub-line. */
.ex-topbar-left, .ex-driver-name, .ex-driver-sub { text-align: left; }
.ex-driver-name { font-weight: 700; font-size: 15px; line-height: 1.1; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.ex-driver-sub { font-size: 11.5px; color: #b8d8c4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; margin-top: 2px; }
.ex-topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.ex-auto-pill {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 600;
    padding: 6px 11px; border-radius: 50rem;
    background: rgba(0, 0, 0, .25);
    color: #cfe9d8;
    border: 1px solid rgba(255, 255, 255, .1);
}
.ex-auto-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ex-muted-2); }
.ex-auto-pill.on { color: var(--ex-green-ink); background: var(--ex-green); border-color: var(--ex-green); }
.ex-auto-pill.on .ex-auto-dot { background: var(--ex-green-ink); box-shadow: 0 0 0 2px rgba(0,0,0,.15); }
@media (max-width: 420px) { .ex-auto-pill { display: none; } }
.ex-logout-btn {
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(0, 0, 0, .2);
    color: #fff; font-weight: 600; font-size: 13.5px;
    padding: 8px 14px; border-radius: 10px; cursor: pointer;
}
.ex-logout-btn:hover { background: rgba(0, 0, 0, .4); }

/* ===================== Content + tabs ===================== */
/* The order LIST is the sole scroller (capped at ~2 rows); .ex-content just holds it. */
.ex-content { padding: 0; flex: 1 1 auto; min-height: 0; }
.ex-bottomnav { flex: none; }
.ex-tab-panel { display: none; }
.ex-tab-panel.active { display: block; }
.ex-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--sp-4) var(--ex-gutter) var(--sp-1);
    gap: var(--sp-2);
}
/* `color` is !important here (and on the other headings below) ONLY to defeat
   driver-shell.css's light-theme rule `.driver-page h1..h4 { color: var(--driver-ink) }`,
   which bleeds in because every bot page is wrapped in `.driver-page` and loads AFTER
   this file. Without it the dark #17231e heading text is invisible on the dark headers. */
.ex-panel-title { font-size: 15px; font-weight: 700; margin: 0; display: inline-flex; align-items: center; gap: 8px; color: #ffffff !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.ex-panel-title i { color: var(--ex-green); }
.ex-count {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 50rem; background: rgba(57, 255, 20, .16); color: var(--ex-green);
    font-size: 12px; font-weight: 700;
}
.ex-sync-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ex-muted); }
.ex-sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ex-green); box-shadow: 0 0 0 0 rgba(57,255,20,.5); animation: ex-pulse 2s infinite; }
.ex-sync-status.waiting .ex-sync-dot { background: var(--ex-release); animation: none; }
.ex-sync-status.error .ex-sync-dot { background: var(--ex-decline); animation: none; }
@keyframes ex-pulse { 0% { box-shadow: 0 0 0 0 rgba(57,255,20,.45); } 70% { box-shadow: 0 0 0 7px rgba(57,255,20,0); } 100% { box-shadow: 0 0 0 0 rgba(57,255,20,0); } }

/* ===================== Order cards ===================== */
.ex-orders-list { display: grid; grid-template-columns: 1fr; grid-auto-rows: minmax(var(--ex-card-minh), auto); gap: var(--sp-3); padding: var(--sp-3) var(--ex-gutter) var(--ex-gutter); align-content: start; max-height: var(--ex-list-maxh); overflow-y: auto; }
/* Cap at 3 columns max (the `(100% - 24px)/3` floor) so the row count stays predictable on
   wide screens instead of exploding to 4–5 narrow columns; ≥290px keeps them readable. */
@media (min-width: 640px) {
    .ex-orders-list { grid-template-columns: repeat(auto-fit, minmax(max(290px, (100% - 24px) / 3), 1fr)); }
}
.ex-order-card {
    container: excard / inline-size;
    background: var(--ex-surface);
    border: 1px solid var(--ex-border-soft);
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    display: flex; flex-direction: column;
    transition: border-color .15s, transform .08s;
}
/* Cards size to their content (never clipped/scrolled on normal content). Within a grid row
   they all stretch to equal height, so each row is uniform. Header + buttons stay at the top;
   the content body fills the rest. All text wraps, so a card never overflows horizontally. */
.ex-order-top, .ex-order-actions { flex: none; }
.ex-order-scroll { flex: 1 1 auto; min-height: 0; }
.ex-order-business, .ex-order-market { overflow-wrap: anywhere; }
.ex-order-card:hover { border-color: var(--ex-border); }
.ex-order-card.recommended { border-color: rgba(57, 255, 20, .4); box-shadow: 0 0 0 1px rgba(57,255,20,.18) inset; }
/* Business/market on the left; status + tag badges clustered in the top-right of the header. */
.ex-order-top {
    display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2);
    padding: var(--ex-card-pad) var(--ex-card-pad) var(--sp-2);
}
.ex-order-head { text-align: left; min-width: 0; flex: 1 1 auto; }
.ex-order-business { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.2; }
.ex-order-market { font-size: 11.5px; color: var(--ex-muted); margin-top: 2px; }
.ex-state-badge {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    padding: 4px 9px; border-radius: 50rem; white-space: nowrap; flex: none;
}
.ex-state-badge.offered { background: rgba(57, 255, 20, .16); color: var(--ex-green); }
.ex-state-badge.accepted { background: rgba(255, 176, 32, .16); color: var(--ex-release); }

/* Pay strip — 4 cells, drops to 2×2 on narrow cards (container query) */
.ex-order-pay {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px; margin: 0 var(--ex-card-pad); border-radius: 10px; overflow: hidden;
    background: var(--ex-border-soft);
}
/* Pay strip stays 4-across at every width so a card is the same height everywhere (uniform). */
.ex-pay-cell { background: var(--ex-surface-2); padding: 9px 4px; text-align: center; min-width: 0; }
.ex-pay-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ex-muted-2); }
.ex-pay-value {
    font-size: 16px; line-height: 1.15; margin-top: 2px;
    font-weight: 800; font-variant-numeric: tabular-nums;
    color: var(--ex-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: clamp(13px, 3.8cqi, 16px);
}
.ex-pay-cell.earn .ex-pay-value { color: var(--ex-green); }
.ex-pay-value.unknown { color: var(--ex-muted-2); font-weight: 600; }

/* Body: pickup | dropoff split */
.ex-order-body { padding: var(--sp-3) var(--ex-card-pad) var(--sp-1); display: grid; gap: var(--sp-3); }
.ex-order-split { display: flex; gap: var(--sp-3); }
.ex-split-cell { flex: 1 1 0; min-width: 0; }
.ex-leg-label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--ex-muted-2); display: flex; align-items: center; gap: 5px; }
.ex-leg-label i { font-size: 11px; }
.ex-leg-label.pick i { color: var(--ex-green); }
.ex-leg-label.drop i { color: var(--ex-release); }
.ex-leg-name { font-size: 13px; font-weight: 600; color: var(--ex-text); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Clamp addresses to exactly 2 lines so every card has the same content height (uniform). */
.ex-leg-addr { font-size: 11.5px; color: var(--ex-muted); margin-top: 1px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ex-order-meta { display: flex; justify-content: center; gap: 12px; font-size: 11.5px; color: var(--ex-muted); }
.ex-order-meta .mk { color: var(--ex-text); font-weight: 600; }

/* Action buttons — framed by a divider above AND below (consistent, not a lone bottom border). */
.ex-order-actions { display: flex; gap: var(--sp-2); padding: var(--sp-2) var(--ex-card-pad); border-top: 1px solid var(--ex-border-soft); border-bottom: 1px solid var(--ex-border-soft); }
.ex-order-btn { flex: 1; border: none; border-radius: 10px; padding: 10px; font-weight: 700; font-size: 13.5px; cursor: pointer; transition: filter .15s; }
.ex-order-btn:active { transform: translateY(1px); }
.ex-order-btn.accept { background: var(--ex-green); color: var(--ex-green-ink); }
.ex-order-btn.decline { background: rgba(255, 93, 93, .14); color: var(--ex-decline); border: 1px solid rgba(255,93,93,.4); }
.ex-order-btn.release { background: rgba(255, 176, 32, .14); color: var(--ex-release); border: 1px solid rgba(255,176,32,.4); }
.ex-order-btn:hover { filter: brightness(1.08); }

/* Badge cluster lives in the top-right of the header: state badge + tags, wrapping right-aligned. */
.ex-order-badges { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 6px; flex: none; max-width: 54%; }
.ex-tag { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 50rem; background: var(--ex-surface-3); color: var(--ex-muted); display: inline-flex; align-items: center; gap: 5px; }
.ex-tag i { font-size: 11px; color: var(--ex-green); }

/* Empty state */
.ex-empty {
    text-align: center; color: var(--ex-muted); padding: 48px 20px; grid-column: 1 / -1;
}
.ex-empty i { font-size: 40px; color: var(--ex-surface-3); display: block; margin-bottom: 12px; }
.ex-empty-title { font-weight: 700; color: var(--ex-text); margin-bottom: 4px; }

/* ===================== Bottom nav ===================== */
.ex-bottomnav {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--ex-border);
    background: #0a120d;
}
.ex-nav-item {
    border: none; background: none; cursor: pointer;
    padding: 10px 4px; color: var(--ex-muted-2);
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 600;
    border-top: 2px solid transparent;
}
.ex-nav-item i { font-size: 18px; }
.ex-nav-item.active { color: var(--ex-green); border-top-color: var(--ex-green); background: rgba(57, 255, 20, .06); }

/* ===================== Automation column ===================== */
.ex-auto-main, .ex-auto-log-main {
    background: var(--ex-bg);
    border: 1px solid var(--ex-border);
    border-radius: var(--ex-radius);
    box-shadow: var(--ex-shadow);
    overflow: hidden;
    color: var(--ex-text);
}
.ex-auto-section { --ex-sec-pad-x: 16px; padding: 0 var(--ex-sec-pad-x) 18px; }
.ex-auto-header {
    display: flex; align-items: center; justify-content: space-between;
    min-height: var(--ex-header-h);
    margin: 0 calc(-1 * var(--ex-sec-pad-x)) 14px;
    padding: 0 var(--ex-sec-pad-x);
    background: linear-gradient(90deg, var(--ex-head), var(--ex-head-2));
    border-bottom: 1px solid var(--ex-border);
}
@media (min-width: 1200px) { #exAutoMain .ex-auto-header { position: sticky; top: 0; z-index: 2; } }
.ex-auto-header h3 { margin: 0; font-size: 15px; font-weight: 700; color: #ffffff !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); display: inline-flex; align-items: center; }
.ex-auto-header h3 i { color: var(--ex-green); }
.ex-auto-info-button {
    width: 28px; height: 28px; border-radius: 8px; border: none; cursor: pointer;
    background: rgba(255, 255, 255, .12); color: #0d6efd; display: grid; place-items: center;
}
.ex-auto-info-button i { color: #4ea1ff; font-size: 15px; }
/* Two toggles sit side by side, 50/50, instead of stacked full-width (saves space).
   Each card: label + switch aligned on the top row, hint spanning full width below. */
.ex-auto-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
#exAppShell .ex-auto-toggles .ex-switch-row {
    display: grid;
    grid-template-areas: "label" "switch" "hint";
    justify-items: start;
    align-content: start;
    row-gap: 7px;
}
.ex-auto-toggles .ex-switch-label { grid-area: label; }
.ex-auto-toggles .ex-switch { grid-area: switch; }
.ex-auto-toggles .ex-switch-hint { grid-area: hint; margin-top: 0; }
.ex-switch-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--ex-surface); border: 1px solid var(--ex-border-soft);
    border-radius: 12px; padding: 12px 14px; cursor: pointer;
}
.ex-switch-row--compact { padding: 10px 14px; }
.ex-switch-label { font-weight: 600; font-size: 14px; color: var(--ex-text); display: block; }
.ex-switch-hint { font-size: 11.5px; color: var(--ex-muted); display: block; margin-top: 2px; }
/* driver-shell.css `.driver-page label { display: block }` (specificity beats our
   `.ex-switch-row`) flattens these flex toggle rows — the row is a <label> — which stops
   `.ex-switch` being a flex item, so as an inline <span> it ignored width/height and
   collapsed to 0×0 (only the knob showed). Re-assert flex with #id specificity, and give
   the switch an explicit inline-block box so it sizes no matter what. */
#exAppShell .ex-switch-row { display: flex; }
.ex-switch { position: relative; display: inline-block; flex: none; width: 46px; height: 26px; }
.ex-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ex-switch-track { position: absolute; inset: 0; border-radius: 50rem; background: #223228; transition: background .15s; }
.ex-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.ex-switch input:checked + .ex-switch-track { background: var(--ex-green); }
.ex-switch input:checked + .ex-switch-track::after { transform: translateX(20px); }

.ex-auto-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ex-muted); margin: 16px 0 10px; }
.ex-filter-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ex-muted-2); font-size: 11px; }
.ex-filter-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ex-filter-stack { display: grid; gap: 10px; }
.ex-filter label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ex-muted); margin-bottom: 5px; }
.ex-filter input {
    width: 100%; padding: 9px 11px; border-radius: 10px;
    border: 1px solid var(--ex-border-soft); background: #0d1712; color: var(--ex-text); font-size: 14px;
}
.ex-filter input:focus { outline: none; border-color: var(--ex-green); box-shadow: 0 0 0 3px rgba(57,255,20,.15); }

/* Legible placeholder text across every input on the page */
#exApp input::placeholder,
.ex-auth-modal input::placeholder,
.ex-auto-main input::placeholder,
.ex-filter input::placeholder,
.ex-input-group input::placeholder { color: var(--ex-muted-2); opacity: 1; }

/* Schedule */
.ex-schedule { background: var(--ex-surface); border: 1px solid var(--ex-border-soft); border-radius: 12px; padding: 12px 14px; }
.ex-schedule .ex-switch-row { background: none; border: none; padding: 0; }
.ex-schedule-body { margin-top: 12px; display: grid; gap: 10px; }
.ex-tz-row { font-size: 12px; color: var(--ex-muted); }
.ex-tz-row span { color: var(--ex-text); font-weight: 600; }
.ex-slots { display: grid; gap: 10px; }
.ex-slot { background: var(--ex-surface-2); border: 1px solid var(--ex-border-soft); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.ex-slot-days { display: flex; flex-wrap: wrap; gap: 5px; }
.ex-day { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--ex-border-soft); background: #0d1712; color: var(--ex-muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.ex-day.on { background: var(--ex-green); color: var(--ex-green-ink); border-color: var(--ex-green); }
.ex-slot-times { display: flex; align-items: center; gap: 8px; }
.ex-slot-times input { flex: 1; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--ex-border-soft); background: #0d1712; color: var(--ex-text); font-size: 13px; }
.ex-slot-times span { color: var(--ex-muted); font-size: 12px; }
.ex-slot-remove { border: none; background: rgba(255,93,93,.14); color: var(--ex-decline); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; flex: none; }

.ex-auto-save { margin-top: 16px; }
.ex-auto-saved { text-align: center; color: var(--ex-green); font-size: 13px; font-weight: 600; margin-top: 8px; }

/* ===================== Activity log ===================== */
.ex-auto-log-main .ex-auto-section { --ex-sec-pad-x: 16px; }
.ex-auto-header--log { background: linear-gradient(90deg, #11271a, var(--ex-head)); }
/* Capped at 4 columns (the `(100% - 30px)/4` floor) so the row count stays predictable; the
   list shows ~2 rows (--ex-log-maxh) and scrolls when there are more. */
.ex-auto-log { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(260px, (100% - 30px) / 4)), 1fr)); grid-auto-rows: var(--ex-logcard-h); gap: 10px; max-height: var(--ex-log-maxh); overflow-y: auto; align-content: start; }
.ex-log-card { background: var(--ex-surface); border: 1px solid var(--ex-border-soft); border-left: 3px solid var(--ex-muted-2); border-radius: 10px; padding: 10px 12px; cursor: pointer; height: 100%; overflow-y: auto; overflow-x: hidden; }
.ex-log-card.accept { border-left-color: var(--ex-green); }
.ex-log-card.decline { border-left-color: var(--ex-decline); }
.ex-log-card.skip { border-left-color: var(--ex-release); }
.ex-log-action { font-weight: 700; font-size: 13px; color: var(--ex-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-log-info { font-size: 11.5px; color: var(--ex-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ex-log-time { font-size: 10.5px; color: var(--ex-muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.ex-log-empty { grid-column: 1 / -1; text-align: center; color: var(--ex-muted); padding: 26px; font-size: 13px; }

/* ===================== Profile ===================== */
.ex-profile { padding: 16px; }
.ex-profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ex-profile-avatar { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-weight: 800; background: rgba(57,255,20,.16); color: var(--ex-green); }
.ex-profile-name { font-size: 18px; font-weight: 700; color: #fff; }
.ex-profile-market { color: var(--ex-muted); font-size: 13px; }
.ex-profile-section { background: var(--ex-surface); border: 1px solid var(--ex-border-soft); border-radius: 12px; padding: 4px 14px; }
.ex-profile-section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ex-muted); font-weight: 700; padding: 12px 0 8px; }
.ex-profile-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--ex-border-soft); font-size: 13.5px; }
.ex-profile-row span:first-child { color: var(--ex-muted); }
.ex-profile-value { color: var(--ex-text); font-weight: 600; text-align: right; }

/* ===================== Detail / info modal ===================== */
.ex-detail-modal { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ex-detail-modal[hidden] { display: none; }
.ex-detail-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.66); backdrop-filter: blur(3px); }
.ex-detail-card { position: relative; width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; background: var(--ex-surface); border: 1px solid var(--ex-border); border-radius: 18px; box-shadow: var(--ex-shadow); padding: 24px; color: var(--ex-text); animation: ex-pop .18s ease; }
.ex-detail-card h3 { font-size: 17px; margin: 0 0 12px; color: #ffffff !important; }
.ex-detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--ex-border-soft); font-size: 13.5px; }
.ex-detail-row span:first-child { color: var(--ex-muted); }
.ex-detail-row span:last-child { font-weight: 600; text-align: right; }
.ex-detail-leg { background: var(--ex-surface-2); border-radius: 10px; padding: 12px; margin-top: 12px; }
.ex-detail-leg .ex-leg-name { font-size: 14px; }
.ex-info-body h3 { color: #ffffff !important; }
.ex-info-body ul { padding-left: 18px; margin: 10px 0; }
.ex-info-body li { font-size: 13.5px; color: var(--ex-text); margin-bottom: 8px; line-height: 1.5; }
.ex-info-body p { font-size: 13.5px; color: var(--ex-muted); line-height: 1.55; }
.ex-info-foot { display: flex; gap: 8px; margin-top: 12px; color: var(--ex-text); }
.ex-info-foot i { color: var(--ex-green); }

/* ===================== Demo mode ===================== */
#exApp.ex-demo-mode .ex-order-btn,
#exApp.ex-demo-mode .ex-switch,
#exApp.ex-demo-mode .ex-auto-save { position: relative; }
.ex-demo-ribbon {
    position: absolute; top: 0; left: 0; right: 0; z-index: 40;
    text-align: center; font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
    color: var(--ex-green-ink); background: var(--ex-green);
    padding: 4px; display: none;
}
#exApp.ex-demo-mode .ex-demo-ribbon { display: block; }
#exApp.ex-demo-mode .ex-content { padding-top: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ex-restoring-spinner, .ex-sync-dot { animation: none; }
    .ex-auth-modal-card, .ex-detail-card { animation: none; }
}
