:root {
    --pk-navy: #0B132B;
    --pk-deep: #1C2541;
    --pk-teal: #00B4D8;
    --pk-emerald: #10B981;
    --pk-accent: #F59E0B;
    --pk-bottom: 74px;
}

html { -webkit-text-size-adjust: 100%; }
body { background: var(--pk-navy); }

/* ---------- CSS brand mark: parcel tile + PIKDEL wordmark ---------- */
.pk-brand {
    --pk-brand-mark: 42px;
    display: inline-flex;
    align-items: center;
    gap: .68rem;
    min-width: 0;
    line-height: 1;
}
.pk-brand__mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--pk-brand-mark);
    height: var(--pk-brand-mark);
    border-radius: calc(var(--pk-brand-mark) * .30);
    color: #05231d;
    font-size: calc(var(--pk-brand-mark) * .44);
    background:
        radial-gradient(circle at 28% 20%, rgba(255, 255, 255, .5), transparent 34%),
        linear-gradient(135deg, #34d399 0%, #10b981 44%, #00b4d8 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .25),
        0 0 0 1px rgba(0, 180, 216, .45),
        0 10px 22px -10px rgba(0, 180, 216, .95);
}
.pk-brand__mark::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: calc(var(--pk-brand-mark) * .24);
    pointer-events: none;
}
.pk-brand__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.pk-brand__name {
    display: block;
    color: #fff;
    font-size: 1.22rem;
    font-weight: 900;
    letter-spacing: .085em;
    white-space: nowrap;
}
.pk-brand__name::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: .34rem;
    border-radius: 50%;
    vertical-align: middle;
    background: var(--pk-emerald);
    box-shadow: 0 0 8px rgba(16, 185, 129, .95);
}
.pk-brand__tagline {
    display: block;
    max-width: 17rem;
    margin-top: .24rem;
    overflow: hidden;
    color: #94a3b8;
    font-size: .48rem;
    font-weight: 700;
    letter-spacing: .15em;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.pk-brand--sm { --pk-brand-mark: 32px; }
.pk-brand--sm .pk-brand__name { font-size: 1rem; }
.pk-brand--sm .pk-brand__tagline { font-size: .43rem; }
.pk-brand--md { --pk-brand-mark: 42px; }
.pk-brand--lg { --pk-brand-mark: 52px; }
.pk-brand--lg .pk-brand__name { font-size: 1.55rem; }
.pk-brand--lg .pk-brand__tagline { font-size: .54rem; }

/* Homepage artwork, shown above the hero heading. */
.pk-hero-logo {
    display: inline-flex;
    padding: 4px;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #10B981 0%, #00B4D8 48%, #F59E0B 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 16px 34px -16px rgba(0, 180, 216, .95);
}
.pk-hero-logo__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    border-radius: 1rem;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(11, 19, 43, .10);
}
.pk-hero-logo img {
    display: block;
    width: auto;
    height: 111px;
    max-width: 368px;
    border-radius: .72rem;
}
@media (min-width: 640px) {
    .pk-hero-logo img { height: 138px; max-width: 435px; }
}
@media (min-width: 1024px) {
    .pk-hero-logo img { height: 162px; max-width: 480px; }
}
@media (max-width: 640px) {
    .pk-brand__tagline { max-width: 8.5rem; }
}
@media (max-width: 380px) {
    .pk-brand--md { --pk-brand-mark: 36px; }
    .pk-brand__tagline { display: none; }
    .pk-hero-logo img { height: 96px; max-width: 315px; }
}

/* Installed PWA: keep the header below the iPhone notch/status bar. */
@media (display-mode: standalone) {
    body { padding-top: env(safe-area-inset-top); }
}

