/* Public pages: shipment tracking (track.php), plus the shared public header and
 * design tokens also used by the sign-in page (assets/css/auth-login.css). */

/* ------------------------------------------------------------------ shared tokens */

.pt-page,
.auth-page {
    --pt-navy: #0b1d55;
    --pt-navy-2: #132f86;
    --pt-primary: #2453e6;
    --pt-primary-2: #1b3fc9;
    --pt-glow: #4c8dff;
    --pt-text: #0f1b3d;
    --pt-muted: #67718a;
    --pt-soft: #f4f7fd;
    --pt-line: #e4e9f4;
    --pt-success: #15a05a;
    --pt-warning: #e48a0b;
    --pt-danger: #d92d3a;
    --pt-radius: 20px;
    --pt-shadow: 0 12px 34px rgba(17, 38, 107, .08);
    /* One type scale for the whole page. */
    --pt-font: 'Almarai', 'Droid Arabic Kufi', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --pt-fs-caption: 12.5px;
    --pt-fs-small: 13.5px;
    --pt-fs-body: 15px;
    --pt-fs-lead: 17px;
    --pt-fs-value: 20px;
    --pt-fs-title: 26px;
}

/* ------------------------------------------------------------------ tracking page */

.pt-page {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1100px 520px at 12% -10%, rgba(76, 141, 255, .14), transparent 60%),
        radial-gradient(900px 500px at 110% 20%, rgba(36, 83, 230, .08), transparent 60%),
        var(--pt-soft);
    color: var(--pt-text);
    font-family: var(--pt-font);
    font-size: var(--pt-fs-body);
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.pt-page *, .pt-page *::before, .pt-page *::after { box-sizing: border-box; }
/* Zero-specificity reset so component classes below always win. */
.pt-page :where(button, input) { font: inherit; color: inherit; }
.pt-page [hidden] { display: none !important; }

.pt-page :focus-visible {
    outline: 3px solid rgba(76, 141, 255, .55);
    outline-offset: 2px;
}

.pt-visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------------------------------------------------------------- header */

.pt-header {
    position: relative;
    background:
        radial-gradient(600px 160px at 75% 0%, rgba(76, 141, 255, .35), transparent 70%),
        linear-gradient(100deg, #081646 0%, var(--pt-navy) 45%, var(--pt-navy-2) 100%);
    border-radius: 0 0 26px 26px;
    box-shadow: 0 10px 30px rgba(8, 22, 70, .25);
    color: #fff;
}

.pt-header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
    min-height: 84px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.pt-brand { display: inline-flex; align-items: center; flex-shrink: 0; text-decoration: none; }

.pt-brand img { height: 56px; width: auto; display: block; }

/* Reference order (RTL): language, navigation, then the logo at the far end. */
.pt-brand { margin-inline-start: auto; }

.pt-nav {
    display: flex;
    align-items: stretch;
    gap: 6px;
    align-self: stretch;
}

.pt-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    color: rgba(255, 255, 255, .86);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--pt-fs-body);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color .15s ease, background-color .15s ease;
}

.pt-nav a i { font-size: 20px; }
.pt-nav a:hover { color: #fff; }

.pt-nav a[aria-current="page"] {
    color: #fff;
    background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .12));
    border-bottom-color: var(--pt-glow);
    border-radius: 14px 14px 0 0;
}

.pt-lang {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: var(--pt-fs-small);
    background: rgba(255, 255, 255, .06);
}

.pt-lang img { width: 24px; height: 16px; border-radius: 3px; object-fit: cover; }
.pt-lang:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* ---------------------------------------------------------------- layout */

.pt-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 26px 32px 40px;
    display: grid;
    grid-template-columns: minmax(360px, 0.64fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.pt-side, .pt-main { display: grid; gap: 20px; min-width: 0; }

.pt-card {
    background: #fff;
    border: 1px solid var(--pt-line);
    border-radius: var(--pt-radius);
    box-shadow: var(--pt-shadow);
    padding: 24px;
}

/* ---------------------------------------------------------------- search card */

.pt-search {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(115deg, rgba(76, 141, 255, .10), transparent 42%),
        #fff;
}

.pt-search-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }

