:root {
    --blue-900: #0b3f91;
    --blue-800: #145fc6;
    --blue-700: #1c70df;
    --blue-100: #eaf2ff;
    --ink: #102446;
    --text: #24374f;
    --muted: #6f819b;
    --bg: #eef3fa;
    --card: #ffffff;
    --line: #d8e4f3;
    --yellow: #f2c629;
    --yellow-ink: #473600;
    --success: #2ca66f;
    --shadow: 0 18px 40px rgba(16, 36, 70, .10);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: linear-gradient(180deg, #dfe9f7 0%, var(--bg) 26%, #f8fbff 100%);
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
}

body {
    overscroll-behavior: none;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

input {
    outline: none;
}

select {
    font: inherit;
}

.app-shell {
    max-width: 480px;
    min-height: 100dvh;
    margin: 0 auto;
    position: relative;
    background: transparent;
    overflow: hidden;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(env(safe-area-inset-top) + 16px) 18px 14px;
    background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
    color: #fff;
    box-shadow: 0 10px 30px rgba(11, 63, 145, .22);
}

.app-topbar h1,
.screen-header h2,
.auth-screen h2,
.splash-copy h1 {
    margin: 0;
    line-height: 1.05;
}

.app-topbar h1 {
    font-size: 1.35rem;
}

.microcopy {
    margin: 0 0 4px;
    font-size: .74rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .75;
    font-weight: 700;
}

.on-dark {
    color: rgba(255, 255, 255, .7);
}

.app-main {
    padding: 16px 16px 106px;
    min-height: calc(100dvh - 82px);
    position: relative;
}

.screen {
    position: absolute;
    inset: 0 0 0 0;
    padding: 16px 16px 106px;
    opacity: 0;
    transform: translateX(34px) scale(.985);
    pointer-events: none;
    transition: transform .34s cubic-bezier(.22, 1, .36, 1), opacity .28s ease;
    overflow: auto;
}

.app-main>.screen {
    padding: 16px 16px 106px;
}

.screen.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    z-index: 2;
}

.screen.exit-left {
    transform: translateX(-36px) scale(.985);
    opacity: 0;
}

.screen.enter-left {
    transform: translateX(-36px) scale(.985);
}

.hidden {
    display: none !important;
}

.brand-gradient,
.splash-screen {
    background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
    color: #fff;
}

.hero-card,
.content-card,
.job-card,
.alert-card,
.thread-card,
.feature-card,
.map-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 20px;
}

.hero-row,
.section-title-row,
.job-top,
.screen-header,
.detail-top-row,
.auth-brand-row,
.profile-head,
.settings-switch-row,
.topbar-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.section-title-row,
.screen-header,
.detail-top-row,
.auth-brand-row,
.profile-head,
.settings-switch-row,
.topbar-actions {
    align-items: center;
}

.hero-copy {
    margin: 10px 0 18px;
    color: rgba(255, 255, 255, .82);
    line-height: 1.45;
}

.eyebrow {
    font-size: .74rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 800;
    margin: 0 0 8px;
    opacity: .9;
}

.live-pill,
.counter-pill,
.status-badge,
.eta-chip {
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: .8rem;
}

.live-pill {
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
}

.counter-pill,
.status-badge {
    background: #e9f7ef;
    color: #0e8a57;
}

.eta-chip {
    background: rgba(255, 255, 255, .92);
    color: var(--blue-900);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    font-weight: 800;
}

.hero-grid,
.stats-grid,
.detail-grid,
.mini-stats-grid {
    display: grid;
    gap: 12px;
}

.hero-grid {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 14px;
}

.mini-card {
    border-radius: 22px;
    padding: 16px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mini-card.dark {
    background: rgba(6, 22, 53, .34);
}

.mini-card.yellow {
    background: var(--yellow);
    color: var(--yellow-ink);
}

.mini-card.center {
    text-align: center;
    justify-content: center;
}

.label {
    display: block;
    font-size: .73rem;
    letter-spacing: .02em;
    color: inherit;
    opacity: .72;
}

.status-card,
.info-row,
.thread-card,
.alert-card {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.status-card {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 20px;
    padding: 15px 16px;
}

.quick-actions,
.scroll-row {
    display: flex;
    gap: 10px;
    overflow: auto;
    padding: 14px 2px 4px;
    scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar {
    display: none;
}

.chip {
    white-space: nowrap;
    padding: 10px 14px;
    border-radius: 999px;
    background: #fff;
    color: var(--blue-900);
    border: 1px solid var(--line);
    font-weight: 700;
}

.chip.active,
.chip.filled {
    background: var(--blue-900);
    color: #fff;
    border-color: transparent;
}

.content-card {
    background: var(--card);
    padding: 18px;
    margin-top: 14px;
}

.content-card.padded-tight {
    padding: 14px;
}

/* Dashboard: KYC reminder when not admin-approved */
.pwa-dashboard-kyc-card {
    border: 1px solid rgba(180, 120, 40, 0.28);
    background: linear-gradient(145deg, rgba(255, 248, 237, 0.98), rgba(255, 255, 255, 0.94));
    box-shadow: 0 8px 24px rgba(120, 80, 10, 0.08);
}

.pwa-dashboard-kyc-inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (min-width: 420px) {
    .pwa-dashboard-kyc-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .pwa-dashboard-kyc-btn {
        flex-shrink: 0;
    }
}

.pwa-dashboard-kyc-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
}

.pwa-dashboard-kyc-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

body.dark-mode .pwa-dashboard-kyc-card {
    border-color: rgba(245, 180, 90, 0.35);
    background: linear-gradient(145deg, rgba(55, 42, 28, 0.95), rgba(28, 32, 38, 0.92));
}

body.dark-mode .pwa-dashboard-kyc-text {
    color: rgba(255, 255, 255, 0.72);
}

.job-card {
    background: var(--card);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    border: 1px solid rgba(17, 72, 149, .06);
}

.job-card.featured {
    background: linear-gradient(180deg, #ffffff, #f5f9ff);
}

/* Nearby tab: when we fall back to network listings, explain clearly (not an “error” card above jobs) */
.pwa-nearby-fallback-hint {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(20, 95, 198, 0.18);
    background: linear-gradient(180deg, rgba(240, 246, 255, 0.95), rgba(255, 255, 255, 0.92));
}

.pwa-nearby-fallback-title {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: 0.02em;
    margin: 0 0 6px;
}

.pwa-nearby-fallback-sub {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--muted);
}

.pwa-nearby-fallback-sub strong {
    color: var(--ink);
    font-weight: 800;
}

.pwa-nearby-empty {
    margin-top: 12px;
    padding: 16px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--card);
}

.pwa-nearby-empty--alone {
    margin-top: 12px;
}

.pwa-nearby-empty-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--ink);
}