.glass-panel {
    background: rgba(28, 37, 65, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.pk-card {
    background: rgba(28, 37, 65, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.25rem;
}
.pk-input {
    width: 100%;
    background: rgba(11, 19, 43, 0.9);
    border: 1px solid #334155;
    border-radius: 0.85rem;
    padding: 0.75rem 0.9rem;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.92rem;
    -webkit-text-security: none;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pk-input:focus { border-color: var(--pk-teal); box-shadow: 0 0 0 3px rgba(0, 180, 216, .18); }
.pk-input::placeholder { color: #64748b; }
.pk-label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin-bottom: .4rem;
}
.pk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: .9rem;
    font-weight: 700;
    padding: .8rem 1.1rem;
    transition: transform .15s ease, opacity .15s ease, background .15s ease;
    cursor: pointer;
}
.pk-btn:active { transform: translateY(1px); }
.pk-btn-primary { background: linear-gradient(135deg, var(--pk-emerald), var(--pk-teal)); color: #062018; }
.pk-btn-primary:hover { opacity: .94; }
.pk-btn-ghost { background: rgba(30, 41, 59, .8); color: #e2e8f0; border: 1px solid #334155; }
.pk-btn-ghost:hover { background: rgba(51, 65, 85, .9); }
.pk-btn-danger { background: rgba(244, 63, 94, .15); color: #fda4af; border: 1px solid rgba(244, 63, 94, .4); }
.pk-btn:disabled { opacity: .55; cursor: not-allowed; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .22rem .6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .35);
    color: #cbd5e1;
}

/* ---------- Bottom navigation (mobile app style) ---------- */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    display: flex;
    background: rgba(11, 19, 43, .96);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(51, 65, 85, .8);
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: .55rem 0 .5rem;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #94a3b8;
    text-decoration: none;
}
.bottom-nav a i { font-size: 1.05rem; }
.bottom-nav a.active { color: var(--pk-emerald); }
.bottom-nav a.active i { filter: drop-shadow(0 0 6px rgba(16, 185, 129, .55)); }
.bottom-nav .lang-flag { font-size: 1.1rem; line-height: 1; }
body.has-bottom-nav { padding-bottom: calc(var(--pk-bottom) + env(safe-area-inset-bottom)); }

/* ---------- Maps ---------- */
.pk-map {
    width: 100%;
    height: 320px;
    border-radius: 1rem;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, .25);
    position: relative;
    z-index: 0;
}
.pk-map-wrap { position: relative; }
.pk-map-status {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem;
    border-radius: 1rem;
    background: rgba(11, 19, 43, .78);
    color: #cbd5e1;
    font-size: .78rem;
    line-height: 1.5;
    pointer-events: none;
}
.pk-map-status.error {
    background: rgba(76, 5, 25, .82);
    color: #fecdd3;
}
.pk-map-status[hidden] { display: none; }
.pk-map-tall { height: 55vh; min-height: 340px; }
.pk-map-toolbar {
    position: absolute;
    top: .75rem;
    right: .75rem;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: .2rem;
    padding: .2rem;
    border-radius: .7rem;
    border: 1px solid rgba(148, 163, 184, .3);
    background: rgba(11, 19, 43, .92);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
    backdrop-filter: blur(8px);
}
.pk-map-toolbar button {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .35rem .55rem;
    border-radius: .5rem;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
}
.pk-map-toolbar button:hover:not(:disabled) { background: rgba(148, 163, 184, .15); color: #fff; }
.pk-map-toolbar button.is-active { background: var(--pk-emerald); color: #06121f; }
.pk-map-toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.pk-map-toolbar button i { font-size: .7rem; }
.pk-fullmap .pk-map-toolbar {
    top: auto;
    right: auto;
    left: .75rem;
    bottom: .75rem;
}
@media (max-width: 640px) {
    .pk-map-toolbar { top: .5rem; right: .5rem; }
    .pk-map-toolbar button { padding: .3rem .4rem; font-size: .62rem; }
    .pk-fullmap .pk-map-toolbar { top: auto; right: auto; left: .5rem; bottom: .5rem; }
}
.pk-map .leaflet-container { background: #0f172a; }
/* ---------- Rider full-screen navigation ---------- */
body.pk-nav-page { overflow: hidden; }
body.pk-nav-page header,
body.pk-nav-page .bottom-nav { display: none !important; }
.pk-rider-nav {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow: hidden;
    background: #0b132b;
}
.pk-rider-nav-map-wrap { position: absolute; inset: 0; }
.pk-rider-nav-map { width: 100%; height: 100%; border: 0; border-radius: 0; }
.pk-rider-nav-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: calc(.75rem + env(safe-area-inset-top)) .85rem .75rem;
    background: linear-gradient(180deg, rgba(11, 19, 43, .97), rgba(11, 19, 43, .82) 75%, transparent);
    pointer-events: auto;
}
.pk-rider-nav-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(15, 26, 53, .94);
    border: 1px solid #334155;
    color: #e2e8f0;
    text-decoration: none;
}
.pk-rider-nav-bottom {
    position: absolute;
    left: .65rem; right: .65rem;
    bottom: calc(.65rem + env(safe-area-inset-bottom));
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .8rem .9rem;
    border-radius: 1.1rem;
    background: rgba(11, 19, 43, .96);
    border: 1px solid rgba(148, 163, 184, .3);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .45);
    backdrop-filter: blur(18px);
}
@media (max-width: 640px) {
    .pk-rider-nav-bottom { align-items: stretch; flex-direction: column; gap: .55rem; }
    .pk-rider-nav-bottom .pk-btn { flex: 1 1 auto; justify-content: center; }
}
.pk-fullmap { position: fixed; inset: 0; overflow: hidden; }
.pk-fullmap-wrap { position: absolute; inset: 0; }
.pk-fullmap .pk-map { width: 100%; height: 100%; border: 0; border-radius: 0; }
.pk-fullmap-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 20;
    padding: .65rem .75rem;
    background: rgba(11, 19, 43, .93);
    border-bottom: 1px solid rgba(51, 65, 85, .8);
    backdrop-filter: blur(16px);
}
.pk-fullmap-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .7rem;
    color: #94a3b8;
    font-size: .66rem;
}
.pk-fullmap-stats b { color: #e2e8f0; font-size: .72rem; }
.pk-map-drawer {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    z-index: 30;
    width: min(430px, 100%);
    display: flex;
    flex-direction: column;
    background: rgba(11, 19, 43, .98);
    border-left: 1px solid rgba(51, 65, 85, .9);
    box-shadow: -18px 0 45px rgba(0, 0, 0, .5);
    transform: translateX(102%);
    transition: transform .22s ease;
}
.pk-map-drawer.open { transform: translateX(0); }
@media (max-width: 640px) {
    .pk-fullmap-bar { padding: .5rem; }
    .pk-fullmap-stats { width: 100%; order: 5; }
}

.map-pin {
    width: 30px; height: 30px;
    border-radius: 50% 50% 50% 6px;
    transform: rotate(-45deg);
    display: flex; align-items: center; justify-content: center;
    color: #06121f; font-weight: 800; font-size: .7rem;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.map-pin span { transform: rotate(45deg); }
.map-pin.pickup { background: var(--pk-emerald); }
.map-pin.dropoff { background: var(--pk-accent); }
.map-pin.rider { border-radius: 50%; background: var(--pk-teal); width: 34px; height: 34px; transform: none; font-size: .95rem; }
.map-pin.rider span { transform: none; }

/* ---------- Address autocomplete ---------- */
.ac-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.ac-list {
    position: absolute;
    z-index: 50;
    left: 0; right: 0;
    top: calc(100% + 6px);
    background: #0f1a35;
    border: 1px solid #334155;
    border-radius: .85rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
    max-height: 260px;
    overflow-y: auto;
    display: none;
}
.ac-list.open { display: block; }
.ac-list button {
    display: block;
    width: 100%;
    text-align: left;
    padding: .65rem .85rem;
    font-size: .82rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(51, 65, 85, .5);
}

/* Postcode street/address suggestions on the client booking page. */
.pk-postcode-list {
    margin-top: .45rem;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid #334155;
    border-radius: .85rem;
    background: #0f1a35;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.pk-postcode-list[hidden] { display: none; }
.pk-postcode-list button {
    display: block;
    width: 100%;
    padding: .6rem .8rem;
    text-align: left;
    border: 0;
    border-bottom: 1px solid rgba(51, 65, 85, .55);
    background: transparent;
    color: #e2e8f0;
    font-size: .78rem;
}
.pk-postcode-list button:last-child { border-bottom: 0; }
.pk-postcode-list button:hover,
.pk-postcode-list button:focus { background: rgba(0, 180, 216, .15); outline: none; }
.pk-postcode-list .pk-postcode-main { display: block; font-weight: 700; }
.pk-postcode-list .pk-postcode-sub { display: block; color: #94a3b8; font-size: .68rem; margin-top: .1rem; }
.pk-postcode-list .pk-postcode-kind { float: right; color: #00B4D8; font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; }

/* Booking address rows: the postcode field is only shown for the UK. */
.door-address-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .5rem;
    align-items: start;
}
.door-address-grid > [data-address-find] { justify-self: start; }
@media (min-width: 640px) {
    .door-address-grid { grid-template-columns: 8rem minmax(0, 1fr) auto; }
    .door-address-grid.no-postal { grid-template-columns: minmax(0, 1fr) auto; }
}

#toastWrap {
    position: fixed;
    top: 1rem; right: 1rem; left: 1rem;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    align-items: flex-end;
    pointer-events: none;
}
#toastWrap > div {
    pointer-events: auto;
    max-width: 24rem;
    width: 100%;
    border-radius: 1rem;
    padding: .8rem 1rem;
    font-size: .82rem;
    border: 1px solid rgba(148, 163, 184, .35);
    background: rgba(15, 26, 53, .97);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .45);
    animation: pk-in .22s ease-out;
}
#toastWrap .ok { border-color: rgba(16, 185, 129, .5); }
#toastWrap .err { border-color: rgba(244, 63, 94, .55); }
@keyframes pk-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Stepper / pulse ---------- */
.stepper { display: flex; align-items: center; gap: .35rem; }
.stepper .dot { width: 1.55rem; height: 1.55rem; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 800; background: #1e293b; color: #94a3b8; border: 1px solid #334155; }
.stepper .dot.on { background: rgba(16, 185, 129, .18); color: #6ee7b7; border-color: rgba(16, 185, 129, .6); }
.stepper .line { flex: 1; height: 2px; background: #1e293b; }
.stepper .line.on { background: rgba(16, 185, 129, .6); }
.ring-pulse { animation: pk-pulse 1.6s ease-out infinite; }
@keyframes pk-pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); } 70% { box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.spin { animation: pk-spin 1s linear infinite; }
@keyframes pk-spin { to { transform: rotate(360deg); } }

/* ---------- Tables / misc ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0B132B; }
::-webkit-scrollbar-thumb { background: #1C2541; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #10B981; }
.stat-value { font-variant-numeric: tabular-nums; }
table.pk-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
table.pk-table th { text-align: left; font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; padding: .6rem .7rem; border-bottom: 1px solid #26334d; white-space: nowrap; }
table.pk-table td { padding: .7rem; border-bottom: 1px solid rgba(38, 51, 77, .6); vertical-align: middle; }
table.pk-table tr:hover td { background: rgba(0, 180, 216, .04); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
[hidden] { display: none !important; }

@media (min-width: 1024px) {
    body.has-bottom-nav { padding-bottom: 0; }
    .bottom-nav { display: none; }
    .pk-map { height: 420px; }
}

.ac-list button:hover, .ac-list button.active { background: rgba(0, 180, 216, .15); }
.ac-list .ac-main { font-weight: 600; }
.ac-list .ac-sub { color: #94a3b8; font-size: .72rem; }

.badge-new { border-color: rgba(245, 158, 11, .45); color: #fbbf24; background: rgba(245, 158, 11, .08); }
.badge-accepted { border-color: rgba(0, 180, 216, .45); color: #67e8f9; background: rgba(0, 180, 216, .08); }
.badge-picked { border-color: rgba(129, 140, 248, .45); color: #a5b4fc; background: rgba(99, 102, 241, .1); }
.badge-delivered { border-color: rgba(16, 185, 129, .5); color: #6ee7b7; background: rgba(16, 185, 129, .1); }
.badge-cancelled { border-color: rgba(244, 63, 94, .45); color: #fda4af; background: rgba(244, 63, 94, .08); }
.badge-paid { border-color: rgba(16, 185, 129, .5); color: #6ee7b7; }
.badge-unpaid { border-color: rgba(244, 63, 94, .45); color: #fda4af; }
.badge-pending { border-color: rgba(245, 158, 11, .45); color: #fbbf24; }