.pt-icon-tile {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(145deg, #e8f0ff, #cfe0ff);
    color: var(--pt-primary);
    font-size: 28px;
    box-shadow: inset 0 0 0 1px rgba(36, 83, 230, .10);
}

.pt-title { margin: 0; font-size: var(--pt-fs-title); font-weight: 700; line-height: 1.3; color: var(--pt-text); }
.pt-subtitle { margin: 4px 0 0; color: var(--pt-muted); font-size: var(--pt-fs-small); }

.pt-field { position: relative; }

.pt-input {
    width: 100%;
    height: 58px;
    padding-inline: 18px 52px;
    border: 1.5px solid #dbe2f0;
    border-radius: 14px;
    background: #fff;
    font-size: var(--pt-fs-lead);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.pt-input::placeholder { color: #9aa4ba; font-weight: 400; letter-spacing: .04em; text-transform: none; }
.pt-input:focus { outline: none; border-color: var(--pt-primary); box-shadow: 0 0 0 4px rgba(36, 83, 230, .12); }

/* The input is always LTR (the code is Latin), so the icon sits on its right in both languages. */
.pt-field > i {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    color: #7d88a3;
    font-size: 22px;
    pointer-events: none;
}

.pt-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 58px;
    margin-top: 14px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(100deg, #2e63ff, var(--pt-primary-2));
    color: #fff;
    font-size: var(--pt-fs-lead);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(36, 83, 230, .28);
    transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}

.pt-submit i { font-size: 22px; }
.pt-submit:hover { filter: brightness(1.06); box-shadow: 0 12px 26px rgba(36, 83, 230, .34); }
.pt-submit:active { transform: translateY(1px); }
.pt-submit[disabled] { cursor: progress; filter: saturate(.7); }

.pt-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pt-spin .8s linear infinite;
}

.pt-helper {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 14px 0 0;
    color: var(--pt-muted);
    font-size: var(--pt-fs-caption);
}

.pt-helper i { color: #8c96ad; margin-top: 2px; }

.pt-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: var(--pt-fs-small);
    line-height: 1.7;
}

.pt-alert i { font-size: 18px; margin-top: 1px; }
.pt-alert.is-warning { background: #fff7e8; color: #8a5300; border: 1px solid #fde3b0; }
.pt-alert.is-danger { background: #fff0f1; color: #a61b27; border: 1px solid #ffd0d4; }

/* ---------------------------------------------------------------- details card */

.pt-details-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.pt-label { display: block; color: var(--pt-muted); font-size: var(--pt-fs-caption); font-weight: 500; }

.pt-code-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }

.pt-code {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    font-size: var(--pt-fs-lead);
    font-weight: 700;
    color: var(--pt-navy);
    letter-spacing: .05em;
}

.pt-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--pt-line);
    border-radius: 10px;
    background: #fff;
    color: #5b6684;
    font-size: 17px;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.pt-icon-btn:hover { color: var(--pt-primary); border-color: #c9d6f6; background: #f5f8ff; }
.pt-icon-btn.is-done { color: var(--pt-success); border-color: #bfe8d2; }

.pt-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: var(--pt-fs-small);
    white-space: nowrap;
}

.pt-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pt-badge.tone-progress { background: #eaf1ff; color: var(--pt-primary); }
.pt-badge.tone-live { background: #e7f7ee; color: var(--pt-success); }
.pt-badge.tone-success { background: #e7f7ee; color: var(--pt-success); }
.pt-badge.tone-warning { background: #fff4e2; color: #b26a00; }
.pt-badge.tone-danger { background: #fdecee; color: var(--pt-danger); }

.pt-head-actions { display: flex; align-items: center; gap: 8px; }

/* timeline */

.pt-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 26px 0 6px;
    padding: 0;
}

.pt-step { position: relative; text-align: center; color: #8a93a9; font-size: var(--pt-fs-small); font-weight: 600; }

.pt-step-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #eef1f7;
    color: #9aa3b8;
    font-size: 20px;
    box-shadow: 0 0 0 5px #fff;
    transition: background-color .2s ease;
}

.pt-step::after {
    content: "";
    position: absolute;
    top: 22px;
    inset-inline-start: calc(50% + 23px);
    width: calc(100% - 46px);
    height: 3px;
    border-radius: 3px;
    background: #e4e8f1;
}

.pt-step:last-child::after { display: none; }

.pt-step.is-done { color: var(--pt-text); }
.pt-step.is-done .pt-step-icon { background: var(--pt-primary); color: #fff; }
.pt-step.is-done::after { background: var(--pt-primary); }

.pt-step.is-current .pt-step-icon {
    width: 54px;
    height: 54px;
    margin-top: -4px;
    margin-bottom: 6px;
    background: radial-gradient(circle at 30% 30%, #4f7dff, var(--pt-primary-2));
    box-shadow: 0 0 0 6px rgba(36, 83, 230, .16), 0 8px 18px rgba(36, 83, 230, .35);
}

.pt-step.is-current { color: var(--pt-primary); font-weight: 700; }
.pt-step.is-current::after { background: #e4e8f1; }

/* off-track outcome (cancelled / returned / failed) */

.pt-outcome {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid;
}

.pt-outcome i { font-size: 26px; line-height: 1; }
.pt-outcome strong { display: block; font-size: var(--pt-fs-body); font-weight: 700; }
.pt-outcome p { margin: 4px 0 0; font-size: var(--pt-fs-small); }
.pt-outcome.tone-danger { background: #fff5f6; border-color: #fbd3d8; color: #9f1d29; }
.pt-outcome.tone-warning { background: #fff8ec; border-color: #fde2b2; color: #8a5300; }

/* driver */

.pt-driver {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    padding: 16px 18px;
    border: 1px solid var(--pt-line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfcff, #f6f8fe);
}

.pt-avatar {
    position: relative;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3a6cff, var(--pt-navy-2));
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(19, 47, 134, .25);
}

.pt-avatar.is-empty { background: #e9edf6; color: #8d97ad; box-shadow: none; }

.pt-avatar .pt-online {
    position: absolute;
    bottom: 2px;
    inset-inline-end: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--pt-success);
    box-shadow: 0 0 0 3px #fff;
}

.pt-driver-main { flex: 1; min-width: 0; }
.pt-driver-name { display: block; font-size: var(--pt-fs-lead); font-weight: 700; color: var(--pt-text); overflow-wrap: anywhere; }

.pt-driver-side {
    flex-shrink: 0;
    padding-inline-start: 16px;
    border-inline-start: 1px solid var(--pt-line);
    max-width: 48%;
}

.pt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: var(--pt-fs-caption);
    font-weight: 600;
    background: #eef1f7;
    color: #5d6781;
}

.pt-chip.is-live { background: #e7f7ee; color: var(--pt-success); }
.pt-chip.is-recent { background: #fff4e2; color: #9a5d00; }
.pt-note { margin: 4px 0 0; color: var(--pt-muted); font-size: var(--pt-fs-caption); }

.pt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }

.pt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 8px 14px;
    border: 1px solid #d9e2f5;
    border-radius: 14px;
    background: #fff;
    color: var(--pt-primary);
    font-weight: 600;
    font-size: var(--pt-fs-body);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.pt-btn i { font-size: 19px; }
.pt-btn:hover { background: #f4f7ff; border-color: #bccdf4; color: var(--pt-primary-2); }

/* empty / intro */

.pt-empty { text-align: center; padding: 30px 24px; }

.pt-empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #eef3ff;
    color: var(--pt-primary);
    font-size: 28px;
}

.pt-empty h2 { margin: 0; font-size: var(--pt-fs-lead); font-weight: 700; }
.pt-empty p { margin: 6px auto 0; max-width: 340px; color: var(--pt-muted); font-size: var(--pt-fs-small); }

/* skeleton */

.pt-skeleton {
    border-radius: 10px;
    background: linear-gradient(90deg, #eef1f7 25%, #f7f9fc 50%, #eef1f7 75%);
    background-size: 200% 100%;
    animation: pt-shimmer 1.2s ease-in-out infinite;
}

/* ---------------------------------------------------------------- map panel */

.pt-map-panel {
    position: relative;
    height: clamp(420px, 64vh, 640px);
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(700px 360px at 30% 20%, rgba(76, 141, 255, .28), transparent 65%),
        radial-gradient(520px 320px at 85% 90%, rgba(36, 83, 230, .25), transparent 70%),
        linear-gradient(160deg, #0a1b52, #071238 70%);
    box-shadow: 0 18px 40px rgba(8, 22, 70, .22);
    isolation: isolate;
}

/* Decorative street grid behind the empty states (no data, purely visual). */
.pt-map-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(120, 165, 255, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 165, 255, .07) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
    pointer-events: none;
}

.pt-map { position: absolute; inset: 0; z-index: 1; background: #0a1b52; }
/* leaflet.css loads later; keep unloaded tiles navy instead of its grey. */
.pt-map.leaflet-container { background: #0a1b52; }

/* OSM tiles recoloured to the navy theme. */
.pt-map .leaflet-tile-pane {
    filter: invert(1) contrast(.82) sepia(1) hue-rotate(182deg) saturate(4.2) brightness(.82);
}

.pt-map .leaflet-control-attribution {
    background: rgba(7, 18, 56, .72);
    color: #9fb4e6;
    font-size: 10.5px;
    border-radius: 8px 8px 0 0;
}

.pt-map .leaflet-control-attribution a { color: #c8d6ff; }

.pt-map-state {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 32px;
    text-align: center;
    color: #fff;
}

.pt-map-state-inner { max-width: 420px; }

.pt-map-state-icon {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(124, 172, 255, .55), rgba(36, 83, 230, .25));
    box-shadow: 0 0 0 10px rgba(76, 141, 255, .10), 0 0 40px rgba(76, 141, 255, .45);
    font-size: 38px;
}

.pt-map-state.tone-success .pt-map-state-icon { background: radial-gradient(circle at 35% 30%, rgba(80, 220, 150, .6), rgba(21, 160, 90, .3)); box-shadow: 0 0 0 10px rgba(21, 160, 90, .12), 0 0 40px rgba(21, 160, 90, .45); }
.pt-map-state.tone-danger .pt-map-state-icon { background: radial-gradient(circle at 35% 30%, rgba(255, 120, 130, .6), rgba(217, 45, 58, .3)); box-shadow: 0 0 0 10px rgba(217, 45, 58, .12), 0 0 40px rgba(217, 45, 58, .4); }
.pt-map-state.tone-warning .pt-map-state-icon { background: radial-gradient(circle at 35% 30%, rgba(255, 196, 100, .65), rgba(228, 138, 11, .3)); box-shadow: 0 0 0 10px rgba(228, 138, 11, .12), 0 0 40px rgba(228, 138, 11, .4); }

.pt-map-state h2 { margin: 0; font-size: var(--pt-fs-value); font-weight: 700; }
.pt-map-state p { margin: 8px 0 0; color: #b9c8ee; font-size: var(--pt-fs-small); }

/* Over the live map the state becomes a compact floating card, so the map stays visible. */
.pt-map-state.is-card {
    inset: 76px auto auto 50%;
    transform: translateX(-50%);
    width: min(460px, calc(100% - 32px));
    padding: 14px 18px;
    display: block;
    text-align: start;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    background: rgba(7, 18, 56, .86);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pt-map-state.is-card .pt-map-state-inner { display: flex; align-items: center; gap: 14px; max-width: none; }
.pt-map-state.is-card .pt-map-state-icon { flex-shrink: 0; width: 50px; height: 50px; margin: 0; font-size: 24px; box-shadow: 0 0 0 5px rgba(76, 141, 255, .12), 0 0 22px rgba(76, 141, 255, .35); }
.pt-map-state.is-card .pt-map-state-text { flex: 1; min-width: 0; }
.pt-map-state.is-card h2 { font-size: var(--pt-fs-body); }
.pt-map-state.is-card p { margin-top: 2px; font-size: var(--pt-fs-caption); }

.pt-map-loading {
    width: 46px;
    height: 46px;
    margin: 0 auto 16px;
    border: 3px solid rgba(255, 255, 255, .2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pt-spin .8s linear infinite;
}

/* map controls */

.pt-map-tools {
    position: absolute;
    z-index: 3;
    top: 18px;
    inset-inline-end: 18px;
}

.pt-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    background: rgba(7, 18, 56, .78);
    color: #fff;
    font-size: var(--pt-fs-small);
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.pt-map-btn i { font-size: 18px; }
.pt-map-btn:hover { background: rgba(19, 47, 134, .92); }

.pt-zoom {
    position: absolute;
    z-index: 3;
    bottom: 26px;
    inset-inline-end: 18px;
    display: grid;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(7, 18, 56, .82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.pt-zoom button {
    display: grid;
    place-items: center;
    width: 46px;
    height: 44px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.pt-zoom button + button { border-top: 1px solid rgba(255, 255, 255, .12); }
.pt-zoom button:hover { background: rgba(76, 141, 255, .25); }

.pt-map-legend {
    position: absolute;
    z-index: 3;
    bottom: 18px;
    inset-inline-start: 18px;
    max-width: min(420px, calc(100% - 110px));
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(7, 18, 56, .78);
    color: #c6d4fb;
    font-size: var(--pt-fs-caption);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.pt-map-panel.is-expanded {
    position: fixed;
    inset: 0;
    z-index: 2000;
    height: auto;
    border-radius: 0;
}

.pt-map-panel:fullscreen { height: 100%; border-radius: 0; }

/* markers (Leaflet divIcons) */

.pt-driver-marker, .pt-dest-marker { position: relative; width: 100%; height: 100%; }

.pt-driver-dot {
    position: absolute;
    inset: 6px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #dfe8ff);
    color: var(--pt-primary-2, #1b3fc9);
    font-size: 22px;
    box-shadow: 0 0 0 4px rgba(76, 141, 255, .55), 0 10px 22px rgba(0, 0, 0, .35);
}

.pt-driver-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(76, 141, 255, .45);
    animation: pt-pulse 1.8s ease-out infinite;
}

/* Company branch marker on the empty map. */
.pt-home-marker { position: relative; width: 100%; height: 100%; }

.pt-home-dot {
    position: absolute;
    inset: 6px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #3a6cff, #1b3fc9);
    color: #fff;
    font-size: 20px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 10px 22px rgba(0, 0, 0, .35);
}

.pt-home-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(76, 141, 255, .4);
    animation: pt-pulse 2.4s ease-out infinite;
}

.pt-driver-marker.is-recent .pt-driver-dot { color: #8a6100; box-shadow: 0 0 0 4px rgba(244, 170, 40, .55), 0 10px 22px rgba(0, 0, 0, .35); }

.pt-dest-halo {
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border-radius: 50%;
    background: rgba(34, 197, 94, .35);
    animation: pt-pulse 2.2s ease-out infinite;
}

.pt-dest-pin {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #22c55e;
    font-size: 40px;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45));
}

/* Leaflet places tooltips by transform from the pane origin; without an explicit
   left/top an RTL page anchors them from the right edge and they drift sideways. */
.pt-map .leaflet-tooltip { left: 0; top: 0; }

.leaflet-tooltip.pt-map-bubble,
.leaflet-tooltip.pt-map-label {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    background: rgba(9, 24, 74, .92);
    color: #fff;
    font-family: var(--pt-font);
    font-size: var(--pt-fs-caption);
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
    white-space: nowrap;
}

.leaflet-tooltip.pt-map-bubble { background: linear-gradient(160deg, #2f65ff, #1b3fc9); border-color: rgba(255, 255, 255, .3); }
.leaflet-tooltip.pt-map-bubble.is-recent { background: linear-gradient(160deg, #b7791f, #8a5a12); }
.leaflet-tooltip.pt-map-bubble::before { border-top-color: #1b3fc9; }
.leaflet-tooltip.pt-map-bubble.is-recent::before { border-top-color: #8a5a12; }
.leaflet-tooltip.pt-map-label::before { border-top-color: rgba(9, 24, 74, .92); }
.leaflet-tooltip.pt-map-bubble strong, .leaflet-tooltip.pt-map-label strong { display: block; font-size: var(--pt-fs-small); }
.leaflet-tooltip.pt-map-bubble span, .leaflet-tooltip.pt-map-label span { display: block; opacity: .85; font-size: 12px; }

.pt-route-flow { animation: pt-dash 1.2s linear infinite; }

/* ---------------------------------------------------------------- info cards */

/* Four in a row only when each card has room for its value; two by two otherwise. */
.pt-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (min-width: 1680px) {
    .pt-info { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.pt-info-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 16px;
    border: 1px solid var(--pt-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--pt-shadow);
    min-width: 0;
}

.pt-info-body { flex: 1; min-width: 0; }
.pt-info-value { display: block; margin-top: 4px; font-size: var(--pt-fs-value); font-weight: 700; color: var(--pt-text); overflow-wrap: anywhere; line-height: 1.4; }
.pt-info-sub { display: block; margin-top: 6px; color: var(--pt-muted); font-size: var(--pt-fs-caption); overflow-wrap: anywhere; }
.pt-info-value.is-muted { color: #8a93a9; font-size: var(--pt-fs-body); }
.pt-info-value.tone-live, .pt-info-value.tone-success { color: var(--pt-success); }
.pt-info-value.tone-progress { color: var(--pt-primary); }
.pt-info-value.tone-warning { color: #b26a00; }
.pt-info-value.tone-danger { color: var(--pt-danger); }

.pt-info-icon {
    flex-shrink: 0;
    order: 2;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 22px;
}

.pt-info-icon.c-blue { background: #eaf1ff; color: var(--pt-primary); }
.pt-info-icon.c-green { background: #e7f7ee; color: var(--pt-success); }
.pt-info-icon.c-indigo { background: #eef0ff; color: #4651d6; }
.pt-info-icon.c-sky { background: #e8f6ff; color: #1b86d6; }

/* ---------------------------------------------------------------- footer */

.pt-footer { padding: 4px 32px 28px; text-align: center; color: #8a93a9; font-size: var(--pt-fs-caption); }

/* ---------------------------------------------------------------- animation */

@keyframes pt-spin { to { transform: rotate(360deg); } }
@keyframes pt-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pt-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes pt-dash { to { stroke-dashoffset: -24; } }

@media (prefers-reduced-motion: reduce) {
    .pt-driver-pulse, .pt-dest-halo, .pt-home-pulse, .pt-route-flow, .pt-skeleton { animation: none; }
}

/* ---------------------------------------------------------------- responsive */

/* Desktop (two columns): the page is one screen tall and does not scroll. The
   header and footer keep their height and the columns share the rest: the map
   keeps its usual 640px when there is room and gives way down to 200px so the
   info cards stay in view, and a long shipment result scrolls inside its own
   card. The layout is never squeezed below 560px tall (everything still fits
   there); only a shorter window scrolls the page. */
@media (min-width: 1080px) {
    .pt-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 560px; }
    .pt-page > .pt-header, .pt-page > .pt-footer { flex: none; }
    .pt-shell { flex: 1 1 0; min-height: 0; width: 100%; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
    .pt-side, .pt-main { display: flex; flex-direction: column; min-height: 0; }
    .pt-search, .pt-info { flex: none; }
    .pt-map-panel { flex: 0 1 640px; height: auto; min-height: 200px; }
    #pt-details { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c9d3e8 transparent; }
}

/* Short desktop screens (under 900px tall): header, spacing, cards and controls
   scale down together, as on the sign-in page. --pt-fit runs from 0px (560px
   tall and shorter) to 1px (900px tall); each value moves from its compact size
   at 0 to its full size at 1. Font sizes of body text and labels do not change. */
@media (min-width: 1080px) and (max-height: 899.98px) {
    .pt-page {
        --pt-fit: clamp(0px, (100vh - 560px) / 340, 1px);
        --pt-step: calc(38px + 8 * var(--pt-fit));
    }
    .pt-page .pt-header-inner { min-height: calc(56px + 28 * var(--pt-fit)); }
    .pt-page .pt-brand img { max-height: calc(40px + 16 * var(--pt-fit)); }
    .pt-page .pt-lang { height: calc(40px + 4 * var(--pt-fit)); }
    .pt-shell { padding-block: calc(12px + 14 * var(--pt-fit)) calc(12px + 28 * var(--pt-fit)); }
    .pt-side, .pt-main { gap: calc(12px + 8 * var(--pt-fit)); }
    .pt-card { padding: calc(16px + 8 * var(--pt-fit)); }
    .pt-search-head { gap: calc(12px + 4 * var(--pt-fit)); margin-bottom: calc(12px + 8 * var(--pt-fit)); }
    .pt-icon-tile { width: calc(44px + 14 * var(--pt-fit)); height: calc(44px + 14 * var(--pt-fit)); font-size: calc(22px + 6 * var(--pt-fit)); }
    .pt-title { font-size: calc(21px + 5 * var(--pt-fit)); }
    .pt-input, .pt-submit { height: calc(46px + 12 * var(--pt-fit)); }
    .pt-submit { margin-top: calc(10px + 4 * var(--pt-fit)); }
    .pt-helper { margin-top: calc(8px + 6 * var(--pt-fit)); }
    .pt-empty { padding: calc(12px + 18 * var(--pt-fit)) calc(16px + 8 * var(--pt-fit)); }
    .pt-empty-icon { width: calc(48px + 16 * var(--pt-fit)); height: calc(48px + 16 * var(--pt-fit)); margin-bottom: calc(8px + 4 * var(--pt-fit)); font-size: calc(22px + 6 * var(--pt-fit)); }
    .pt-steps { margin: calc(14px + 12 * var(--pt-fit)) 0 calc(2px + 4 * var(--pt-fit)); }
    .pt-step-icon { width: var(--pt-step); height: var(--pt-step); margin-bottom: calc(6px + 4 * var(--pt-fit)); font-size: calc(18px + 2 * var(--pt-fit)); }
    .pt-step::after { top: calc(var(--pt-step) / 2 - 1px); inset-inline-start: calc(50% + var(--pt-step) / 2); width: calc(100% - var(--pt-step)); }
    .pt-step.is-current .pt-step-icon { width: calc(var(--pt-step) + 8px); height: calc(var(--pt-step) + 8px); margin-bottom: calc(2px + 4 * var(--pt-fit)); }
    .pt-driver { margin-top: calc(14px + 8 * var(--pt-fit)); padding: calc(12px + 4 * var(--pt-fit)) calc(14px + 4 * var(--pt-fit)); }
    .pt-avatar { width: calc(46px + 12 * var(--pt-fit)); height: calc(46px + 12 * var(--pt-fit)); }
    .pt-actions { margin-top: calc(12px + 6 * var(--pt-fit)); }
    .pt-btn { min-height: calc(44px + 6 * var(--pt-fit)); }
    .pt-map-state-icon { width: calc(64px + 22 * var(--pt-fit)); height: calc(64px + 22 * var(--pt-fit)); margin-bottom: calc(12px + 6 * var(--pt-fit)); font-size: calc(30px + 8 * var(--pt-fit)); }
    .pt-info { gap: calc(10px + 6 * var(--pt-fit)); }
    .pt-info-card { padding: calc(12px + 6 * var(--pt-fit)) calc(14px + 4 * var(--pt-fit)) calc(12px + 4 * var(--pt-fit)); }
    .pt-info-icon { width: calc(38px + 8 * var(--pt-fit)); height: calc(38px + 8 * var(--pt-fit)); font-size: calc(19px + 3 * var(--pt-fit)); }
    .pt-info-value { font-size: calc(17px + 3 * var(--pt-fit)); }
    .pt-page > .pt-footer { padding-block: calc(2px + 2 * var(--pt-fit)) calc(8px + 20 * var(--pt-fit)); }
}


@media (max-width: 1079.98px) {
    .pt-shell { grid-template-columns: minmax(0, 1fr); padding: 20px 20px 32px; }
    .pt-header-inner { padding: 0 20px; gap: 14px; }
    .pt-nav a { padding: 0 12px; font-size: 14px; }
    .pt-brand img { height: 48px; }
    .pt-map-panel { height: 440px; }
}

@media (max-width: 767.98px) {
    .pt-header-inner { flex-wrap: wrap; padding: 12px 16px 0; gap: 10px 12px; min-height: 0; }
    .pt-brand { order: 1; margin-inline-start: 0; }
    .pt-brand img { height: 40px; }
    .pt-lang { order: 2; height: 38px; margin-inline-start: auto; }
    .pt-nav { order: 3; width: 100%; margin: 0; justify-content: space-between; gap: 2px; }
    .pt-nav a { flex: 1; justify-content: center; padding: 10px 6px 12px; font-size: 13px; gap: 6px; }
    .pt-nav a i { font-size: 18px; }
    .pt-shell { padding: 16px 16px 28px; gap: 16px; }
    .pt-side, .pt-main { gap: 16px; }
    .pt-card { padding: 18px; }
    .pt-title { font-size: 22px; }
    .pt-icon-tile { width: 50px; height: 50px; font-size: 24px; }
    .pt-map-panel { height: 380px; border-radius: 20px; }
    .pt-step { font-size: 12px; }
    .pt-step-icon { width: 40px; height: 40px; font-size: 18px; }
    .pt-step::after { top: 19px; inset-inline-start: calc(50% + 20px); width: calc(100% - 40px); }
    .pt-step.is-current .pt-step-icon { width: 46px; height: 46px; margin-top: -3px; }
    .pt-driver { flex-wrap: wrap; }
    .pt-driver-side { max-width: none; width: 100%; padding: 12px 0 0; border-inline-start: 0; border-top: 1px solid var(--pt-line); }
}

@media (max-width: 479.98px) {
    .pt-info { grid-template-columns: minmax(0, 1fr); }
    .pt-actions { grid-template-columns: minmax(0, 1fr); }
    .pt-map-btn span { display: none; }
    .pt-nav a { font-size: 12.5px; gap: 4px; padding-inline: 4px; }
    .pt-nav a i { font-size: 16px; }
    .pt-input { font-size: 15px; letter-spacing: .03em; }
}