.pwa-nearby-empty-sub {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--muted);
}

body.dark-mode .pwa-nearby-fallback-hint {
    background: linear-gradient(180deg, rgba(26, 34, 50, 0.95), rgba(20, 28, 43, 0.92));
    border-color: rgba(255, 255, 255, 0.08);
}

/* Dashboard: empty miles estimate card */
.pwa-dead-miles-card {
    margin-top: 14px;
}

.pwa-dead-miles-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.pwa-dead-miles-title {
    margin: 4px 0 8px;
    font-size: 1rem;
    font-weight: 900;
    color: var(--ink);
    line-height: 1.25;
}

.pwa-dead-miles-desc {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.82rem;
}

.pwa-dead-miles-stat {
    margin: 10px 0 0;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.8rem;
}

.pwa-dead-miles-btn {
    flex-shrink: 0;
    align-self: center;
    white-space: nowrap;
}

@media (max-width: 380px) {
    .pwa-dead-miles-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .pwa-dead-miles-btn {
        align-self: stretch;
        width: 100%;
    }
}

.job-card h4,
.alert-card h4,
.thread-card strong,
.feature-card h3 {
    margin: 0 0 4px;
}

.job-card p,
.alert-card p,
.thread-card p,
.feature-card p,
.profile-card p,
.settings-switch-row p {
    margin: 0;
    color: var(--muted);
    line-height: 1.42;
}

.job-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.job-bottom .job-price {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--blue-900);
}

.job-bottom .job-price.muted {
    font-weight: 600;
    font-size: .85rem;
    color: var(--muted);
}

.price {
    border-radius: 16px;
    background: var(--yellow);
    color: var(--yellow-ink);
    padding: 10px 12px;
    font-weight: 800;
}

.price.large {
    font-size: 1.1rem;
}

.tags,
.job-meta,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags span,
.job-meta span {
    border-radius: 999px;
    padding: 8px 10px;
    font-size: .78rem;
}

.tags span {
    background: var(--blue-100);
    color: var(--blue-900);
    font-weight: 700;
}

.job-meta span {
    background: #f4f7fb;
    color: var(--muted);
}

.job-meta .status-label {
    background: var(--blue-100);
    color: var(--blue-900);
    font-weight: 700;
}

/* KYC / trust — must override generic .job-meta span */
.job-meta .pwa-trust-badge {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #1b5e20;
    font-weight: 800;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 10px;
    border: 1px solid rgba(27, 94, 32, 0.2);
}

.pwa-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    white-space: nowrap;
}

.pwa-trust-badge--profile {
    margin-top: 6px;
    font-size: 0.68rem;
    width: fit-content;
}

.pwa-trust-badge--inline {
    font-size: 0.58rem;
    padding: 4px 8px;
    margin-left: 4px;
    vertical-align: middle;
}

.jd-trust-strip {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(20, 95, 198, 0.15);
    background: linear-gradient(180deg, rgba(240, 246, 255, 0.95), #fff);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.jd-trust-hint {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.35;
    flex: 1;
    min-width: 140px;
}

body.dark-mode .job-meta .pwa-trust-badge {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.25), rgba(27, 94, 32, 0.35));
    color: #a5d6a7;
    border-color: rgba(165, 214, 167, 0.25);
}

body.dark-mode .jd-trust-strip {
    background: linear-gradient(180deg, rgba(26, 34, 50, 0.95), rgba(20, 28, 43, 0.92));
    border-color: rgba(255, 255, 255, 0.08);
}

.primary-btn,
.secondary-btn,
.install-btn {
    border-radius: 18px;
    padding: 14px 16px;
    font-weight: 800;
    transition: transform .18s ease, filter .18s ease, background .18s ease;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border: none;
}

.primary-btn:active,
.secondary-btn:active,
.install-btn:active,
.nav-item:active {
    transform: scale(.98);
}

.primary-btn {
    background: linear-gradient(180deg, var(--blue-800), var(--blue-900));
    color: #fff;
    box-shadow: 0 12px 24px rgba(17, 72, 149, .22);
}

.secondary-btn {
    background: #fff;
    color: var(--blue-900);
    border: 1px solid var(--line);
}

.primary-btn.small {
    padding: 10px 16px;
    border-radius: 16px;
    font-weight: 800;
    font-size: .82rem;
}

.suggest-chip {
    background: #e8f4fd;
    color: var(--blue-800);
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    max-width: 150px;
}

.status-label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--blue-700);
    background: rgba(20, 95, 198, .08);
    padding: 3px 10px;
    border-radius: 8px;
}

.secondary-btn.full,
.primary-btn.wide,
.secondary-btn.wide {
    width: 100%;
    justify-content: center;
}

.install-btn {
    background: var(--yellow);
    color: var(--yellow-ink);
    padding: 10px 14px;
}

.text-btn {
    color: var(--blue-800);
    font-weight: 800;
    padding: 0;
}

.text-btn.centered {
    align-self: center;
}

.stack-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.screen-header {
    margin-bottom: 14px;
}

.screen-header.compact {
    align-items: flex-start;
    justify-content: flex-start;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .15);
    color: inherit;
    border: 1px solid rgba(255, 255, 255, .16);
}

.screen-header .icon-btn,
.auth-screen .icon-btn {
    background: #fff;
    color: var(--blue-900);
    border: 1px solid var(--line);
}

.auth-screen,
.splash-screen {
    position: absolute;
    inset: 0;
    padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 24px);
}

.splash-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    z-index: 10;
}

.splash-screen .primary-btn {
    position: relative;
    z-index: 11;
    pointer-events: auto;
}

.splash-mark,
.brand-pill,
.avatar {
    display: grid;
    place-items: center;
    font-weight: 900;
}

.splash-mark {
    width: 94px;
    height: 94px;
    border-radius: 28px;
    background: var(--yellow);
    color: var(--blue-900);
    font-size: 2rem;
    box-shadow: 0 22px 40px rgba(0, 0, 0, .16);
}

.splash-copy p {
    color: rgba(255, 255, 255, .82);
    line-height: 1.5;
    max-width: 28ch;
}

.splash-loader {
    display: flex;
    gap: 8px;
}

.splash-loader span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .28);
    animation: bob 1.2s infinite ease-in-out;
}

.splash-loader span:nth-child(2) {
    animation-delay: .15s;
}

.splash-loader span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes bob {

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

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.auth-screen {
    background: linear-gradient(180deg, #f4f8ff 0%, #eef4fb 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.phone-status {
    height: 8px;
}

.auth-brand-row {
    margin-bottom: 24px;
}

.brand-pill,
.avatar {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
    color: #fff;
    box-shadow: var(--shadow);
}

.avatar.small {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: .9rem;
}

.avatar.small.yellow {
    background: var(--yellow);
    color: var(--yellow-ink);
}

.avatar.has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: transparent;
}

.onboarding-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.feature-card {
    background: #fff;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.feature-card.highlighted {
    border: 2px solid rgba(20, 95, 198, .12);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--blue-100);
    font-size: 1.2rem;
}

.auth-actions {
    display: grid;
    gap: 12px;
    margin-top: auto;
}

.auth-card {
    display: grid;
    gap: 14px;
}

.field-label {
    display: grid;
    gap: 8px;
    font-weight: 700;
    color: var(--ink);
}

.text-input {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #f9fbff;
    padding: 14px 15px;
    color: var(--ink);
}

.search-row {
    margin-bottom: 6px;
}

.map-card {
    position: relative;
    overflow: hidden;
    min-height: 320px;
    background: linear-gradient(180deg, #d7e7ff, #ffffff);
    border-radius: var(--radius);
}

.map-grid {
    width: 100%;
    height: 320px;
    z-index: 1;
    background: #e8f0fe;
}

.map-grid.map-placeholder {
    background-image: linear-gradient(rgba(11, 63, 145, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 63, 145, .08) 1px, transparent 1px);
    background-size: 36px 36px;
}

.map-grid .leaflet-container,
.map-grid canvas {
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ── Post job (Poster) ── */
.pj-wrap {
    /* .screen already reserves bottom padding for the tab bar */
    padding-bottom: 8px;
}

.pj-card {
    margin-top: 10px;
}

.pj-section {
    display: grid;
    gap: 12px;
}

.pj-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
}

.pj-section-head h3 {
    margin: 0;
    font-size: .95rem;
    font-weight: 900;
    color: var(--ink);
}

.pj-section-head p {
    margin: 0;
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.3;
    text-align: right;
}

.pj-hr {
    margin: 14px 0;
}

.pj-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pj-field .text-input {
    background: #f9fbff;
}

.pj-help {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: .72rem;
}

.pj-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pj-toggle-card {
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 16px;
    padding: 14px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: transform .15s, background .15s, border-color .15s;
}

.pj-toggle-card:active {
    transform: scale(.985);
}

.pj-toggle-copy strong {
    display: block;
    font-size: .9rem;
    color: var(--ink);
}

.pj-toggle-copy p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.35;
}

.pj-toggle-pill {
    width: 46px;
    height: 28px;
    border-radius: 999px;
    background: #dbe7f8;
    position: relative;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(17, 72, 149, .10);
}

.pj-toggle-pill::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 16px rgba(16, 36, 70, .18);
    transition: transform .18s ease;
}

.pj-toggle-card.on {
    border-color: rgba(20, 95, 198, .22);
    background: linear-gradient(180deg, #f0f6ff, #ffffff);
}

.pj-toggle-card.on .pj-toggle-pill {
    background: linear-gradient(135deg, var(--blue-800), #2563eb);
}

.pj-toggle-card.on .pj-toggle-pill::after {
    transform: translateX(18px);
}

.pj-footer {
    position: static;
    margin-top: 18px;
    padding: 16px 0 0;
    border-top: 1px solid var(--line);
    background: transparent;
}

.pj-submit {
    box-shadow: 0 14px 30px rgba(11, 63, 145, .18);
}

.pj-error {
    min-height: 18px;
    color: #b42318;
    font-weight: 700;
}

body.dark-mode .pj-footer {
    background: transparent;
    border-top-color: var(--line);
}

body.dark-mode .pj-toggle-card {
    background: var(--card);
    border-color: var(--line);
}

body.dark-mode .pj-toggle-pill {
    background: #1a2236;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

body.dark-mode .pj-field .text-input {
    background: #141c2b;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 18px;
    pointer-events: none;
}

.map-overlay>* {
    pointer-events: auto;
}

.truck-marker {
    display: none;
}

.map-placeholder~.map-overlay .truck-marker {
    display: block;
    align-self: center;
    margin-top: 52px;
    font-size: 2rem;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .14));
}

.route-map-card {
    background: #f6f9ff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px;
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.route-line {
    width: 2px;
    background: linear-gradient(var(--blue-700), var(--yellow));
    height: 72px;
    margin-left: 10px;
    position: absolute;
    opacity: .5;
}

.detail-grid,
.mini-stats-grid {
    grid-template-columns: 1fr 1fr;
}

.detail-grid article,
.mini-stats-grid article,
.stats-grid article {
    background: #f6f9ff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
}

/* ── Job detail v2 — compact mobile layout ── */
#screen-job-detail {
    padding: 0 14px 90px;
}

.jd-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0 6px;
}

.jd-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 10px;
    border-radius: 20px;
    background: #e6f4ea;
    color: #1a7f37;
}

.jd-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--blue-900);
    letter-spacing: -.02em;
}

.jd-route-card {
    padding: 12px 14px !important;
    margin: 0 0 10px !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #fff, #f5f9ff);
    position: relative;
}

.jd-route-stop {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.jd-route-stop strong {
    font-size: .92rem;
    color: var(--ink);
    display: block;
}

.jd-route-stop p {
    margin: 2px 0 0;
    font-size: .78rem;
    color: var(--muted);
}

.jd-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 auto;
    margin-top: 4px;
    box-shadow: 0 4px 10px rgba(16, 36, 70, .1);
}

.jd-dot.pickup {
    background: var(--success);
}

.jd-dot.drop {
    background: var(--yellow);
}

.jd-route-line {
    width: 2px;
    height: 16px;
    background: var(--line);
    margin: 2px 0 2px 5px;
}

.jd-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.jd-info-chip {
    background: #f6f9ff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
}

.jd-info-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    display: block;
}

.jd-info-chip strong {
    font-size: .88rem;
    color: var(--ink);
    display: block;
    margin-top: 2px;
}

.jd-info-chip small {
    font-size: .72rem;
    color: var(--muted);
    display: block;
    margin-top: 1px;
}

.jd-quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.jd-hero-card {
    margin-top: 12px;
    padding: 14px !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #fff, #f6f9ff);
    box-shadow: 0 10px 28px rgba(16, 36, 70, .08);
}

.jd-quick-actions--hero {
    margin-bottom: 0;
}

.jd-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 6px;
    border-radius: 14px;
    background: #f0f4ff;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}

.jd-action-btn span {
    font-size: 1.2rem;
}

.jd-action-btn:active {
    transform: scale(.96);
    background: #e2eaff;
}

.jd-bid-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 6px 20px rgba(16, 36, 70, .06);
}

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

.jd-bid-header h3 {
    margin: 0;
    font-size: .92rem;
    font-weight: 800;
    color: var(--ink);
}

.jd-bid-badge {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 3px 8px;
    border-radius: 12px;
    background: #f4f7fb;
    color: var(--muted);
}

.jd-bid-badge.active {
    background: #eef3fa;
    color: var(--blue-900);
}

.jd-bid-fields {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.jd-field {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.jd-field span {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--muted);
    margin-bottom: 4px;
}

.jd-field .text-input {
    padding: 8px 10px;
    font-size: .88rem;
}

.jd-bid-fields .primary-btn {
    padding: 8px 14px;
    white-space: nowrap;
    font-size: .82rem;
    border-radius: 12px;
}

.jd-sub-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 0 8px;
}

.jd-sub-notice span {
    font-size: 1.3rem;
}

.jd-sub-notice strong {
    display: block;
    font-size: .85rem;
    color: var(--ink);
}

.jd-sub-notice p {
    margin: 2px 0 0;
    font-size: .75rem;
    color: var(--muted);
}

.jd-plans-inline {
    margin: 4px 0;
}

.jd-plans-link {
    width: 100%;
    margin-top: 4px;
    font-size: .78rem;
    padding: 8px;
    border-radius: 12px;
    background: transparent;
    border: 1px dashed var(--line);
    color: var(--blue-800);
    cursor: pointer;
    text-align: center;
}

.jd-cancel-btn {
    margin-top: 8px;
    width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    color: #d32f2f;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

.jd-cancel-btn:active {
    background: #fef2f2;
}

.jd-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    margin: 6px 0;
    border-radius: 12px;
    background: #f6f9ff;
    border: 1px solid var(--line);
}

.jd-plan-info {
    display: flex;
    flex-direction: column;
}

.jd-plan-info strong {
    font-size: .85rem;
    color: var(--ink);
}

.jd-plan-info span {
    font-size: .72rem;
    color: var(--muted);
}

body.dark-mode .jd-plan-row {
    background: #141c2b;
    border-color: var(--line);
}

.jd-bid-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jd-bid-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f6f9ff;
}

.jd-bid-left {
    min-width: 0;
}

.jd-bid-left strong {
    display: block;
    font-size: .86rem;
    color: var(--ink);
}

.jd-bid-left small {
    display: block;
    margin-top: 2px;
    font-size: .72rem;
    color: var(--muted);
}

.jd-bid-amt {
    font-weight: 900;
    color: var(--blue-900);
    white-space: nowrap;
}

.jd-bid-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

.jd-accept-btn {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: .78rem;
}

body.dark-mode .jd-bid-row {
    background: #141c2b;
    border-color: var(--line);
}

/* ── Alerts / Notifications screen ── */
.al-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0 16px;
}

.al-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-800), #3574d4);
    color: #fff;
    box-shadow: 0 4px 14px rgba(20, 80, 180, .25);
}

.al-hero-title {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--ink);
}

.al-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    font-size: .72rem;
    font-weight: 800;
    border-radius: 20px;
    background: #ef4444;
    color: #fff;
}

.al-badge.hidden {
    display: none;
}

.al-seg {
    display: flex;
    gap: 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 14px;
}

.al-seg-btn {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}

.al-seg-btn.active {
    background: #fff;
    color: var(--blue-800);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

.al-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.al-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    transition: all .2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.al-card:active {
    transform: scale(.985);
}

.al-card.unread {
    background: linear-gradient(135deg, #f0f6ff, #e8f0fe);
    border-color: rgba(20, 95, 198, .12);
}

.al-card.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--blue-800);
    border-radius: 0 3px 3px 0;
}

.al-ic {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.al-ic.pod {
    background: #fff7e0;
}

.al-ic.bid {
    background: #e6f9ee;
}

.al-ic.job {
    background: #e8f0fe;
}

.al-ic.system {
    background: #f3f4f6;
}

.al-body {
    flex: 1;
    min-width: 0;
}

.al-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.al-title {
    font-size: .84rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.al-time {
    font-size: .68rem;
    color: var(--muted);
    white-space: nowrap;
    flex: 0 0 auto;
    opacity: .75;
}

.al-msg {
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.al-dot {
    display: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 8px;
    background: var(--blue-800);
    align-self: center;
}

.al-card.unread .al-dot {
    display: block;
}

.al-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 40px;
    text-align: center;
}

.al-empty-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eef3fa, #dce7f5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.al-empty-ring svg {
    width: 36px;
    height: 36px;
    color: var(--blue-800);
    opacity: .6;
}

.al-empty h4 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
}

.al-empty p {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.5;
    max-width: 220px;
}

/* Alerts dark mode */
body.dark-mode .al-hero-icon {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}

body.dark-mode .al-seg {
    background: var(--card);
    border-color: var(--line);
}

body.dark-mode .al-seg-btn {
    color: var(--muted);
}

body.dark-mode .al-seg-btn.active {
    background: #1a2236;
    color: #93b4f5;
    box-shadow: none;
}

body.dark-mode .al-card {
    background: var(--card);
    border-color: var(--line);
}

body.dark-mode .al-card.unread {
    background: linear-gradient(135deg, #111a2e, #0f1728);
    border-color: rgba(20, 95, 198, .18);
}

body.dark-mode .al-ic.pod {
    background: rgba(255, 193, 7, .12);
}

body.dark-mode .al-ic.bid {
    background: rgba(40, 167, 69, .12);
}

body.dark-mode .al-ic.job {
    background: rgba(53, 116, 212, .12);
}

body.dark-mode .al-ic.system {
    background: rgba(255, 255, 255, .06);
}

body.dark-mode .al-empty-ring {
    background: linear-gradient(135deg, #1a2236, #141c2e);
}

/* Job detail map */
.jd-map-wrap {
    margin-bottom: 10px;
    border-radius: 16px;
    overflow: hidden;
    background: #e8eef6;
    border: 1px solid var(--line);
}

.jd-map {
    width: 100%;
    height: 200px;
    position: relative;
    z-index: 0;
}

.jd-map-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 14px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--bg);
}

.jd-legend-stop {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.jd-legend-stop .jd-dot {
    width: 8px;
    height: 8px;
    margin-top: 0;
    box-shadow: none;
}

.jd-map-meta {
    margin-left: auto;
    font-weight: 700;
    color: var(--blue-800);
    white-space: nowrap;
}

body.dark-mode .jd-map-wrap {
    background: #141c2b;
    border-color: var(--line);
}

body.dark-mode .jd-map-legend {
    background: var(--card);
}

.full-timeline,
.timeline-mini {
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.timeline-item span {
    flex: 0 0 14px;
    height: 14px;
    margin-top: 4px;
    border-radius: 50%;
    background: #c7d5ea;
    position: relative;
}

.timeline-item.done span {
    background: var(--success);
}

.timeline-item.active span {
    background: var(--yellow);
}

.timeline-item span::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 14px;
    width: 2px;
    height: 44px;
    background: #d9e4f3;
}

.timeline-item:last-child span::after {
    display: none;
}

/* ── Messages list screen ── */
.ms-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0 14px;
}

.ms-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .3);
}

.ms-hero-title {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--ink);
}

.ms-search-wrap {
    position: relative;
    margin-bottom: 14px;
}

.ms-search-ic {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.ms-search {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: .84rem;
    color: var(--ink);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.ms-search:focus {
    border-color: var(--blue-800);
    box-shadow: 0 0 0 3px rgba(20, 80, 180, .1);
}

.ms-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ms-thread {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: all .2s ease;
    width: 100%;
    text-align: left;
}

.ms-thread:active {
    transform: scale(.985);
}

.ms-thread.unread {
    background: linear-gradient(135deg, #f5f0ff, #ede9fe);
    border-color: rgba(99, 102, 241, .12);
}

.ms-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-800), #3574d4);
}

.ms-thread-body {
    flex: 1;
    min-width: 0;
}

.ms-thread-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.ms-thread-name {
    font-size: .86rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-thread-time {
    font-size: .68rem;
    color: var(--muted);
    white-space: nowrap;
    flex: 0 0 auto;
    opacity: .75;
}

.ms-thread-route {
    font-size: .7rem;
    color: var(--muted);
    margin: 0 0 2px;
}

.ms-thread-preview {
    font-size: .78rem;
    color: var(--muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-thread.unread .ms-thread-preview {
    color: var(--ink);
    font-weight: 600;
}

.ms-unread-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 20px;
    background: #6366f1;
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.ms-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 40px;
    text-align: center;
}

.ms-empty-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.ms-empty-ring svg {
    width: 36px;
    height: 36px;
    color: #6366f1;
    opacity: .6;
}

.ms-empty h4 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
}

.ms-empty p {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.5;
    max-width: 220px;
}

/* ── Chat screen ── */
.ch-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0 12px;
}

.ch-back {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 38px;
    color: var(--ink);
    transition: background .15s;
}

.ch-back:active {
    background: var(--bg);
}

.ch-header-info {
    flex: 1;
    min-width: 0;
}

.ch-title {
    display: block;
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-sub {
    display: block;
    font-size: .72rem;
    color: var(--muted);
    margin-top: 1px;
}

.ch-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding: 8px 2px 12px;
    min-height: 55dvh;
    max-height: 65dvh;
    -webkit-overflow-scrolling: touch;
}

.ch-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    animation: bubbleIn .2s ease;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ch-bubble.in {
    background: #f3f6fb;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ch-bubble.out {
    background: linear-gradient(135deg, var(--blue-800), #2563eb);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ch-bubble-name {
    font-size: .72rem;
    font-weight: 700;
    margin: 0 0 2px;
    opacity: .8;
}

.ch-bubble-text {
    font-size: .84rem;
    line-height: 1.45;
    margin: 0;
    word-break: break-word;
}

.ch-bubble-time {
    font-size: .62rem;
    margin-top: 4px;
    opacity: .55;
    text-align: right;
}

.ch-bubble.out .ch-bubble-time {
    opacity: .65;
}

.ch-composer {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 0 2px;
    border-top: 1px solid var(--line);
}

.ch-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: .84rem;
    color: var(--ink);
    outline: none;
    transition: border-color .2s;
}

.ch-input:focus {
    border-color: var(--blue-800);
}

.ch-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--blue-800), #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 42px;
    transition: transform .15s, opacity .15s;
}

.ch-send:active {
    transform: scale(.92);
}

.ch-send:disabled {
    opacity: .45;
}

.ch-paywall {
    padding: 16px;
    text-align: center;
}

.ch-paywall-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #fef3cd;
    color: #92400e;
    font-size: .82rem;
    font-weight: 600;
}

.ch-paywall-inner svg {
    flex: 0 0 24px;
    color: #92400e;
}

.ch-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    flex: 1;
}

.ch-empty svg {
    width: 48px;
    height: 48px;
    color: var(--muted);
    opacity: .3;
    margin-bottom: 12px;
}

.ch-empty p {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
}

/* ── Messaging dark mode ── */
body.dark-mode .ms-hero-icon {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}

body.dark-mode .ms-search {
    background: var(--card);
    border-color: var(--line);
    color: var(--ink);
}

body.dark-mode .ms-thread {
    background: var(--card);
    border-color: var(--line);
}

body.dark-mode .ms-thread.unread {
    background: linear-gradient(135deg, #1a1530, #1c1835);
    border-color: rgba(99, 102, 241, .18);
}

body.dark-mode .ms-empty-ring {
    background: linear-gradient(135deg, #1a1530, #1c1835);
}

body.dark-mode .ch-back {
    background: var(--card);
    border-color: var(--line);
}

body.dark-mode .ch-bubble.in {
    background: #1a2232;
}

body.dark-mode .ch-input {
    background: var(--card);
    border-color: var(--line);
    color: var(--ink);
}

body.dark-mode .ch-composer {
    border-top-color: var(--line);
}

body.dark-mode .ch-paywall-inner {
    background: rgba(254, 243, 205, .08);
    color: #fbbf24;
}

body.dark-mode .ch-paywall-inner svg {
    color: #fbbf24;
}

.alert-card.unread {
    background: #f3f8ff;
    border: 1px solid rgba(20, 95, 198, .16);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

/* Review System */
.rv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 40px;
    text-align: center;
}

.rv-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--bg);
    border: 1px solid var(--line);
}

.rv-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex: 0 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-800), #3574d4);
}

.rv-user-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.rv-job-title {
    margin: 3px 0 0;
    font-size: .8rem;
    color: var(--muted);
}

body.dark-mode .rv-user-card {
    background: var(--card);
    border-color: var(--line);
}

.rating-section {
    margin-bottom: 24px;
    text-align: center;
}

.rating-section h4 {
    margin: 0 0 16px;
    font-size: 16px;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.star {
    background: none;
    border: none;
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star:hover,
.star.active {
    color: #ffd700;
}

.rating-text {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.review-section {
    margin-bottom: 24px;
}

.review-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.review-section textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.char-count {
    color: var(--muted);
    font-size: 12px;
}

.review-actions {
    margin-top: 24px;
}

.review-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 48px;
    color: #22c55e;
    margin-bottom: 16px;
}

.review-success h3 {
    margin: 0 0 12px;
    color: #22c55e;
}

.review-success p {
    margin: 0 0 24px;
    color: var(--muted);
}

.review-existing {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.review-existing h3 {
    margin: 0 0 12px;
}

.existing-rating {
    margin-bottom: 12px;
}

.existing-rating .stars {
    color: #ffd700;
}

.review-summary {
    background: linear-gradient(135deg, var(--blue-800), var(--blue-700));
    color: white;
    padding: 24px;
    border-radius: var(--radius);
    margin-top: 14px;
}

.rating-overview {
    text-align: center;
}

.big-rating {
    margin-bottom: 8px;
}

.big-rating span {
    font-size: 2.8rem;
    font-weight: 900;
    display: block;
}

.big-rating .stars {
    font-size: 1.2rem;
    margin-top: 4px;
    color: rgba(255, 255, 255, .7);
}

.review-summary p {
    margin: 0;
    opacity: 0.85;
    font-size: .9rem;
}

.review-card {
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    margin-bottom: 10px;
}

.review-card h4 {
    margin: 4px 0 6px;
    font-size: .9rem;
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.review-stars {
    color: #f59e0b;
    font-size: 1rem;
    letter-spacing: 1px;
}

.review-date {
    font-size: .72rem;
    color: var(--muted);
}

.review-card .review-text {
    margin: 0 0 8px;
    line-height: 1.45;
    font-size: .85rem;
    color: var(--ink);
}

.review-job {
    font-size: .75rem;
    color: var(--muted);
    font-weight: 600;
}

/* Job actions for review buttons */
.job-actions {
    display: flex;
    gap: 8px;
}

.job-actions .secondary-btn {
    flex: 1;
}

.job-actions .primary-btn.small {
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
}

.full-flex {
    min-height: 68dvh;
    display: flex;
    flex-direction: column;
}

.grow {
    flex: 1;
}

.profile-card {
    display: grid;
    gap: 14px;
    padding: 20px 18px !important;
}

.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.avatar.large {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    font-size: 1.4rem;
}

.avatar-camera-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--blue-700);
    color: #fff;
    border: 2px solid #fff;
    display: grid;
    place-items: center;
    font-size: .75rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    z-index: 2;
    padding: 0;
}

.profile-name-block {
    flex: 1;
    min-width: 0;
}

.profile-name-block h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-badge {
    display: inline-block;
    background: rgba(20, 95, 198, .08);
    color: var(--blue-700);
    font-size: .72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.profile-stats-row {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.profile-stat {
    flex: 1;
    text-align: center;
    border-right: 1px solid var(--line);
}

.profile-stat:last-child {
    border-right: none;
}

.profile-stat strong {
    display: block;
    font-size: 1.15rem;
    color: var(--blue-900);
}

.profile-stat span {
    font-size: .7rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.profile-photo-actions {
    display: flex;
    gap: 10px;
}

.profile-photo-actions .secondary-btn {
    flex: 1;
    text-align: center;
    font-size: .82rem;
    padding: 10px 8px;
}

.camera-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.camera-overlay.hidden {
    display: none;
}

.camera-overlay-inner {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.camera-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.camera-header h3 {
    margin: 0;
    font-size: 1rem;
}

.camera-viewfinder {
    position: relative;
    background: #000;
    aspect-ratio: 1/1;
    overflow: hidden;
}

.camera-viewfinder video,
.camera-viewfinder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.camera-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
}

.camera-shutter {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--blue-700);
    border: 4px solid var(--blue-900);
    font-size: 0;
    padding: 0;
    position: relative;
}

.camera-shutter::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #fff;
}

.profile-actions-wrap {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.profile-actions-wrap:empty {
    display: none;
    margin: 0;
}

.profile-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    transition: background .15s ease;
}

.profile-action-card:active {
    background: #f0f4fa;
}

.profile-action-card .action-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.profile-action-card .action-icon.warn {
    background: #fff7ed;
}

.profile-action-card .action-icon.info {
    background: #e8f4fd;
}

.profile-action-card .action-icon.ok {
    background: #e9f7ef;
}

.profile-action-card .action-body {
    flex: 1;
    min-width: 0;
}

.profile-action-card .action-body strong {
    display: block;
    font-size: .88rem;
    margin-bottom: 2px;
}

.profile-action-card .action-body p {
    margin: 0;
    font-size: .76rem;
    color: var(--muted);
    line-height: 1.35;
}

.profile-action-card .action-go {
    font-weight: 800;
    color: var(--blue-700);
    font-size: .85rem;
    flex-shrink: 0;
}

.menu-group-label {
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    padding: 12px 18px 6px;
    margin: 0;
}

.profile-menu {
    display: grid;
    gap: 0;
}

.profile-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    color: var(--ink);
    font-size: .9rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.profile-menu button:last-child {
    border-bottom: none;
}

.profile-menu button:active {
    background: rgba(20, 95, 198, .04);
}

.menu-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.menu-arrow {
    margin-left: auto;
    color: var(--muted);
    font-size: 1.2rem;
    font-weight: 400;
}

.stats-grid {
    grid-template-columns: repeat(3, 1fr);
}

.settings-list {
    display: grid;
    gap: 10px;
}

.settings-list button {
    background: #f6f9ff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    text-align: left;
    font-weight: 700;
    color: var(--ink);
}

.settings-switch-row {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
}

.pwa-push-extra {
    margin: -8px 0 16px;
    padding: 0 2px;
}

.toggle {
    width: 56px;
    height: 32px;
    border-radius: 999px;
    background: #cfdbee;
    position: relative;
    flex: 0 0 auto;
}

.toggle span {
    width: 24px;
    height: 24px;
    position: absolute;
    top: 4px;
    left: 4px;
    border-radius: 50%;
    background: #fff;
    transition: left .22s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .12);
}

.toggle.on {
    background: var(--blue-800);
}

.toggle.on span {
    left: 28px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(480px, 100%);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 12px 14px calc(env(safe-area-inset-bottom) + 14px);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(216, 228, 243, .9);
    z-index: 25;
}

.nav-item {
    color: var(--muted);
    display: grid;
    gap: 3px;
    place-items: center;
    padding: 8px 0;
    border-radius: 16px;
    font-weight: 700;
}

.nav-item.active {
    color: var(--blue-900);
    background: var(--blue-100);
}

.badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
    z-index: 2;
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    padding: 0 4px;
    z-index: 2;
    line-height: 1;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 110px;
    transform: translate(-50%, 24px);
    max-width: min(380px, calc(100% - 40px));
    width: auto;
    background: var(--ink);
    color: #fff;
    padding: 13px 24px;
    border-radius: 16px;
    opacity: 0;
    transition: opacity .25s ease, transform .32s cubic-bezier(.22, 1, .36, 1);
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .28);
    font-weight: 600;
    font-size: .88rem;
    text-align: center;
    backdrop-filter: blur(14px);
    line-height: 1.35;
}

body.dark-mode .toast {
    background: rgba(30, 42, 62, .95);
    border: 1px solid rgba(255, 255, 255, .08);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -8px);
    pointer-events: auto;
}

.toast.toast-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.toast.toast-error {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.toast.toast-info {
    background: linear-gradient(135deg, var(--blue-800), var(--blue-900));
}

/* PWA update banner (shown when new SW is waiting) */
.pwa-update-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom) + 92px);
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(16, 36, 70, .18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pwa-update-banner__copy strong {
    display: block;
    color: var(--ink);
    font-weight: 900;
    font-size: .9rem;
}

.pwa-update-banner__copy span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    font-size: .78rem;
    margin-top: 2px;
}

.pwa-update-banner__btn {
    flex: 0 0 auto;
    border-radius: 16px;
    padding: 10px 14px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(180deg, var(--blue-800), var(--blue-900));
    box-shadow: 0 12px 24px rgba(17, 72, 149, .18);
}

.pwa-update-banner__btn:disabled {
    opacity: .65;
}

body.dark-mode .pwa-update-banner {
    background: rgba(18, 26, 40, .92);
    border-color: var(--line);
}

.hr {
    height: 1px;
    background: rgba(216, 228, 243, .9);
    margin: 16px 0;
    border-radius: 99px;
}

/* POD on Track screen */
.pod-on-route .full-timeline {
    gap: 14px;
    padding: 0 0 6px;
}

.pod-on-route .timeline-item strong {
    display: block;
    margin-bottom: 4px;
}

.pod-on-route .timeline-item p {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.35;
}

.pod-on-route .timeline-item small {
    color: var(--muted);
    font-weight: 800;
    letter-spacing: .02em;
}

/* POD camera + previews (PWA) */
.pod-camera video.pod-video {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #000;
}

.pod-camera {
    scroll-margin-top: 96px; /* leave room for topbar when scrolled into view */
}

/* Camera opens directly under the “Use camera” button — keep controls with the preview */
.pod-camera-inline {
    scroll-margin-top: 72px;
    margin-top: 8px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(11, 63, 145, 0.04);
}

.pod-camera-inline .pod-camera-inline-title {
    margin-bottom: 8px;
}

.pod-camera-inline .pod-camera-inline-title h3 {
    margin: 0;
    font-size: 1rem;
}

.pod-camera-inline .pod-camera-actions {
    position: static;
    bottom: auto;
    z-index: auto;
    background: transparent;
    padding-bottom: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    margin-top: 10px;
}

.pod-camera-actions {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom) + 86px);
    z-index: 3;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(244,248,255,.9) 28%, rgba(244,248,255,1) 100%);
    padding-bottom: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pod-camera-actions .primary-btn,
.pod-camera-actions .secondary-btn {
    box-shadow: 0 14px 30px rgba(11,63,145,.14);
}

.pod-camera-actions .secondary-btn {
    box-shadow: none;
}

.pod-camera-actions {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.pod-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .9rem;
}

body.dark-mode .pod-camera-inline {
    background: rgba(255, 255, 255, 0.06);
}

.pod-preview-img {
    width: 100%;
    max-width: 320px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
    display: block;
}

.pod-signature-img {
    max-width: 260px;
}

.pod-signature-pad {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    touch-action: none;
    cursor: crosshair;
    display: block;
    background: #fff;
}

/* Signature clear stays under the pad — do not reuse .pod-camera-actions (sticky bottom bar). */
.pod-signature-actions {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    position: static;
    bottom: auto;
    z-index: auto;
    background: transparent;
    padding-bottom: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.dark-mode .pod-signature-actions .secondary-btn {
    box-shadow: none;
}

/* PWA Install button */
.install-app-btn {
    margin-top: 8px;
    background: var(--yellow);
    color: var(--yellow-ink);
    font-weight: 700;
    padding: 14px 20px;
    border-radius: 16px;
    width: 100%;
    font-size: 1rem;
    box-shadow: 0 4px 16px rgba(242, 198, 41, .35);
    transition: transform .18s;
}

.install-app-btn:active {
    transform: scale(.97);
}

/* iOS install guide overlay */
.ios-install-guide {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 12px 24px;
    animation: fadeIn .25s ease;
}

.ios-guide-card {
    background: #fff;
    border-radius: 22px;
    padding: 28px 22px 22px;
    max-width: 380px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    text-align: center;
}

.ios-guide-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.ios-guide-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--blue-100);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.ios-guide-card h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    color: var(--ink);
}

.ios-guide-card p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: .92rem;
}

.ios-guide-card ol {
    text-align: left;
    padding-left: 22px;
    margin: 0 0 18px;
    line-height: 1.7;
    font-size: .92rem;
    color: var(--text);
}

.ios-guide-card li {
    margin-bottom: 6px;
}

.ios-share-icon {
    display: inline-flex;
    vertical-align: middle;
    margin: 0 2px;
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

/* Dark mode */
body.dark-mode {
    --ink: #e8ecf2;
    --text: #c8d0dc;
    --muted: #8b99b0;
    --bg: #0e1420;
    --card: #1a2232;
    --line: #2a3548;
    --shadow: 0 18px 40px rgba(0, 0, 0, .35);
}

body.dark-mode,
body.dark-mode html {
    background: #0a0f1a;
    color: var(--text);
}

body.dark-mode .app-shell {
    background: linear-gradient(180deg, #0e1420 0%, #0a0f1a 100%);
}

body.dark-mode .content-card,
body.dark-mode .job-card,
body.dark-mode .alert-card,
body.dark-mode .feature-card,
body.dark-mode .map-card,
body.dark-mode .review-card {
    background: var(--card);
    border-color: var(--line);
}

body.dark-mode .secondary-btn {
    background: var(--card);
    color: var(--text);
    border-color: var(--line);
}

body.dark-mode .text-input,
body.dark-mode select {
    background: #141c2b;
    color: var(--ink);
    border-color: var(--line);
}

body.dark-mode .chip {
    background: var(--card);
    color: var(--text);
    border-color: var(--line);
}

body.dark-mode .suggest-chip {
    background: rgba(20, 95, 198, .2);
    color: #90c3ff;
}

body.dark-mode .status-label {
    background: rgba(20, 95, 198, .15);
    color: #90c3ff;
}

body.dark-mode .chip.active,
body.dark-mode .chip.filled {
    background: var(--blue-800);
    color: #fff;
}

body.dark-mode .mini-card {
    background: rgba(255, 255, 255, .06);
}

body.dark-mode .mini-card.dark {
    background: rgba(0, 0, 0, .28);
}

body.dark-mode .status-card {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .08);
}

body.dark-mode .bottom-nav {
    background: rgba(18, 26, 40, .97);
    border-color: var(--line);
}

body.dark-mode .nav-item {
    color: var(--muted);
}

body.dark-mode .nav-item.active {
    color: #fff;
    background: rgba(20, 95, 198, .3);
}

body.dark-mode .settings-list button {
    background: #141c2b;
    color: var(--ink);
    border-color: var(--line);
}

body.dark-mode .profile-menu button {
    color: var(--text);
    border-color: var(--line);
}

body.dark-mode .profile-menu button:active {
    background: rgba(255, 255, 255, .04);
}

body.dark-mode .profile-action-card {
    background: var(--card);
    border-color: var(--line);
}

body.dark-mode .profile-stat strong {
    color: #8bb8f5;
}

body.dark-mode .profile-stats-row {
    border-color: var(--line);
}

body.dark-mode .profile-stat {
    border-color: var(--line);
}

body.dark-mode .role-badge {
    background: rgba(20, 95, 198, .2);
    color: #90c3ff;
}

body.dark-mode .avatar-camera-btn {
    background: var(--blue-800);
    border-color: var(--card);
}

body.dark-mode .settings-switch-row {
    background: var(--card);
    border-color: var(--line);
}

body.dark-mode .detail-grid article,
body.dark-mode .mini-stats-grid article,
body.dark-mode .stats-grid article {
    background: #141c2b;
    border-color: var(--line);
}

body.dark-mode .jd-route-card {
    background: linear-gradient(180deg, #1a2232, #141c2b) !important;
    border-color: var(--line) !important;
}

body.dark-mode .jd-info-chip {
    background: #141c2b;
    border-color: var(--line);
}

body.dark-mode .jd-bid-section {
    background: var(--card);
    border-color: var(--line);
}

body.dark-mode .jd-action-btn {
    background: #1a2232;
    border-color: var(--line);
    color: var(--ink);
}

body.dark-mode .jd-action-btn:active {
    background: #222d40;
}

body.dark-mode .jd-hero-card {
    background: linear-gradient(180deg, rgba(26, 34, 50, 1), rgba(26, 34, 50, .72));
    box-shadow: 0 10px 28px rgba(0,0,0,.22);
}

body.dark-mode .jd-cancel-btn {
    border-color: var(--line);
}

body.dark-mode .jd-cancel-btn:active {
    background: #2a1a1a;
}

body.dark-mode .jd-plans-link {
    border-color: var(--line);
    color: var(--blue-400, #6ea8fe);
}

body.dark-mode .jd-status-pill {
    background: rgba(44, 166, 111, .15);
}

body.dark-mode .job-card.featured {
    background: linear-gradient(180deg, #1a2232, #141c2b);
}

body.dark-mode .auth-screen {
    background: linear-gradient(180deg, #0e1420 0%, #0a0f1a 100%);
}

body.dark-mode .screen-header .icon-btn,
body.dark-mode .auth-screen .icon-btn {
    background: var(--card);
    color: var(--ink);
    border-color: var(--line);
}

body.dark-mode .jd-dot.pickup {
    box-shadow: 0 4px 12px rgba(44, 166, 111, .3);
}

body.dark-mode .jd-dot.drop {
    box-shadow: 0 4px 12px rgba(242, 198, 41, .3);
}

body.dark-mode .tags span {
    background: rgba(20, 95, 198, .2);
}

body.dark-mode .job-meta span {
    background: #141c2b;
    color: var(--muted);
}

body.dark-mode .job-bottom .job-price {
    color: #8bb8f5;
}

body.dark-mode .review-summary {
    background: linear-gradient(135deg, var(--blue-900), #0e1420);
}

body.dark-mode .review-card {
    background: var(--card);
    border-color: var(--line);
}

body.dark-mode .camera-overlay-inner {
    background: var(--card);
}

body.dark-mode .camera-header {
    border-color: var(--line);
}

/* ── Extra small phones (fix Post job layout) ── */
@media (max-width: 380px) {

    /* Give the form more horizontal space */
    #screen-post-job {
        padding-left: 12px;
        padding-right: 12px;
    }

    .content-card.pj-card {
        padding: 14px;
    }

    /* Stack 2-col grids into 1-col for narrow screens */
    .pj-grid-2 {
        grid-template-columns: 1fr;
    }

    .pj-toggles {
        grid-template-columns: 1fr;
    }

    .pj-wrap {
        padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
    }

    /* Slightly reduce control padding to avoid cramped UI */
    .text-input {
        padding: 12px 13px;
        border-radius: 14px;
    }

    .pj-toggle-card {
        padding: 12px;
    }
}

@media (min-width: 700px) {
    body {
        padding: 20px;
    }

    .app-shell {
        border-radius: 34px;
        overflow: hidden;
        box-shadow: 0 30px 80px rgba(16, 36, 70, .16);
        min-height: calc(100dvh - 40px);
        background: linear-gradient(180deg, #dfe9f7 0%, var(--bg) 26%, #f8fbff 100%);
    }

    body.dark-mode .app-shell {
        box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
        background: linear-gradient(180deg, #0e1420 0%, #0a0f1a 100%);
    }

    .bottom-nav {
        bottom: 20px;
        border-radius: 24px;
        width: min(448px, calc(100% - 40px));
    }
}
