/**
 * Global Ameritrade — Shipment Tracker v9
 * Inter · matches main site theme · light/professional
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

/* ── Variables ─────────────────────────────────────────── */
:root {
    --white:      #ffffff;
    --off:        #f4f4f4;
    --off2:       #f9fafb;
    --ink:        #1c1c1c;
    --navy:       #0d1f3c;
    --navy-mid:   #1a3460;
    --red:        #e53935;
    --red-dk:     #c62828;
    --red-soft:   rgba(229,57,53,.1);
    --blue:       #2563eb;
    --blue-soft:  #eff6ff;
    --green:      #059669;
    --green-soft: rgba(5,150,105,.1);
    --amber:      #d97706;
    --t-h:        #1c1c1c;
    --t-b:        #525252;
    --t-m:        #7a7a7a;
    --t-f:        #a8a8a8;
    --bdr:        #e4e4e4;
    --bdr-md:     #c8c8c8;
    --sh:         0 4px 20px rgba(0,0,0,.08);
    --sh-lg:      0 16px 48px rgba(0,0,0,.10);
    --f:          "Inter", system-ui, -apple-system, sans-serif;
    --r:          12px;
    --r-lg:       20px;
    --ease:       cubic-bezier(0.22, 1, 0.36, 1);
    --dur:        0.22s;
    --sidebar-w:  420px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.tr-body {
    margin: 0; font-family: var(--f); font-size: .9375rem;
    color: var(--t-b); background: var(--off2);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════ */
/*  LANDING / LOGIN PAGE                                   */
/* ═══════════════════════════════════════════════════════ */

.tr-login {
    min-height: 100vh; display: grid; grid-template-columns: 1fr;
}
@media(min-width:1024px){ .tr-login { grid-template-columns: 1.1fr 1fr; } }

/* ── Visual panel (left) ────────────────────────────── */
.tr-visual {
    display: none; position: relative;
    background: url('../images/bg.jpg') center/cover no-repeat;
    flex-direction: column;
}
@media(min-width:1024px){
    .tr-visual {
        display: flex; flex-direction: column;
    min-height: 100vh;
    }
    .tr-visual::after {
        content: ""; position: absolute; inset: 0;
        background: linear-gradient(
            160deg,
            rgba(13,31,60,.96) 0%,
            rgba(13,31,60,.82) 55%,
            rgba(13,31,60,.70) 100%
        );
    }
}

.tr-visual__nav {
    position: relative; z-index: 2;
    padding: 1.75rem 2.5rem; flex-shrink: 0;
}
.tr-visual__brand {
    display: inline-flex; align-items: center; gap: .6rem;
    text-decoration: none;
}
.tr-visual__brand img { height: 32px; filter: brightness(0) invert(1); }
.tr-visual__brand-name {
    font-size: .875rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: rgba(255,255,255,.75);
}

.tr-visual__body {
    position: relative; z-index: 2;
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    padding: 2rem 2.5rem;
}
.tr-visual__kicker {
    font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
    color: var(--red); margin-bottom: .85rem;
}
.tr-visual__title {
    font-size: clamp(1.7rem, 2.8vw, 2.5rem); font-weight: 700;
    color: #fff; letter-spacing: -.025em; line-height: 1.12;
    margin: 0 0 1rem;
}
.tr-visual__title em { font-style: normal; color: var(--red); }
.tr-visual__text {
    font-size: .9375rem; color: rgba(255,255,255,.55);
    line-height: 1.75; margin: 0 0 2rem; max-width: 44ch;
}

.tr-visual__features {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: .7rem;
}
.tr-visual__features li {
    display: flex; align-items: flex-start; gap: .65rem;
    font-size: .875rem; color: rgba(255,255,255,.65); line-height: 1.5;
}
.tr-visual__feat-icon {
    width: 18px; height: 18px; flex-shrink: 0; margin-top: .05rem;
    color: var(--red); opacity: .85;
}

.tr-visual__footer {
    position: relative; z-index: 2; flex-shrink: 0;
    padding: 1.75rem 2.5rem;
    border-top: 1px solid rgba(255,255,255,.1);
    display: flex; gap: 2.5rem;
}
.tr-visual__stat strong {
    display: block; font-size: 1.35rem; font-weight: 700;
    color: #fff; letter-spacing: -.04em; line-height: 1;
}
.tr-visual__stat span {
    font-size: .72rem; color: rgba(255,255,255,.4);
    text-transform: uppercase; letter-spacing: .08em; font-weight: 500;
}

/* ── Form panel (right) ─────────────────────────────── */
.tr-form-wrap {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    padding: 3rem 1.5rem; background: var(--white);
    min-height: 100vh;
}
.tr-form-brand { margin-bottom: 2.25rem; }
.tr-form-brand img, .tr-form-brand__img {
    height: 40px; width: auto; max-width: 200px; object-fit: contain;
    /* natural colours on white background — no filter */
}
.tr-visual__logo-img {
    height: 32px; width: auto; max-width: 160px; object-fit: contain;
    filter: brightness(0) invert(1);
}
.tr-sidebar__logo-img {
    height: 26px; width: auto; max-width: 140px; object-fit: contain;
    filter: brightness(0) invert(1); opacity: .9;
}

.tr-form-card {
    width: 100%; max-width: 400px;
    background: var(--white); border: 1px solid var(--bdr);
    border-radius: var(--r-lg); padding: 2.25rem;
    box-shadow: var(--sh-lg);
}
.tr-kicker {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .14em; color: var(--red); margin-bottom: .75rem;
}
.tr-kicker::before {
    content: ""; width: 14px; height: 2px;
    background: var(--red); border-radius: 1px; flex-shrink: 0;
}
.tr-form-card h1 {
    font-size: 1.4rem; font-weight: 700; color: var(--t-h);
    letter-spacing: -.025em; line-height: 1.2; margin: 0 0 1.5rem;
}

/* ── Form elements ─────────────────────────────────── */
.tr-field { margin-bottom: 1rem; }
.tr-label {
    display: block; font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--t-m); margin-bottom: .4rem;
}
.tr-input {
    width: 100%; padding: .75rem 1rem;
    border: 1.5px solid var(--bdr); border-radius: var(--r);
    background: var(--white); color: var(--t-h);
    font-family: var(--f); font-size: .9375rem;
    transition: border-color var(--dur), box-shadow var(--dur);
}
.tr-input:focus {
    outline: none; border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-soft);
}
.tr-input::placeholder { color: var(--t-f); }

.tr-field-toggle { position: relative; }
.tr-field-toggle .tr-input { padding-right: 3rem; }
.tr-toggle-btn {
    position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
    border: none; background: none; color: var(--t-m);
    cursor: pointer; padding: .25rem; display: flex; align-items: center;
    transition: color var(--dur);
}
.tr-toggle-btn:hover { color: var(--t-h); }
.tr-toggle-btn svg { width: 18px; height: 18px; }

/* ── Alert ─────────────────────────────────────────── */
.tr-alert {
    padding: .75rem 1rem; font-size: .875rem; margin-bottom: 1rem;
    border-radius: var(--r); border-left: 3px solid var(--red);
    background: rgba(229,57,53,.06); color: var(--red-dk);
    display: flex; align-items: flex-start; gap: .6rem;
}
.tr-alert svg { flex-shrink: 0; margin-top: .1rem; }

/* ── Buttons ───────────────────────────────────────── */
.tr-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .8rem 1.35rem; font-family: var(--f); font-weight: 600;
    font-size: .875rem; border: 2px solid transparent; border-radius: 100px;
    cursor: pointer; transition: background var(--dur), box-shadow var(--dur), transform var(--dur);
    text-decoration: none; letter-spacing: .01em;
}
.tr-btn--primary {
    background: var(--red); color: #fff; border-color: var(--red);
}
.tr-btn--primary:hover {
    background: var(--red-dk); border-color: var(--red-dk);
    transform: translateY(-1px); box-shadow: 0 6px 20px rgba(229,57,53,.28);
}
.tr-btn--block { width: 100%; }
.tr-btn svg { width: 16px; height: 16px; }

/* ── Back link ─────────────────────────────────────── */
.tr-back-link {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .8rem; font-weight: 600; color: var(--t-m);
    text-decoration: none; letter-spacing: .01em;
    transition: color var(--dur); margin-top: 1.35rem;
}
.tr-back-link:hover { color: var(--t-h); }
.tr-back-link svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════════════════ */
/*  TRACKER APP (RESULTS PAGE)                             */
/* ═══════════════════════════════════════════════════════ */

.tr-app {
    display: flex; height: 100vh; overflow: hidden;
    background: var(--off2);
}
@media(max-width:768px){
    .tr-app { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
}

/* ── Sidebar ───────────────────────────────────────── */
.tr-sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--white); border-right: 1px solid var(--bdr);
    display: flex; flex-direction: column; overflow: hidden; z-index: 10;
    box-shadow: 2px 0 24px rgba(0,0,0,.05);
}
@media(max-width:768px){
    .tr-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--bdr); }
}

/* Sidebar header */
.tr-sidebar__head {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--bdr);
    flex-shrink: 0; background: var(--white);
}
.tr-sidebar__head-top {
    display: flex; align-items: center;
    justify-content: space-between; margin-bottom: .85rem;
}
.tr-sidebar__logo img { height: 28px; }
.tr-sidebar__chips { display: flex; gap: .4rem; flex-wrap: wrap; }

.tr-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .3rem .7rem; border-radius: 100px;
    font-size: .7rem; font-weight: 600; letter-spacing: .02em;
    background: var(--off); border: 1px solid var(--bdr); color: var(--t-m);
    text-decoration: none; cursor: pointer; transition: background var(--dur), color var(--dur);
}
.tr-chip:hover { background: var(--bdr); color: var(--t-h); }
.tr-chip--accent { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.tr-chip--accent:hover { background: var(--red); color: #fff; }
.tr-chip svg { width: 13px; height: 13px; }

.tr-track-num {
    font-size: .72rem; font-weight: 600; color: var(--t-m);
    text-transform: uppercase; letter-spacing: .08em;
}
.tr-track-num code {
    font-family: var(--f); font-size: .78rem; font-weight: 700;
    color: var(--t-h); letter-spacing: .02em; background: none; padding: 0;
}

/* Sidebar body */
.tr-sidebar__body {
    flex: 1; overflow-y: auto; padding: 0;
    scrollbar-width: thin; scrollbar-color: var(--bdr) transparent;
}
.tr-sidebar__body::-webkit-scrollbar { width: 4px; }
.tr-sidebar__body::-webkit-scrollbar-thumb { background: var(--bdr-md); border-radius: 2px; }

/* ── Progress ──────────────────────────────────────── */
.tr-progress {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--bdr);
    background: var(--off2);
}
.tr-progress__label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .72rem; color: var(--t-m); font-weight: 500;
    margin-bottom: .55rem;
}
.tr-progress__label strong { font-weight: 700; color: var(--t-h); }
.tr-progress__bar {
    height: 5px; background: var(--bdr); border-radius: 3px;
    overflow: hidden;
}
.tr-progress__fill {
    height: 100%; background: linear-gradient(90deg, var(--red-dk) 0%, var(--red) 100%);
    border-radius: 3px; transition: width .7s var(--ease);
    position: relative;
}
.tr-progress__fill::after {
    content: ""; position: absolute; right: 0; top: 50%;
    transform: translateY(-50%);
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--red); box-shadow: 0 0 0 3px var(--red-soft);
}

/* ── Status card ───────────────────────────────────── */
.tr-status {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--bdr);
}
.tr-status__badge {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .22rem .65rem; border-radius: 100px; margin-bottom: .6rem;
    font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
}
.tr-status__badge--active {
    background: rgba(37,99,235,.08); color: var(--blue);
    border: 1px solid rgba(37,99,235,.18);
}
.tr-status__badge--delivered {
    background: var(--green-soft); color: var(--green);
    border: 1px solid rgba(5,150,105,.2);
}
.tr-status__badge--pending {
    background: rgba(217,119,6,.1); color: var(--amber);
    border: 1px solid rgba(217,119,6,.2);
}
.tr-status__badge .tr-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}
.tr-status__text {
    font-size: .9rem; font-weight: 600; color: var(--t-h);
    line-height: 1.4; margin: 0 0 .4rem;
}
.tr-status__loc {
    font-size: .8125rem; color: var(--t-m); margin: 0; line-height: 1.5;
}
.tr-status__loc strong { color: var(--t-b); font-weight: 600; }

/* ── Tabs ──────────────────────────────────────────── */
.tr-tabs {
    display: flex; border-bottom: 1px solid var(--bdr);
    padding: 0 1.25rem; flex-shrink: 0; background: var(--white);
}
.tr-tabs a {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .75rem 0; margin-right: 1.5rem;
    font-size: .775rem; font-weight: 600; color: var(--t-m);
    text-decoration: none; border-bottom: 2.5px solid transparent;
    letter-spacing: .02em; transition: color var(--dur), border-color var(--dur);
    white-space: nowrap;
}
.tr-tabs a:hover { color: var(--t-h); }
.tr-tabs a.active { color: var(--t-h); border-bottom-color: var(--red); }
.tr-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--off); border-radius: 100px;
    font-size: .6rem; font-weight: 700; color: var(--t-m);
    transition: background var(--dur), color var(--dur);
}
.tr-tabs a.active .tr-tab-count { background: var(--red-soft); color: var(--red); }

.tr-tab-body { display: none; }
.tr-tab-body.active { display: block; }

/* ── Overview detail rows ──────────────────────────── */
.tr-detail-list { padding: 0; margin: 0; }
.tr-detail-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--bdr);
    transition: background var(--dur);
}
.tr-detail-row:hover { background: var(--off2); }
.tr-detail-row dt {
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .07em; color: var(--t-f); flex-shrink: 0; padding-top: .1rem;
}
.tr-detail-row dd {
    font-size: .875rem; font-weight: 500; color: var(--t-h);
    text-align: right; margin: 0; line-height: 1.4;
}

/* Collapsible specs */
.tr-specs {
    border-bottom: 1px solid var(--bdr);
}
.tr-specs summary {
    padding: .75rem 1.25rem; font-size: .775rem; font-weight: 600;
    color: var(--t-m); cursor: pointer; list-style: none;
    display: flex; align-items: center; gap: .4rem;
    transition: color var(--dur); letter-spacing: .02em;
}
.tr-specs summary::-webkit-details-marker { display: none; }
.tr-specs[open] summary { color: var(--t-h); }
.tr-specs summary::after {
    content: "+"; margin-left: auto; font-size: 1rem;
    font-weight: 300; color: var(--t-f); line-height: 1;
}
.tr-specs[open] summary::after { content: "−"; }

/* ── Timeline ──────────────────────────────────────── */
.tr-timeline-hint {
    padding: .75rem 1.25rem .25rem;
    font-size: .72rem; color: var(--t-f); font-style: italic;
}
.tr-timeline {
    list-style: none; margin: 0; padding: .25rem 0 1rem;
}
.tr-timeline__item {
    position: relative; display: grid; grid-template-columns: 38px 1fr;
    gap: 0 .6rem; padding: .7rem 1.25rem .7rem 1rem;
    cursor: pointer; transition: background var(--dur);
}
.tr-timeline__item:hover { background: var(--off2); }
.tr-timeline__item + .tr-timeline__item::before {
    content: ""; position: absolute;
    left: calc(1rem + 18px); top: 0; width: 1px; height: .7rem;
    background: var(--bdr);
}

/* Connecting line */
.tr-timeline__item::after {
    content: ""; position: absolute;
    left: calc(1rem + 18px); top: 1.5rem; bottom: -0.7rem;
    width: 1px; background: var(--bdr);
}
.tr-timeline__item:last-child::after { display: none; }

.tr-timeline__dot {
    position: relative; z-index: 1; width: 36px; height: 36px;
    border-radius: 50%; flex-shrink: 0; align-self: start;
    display: flex; align-items: center; justify-content: center;
    background: var(--off); border: 2px solid var(--bdr);
    font-size: .65rem; font-weight: 700; color: var(--t-f);
    transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.tr-timeline__item.is-origin .tr-timeline__dot {
    background: var(--blue-soft); border-color: var(--blue);
    color: var(--blue);
}
.tr-timeline__item.is-current .tr-timeline__dot {
    background: var(--red); border-color: var(--red); color: #fff;
    box-shadow: 0 0 0 4px var(--red-soft);
}
.tr-timeline__item.is-active .tr-timeline__dot:not(.tr-timeline__item.is-current .tr-timeline__dot) {
    border-color: var(--bdr-md);
}

.tr-timeline__content { padding-top: .45rem; }
.tr-timeline__title {
    font-size: .875rem; font-weight: 600; color: var(--t-h);
    line-height: 1.3; margin-bottom: .2rem;
}
.tr-timeline__item.is-current .tr-timeline__title { color: var(--red-dk); }
.tr-timeline__date { font-size: .72rem; color: var(--t-f); margin-bottom: .15rem; }
.tr-timeline__desc {
    margin: .25rem 0 0; font-size: .78rem;
    color: var(--t-m); line-height: 1.55;
}

/* ── Map view ──────────────────────────────────────── */
.tr-map-view { flex: 1; position: relative; overflow: hidden; }
@media(max-width:768px){
    .tr-map-view { min-height: 60vw; }
}
#map { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── Map HUD ───────────────────────────────────────── */
.tr-hud {
    position: absolute; top: 1rem; right: 1rem;
    display: flex; flex-direction: column; gap: .5rem; z-index: 5;
}
.tr-hud-card {
    background: var(--white); border: 1px solid var(--bdr);
    border-radius: var(--r); padding: .6rem .9rem;
    min-width: 130px; box-shadow: var(--sh);
    display: flex; align-items: center; gap: .6rem;
}
.tr-hud-card__icon {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--off); color: var(--t-m);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tr-hud-card__icon svg { width: 15px; height: 15px; }
.tr-hud-card__body {}
.tr-hud-card__val {
    font-size: .9rem; font-weight: 700; color: var(--t-h);
    letter-spacing: -.02em; line-height: 1;
}
.tr-hud-card__lbl {
    font-size: .62rem; font-weight: 600; color: var(--t-f);
    text-transform: uppercase; letter-spacing: .08em;
    margin-top: .1rem;
}

/* ── Map Legend ────────────────────────────────────── */
.tr-legend {
    position: absolute; bottom: 1.25rem; left: 1.25rem;
    background: var(--white); border: 1px solid var(--bdr);
    border-radius: var(--r); padding: .65rem 1rem;
    display: flex; align-items: center; gap: 1.1rem;
    z-index: 5; box-shadow: var(--sh);
    flex-wrap: wrap;
}
.tr-legend__title {
    font-size: .62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--t-f); margin-right: .2rem;
}
.tr-legend-item {
    display: flex; align-items: center; gap: .35rem;
    font-size: .72rem; color: var(--t-m); font-weight: 500;
}
.tr-legend-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.tr-legend-dot--origin  { background: var(--blue); }
.tr-legend-dot--transit { background: var(--t-f); }
.tr-legend-dot--current { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

/* ── Map empty state ───────────────────────────────── */
.tr-map-empty {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--off2); text-align: center;
}
.tr-map-empty__inner {
    padding: 2.5rem; max-width: 320px;
}
.tr-map-empty__icon {
    width: 64px; height: 64px; border-radius: 20px;
    background: var(--off); color: var(--t-f);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.25rem;
}
.tr-map-empty__icon svg { width: 32px; height: 32px; }
.tr-map-empty h3 {
    font-size: 1rem; font-weight: 600; color: var(--t-h);
    margin: 0 0 .5rem; letter-spacing: -.02em;
}
.tr-map-empty p {
    font-size: .875rem; color: var(--t-m); line-height: 1.65; margin: 0;
}
.tr-map-empty code {
    font-family: var(--f); font-weight: 600; color: var(--t-h);
    background: var(--off); padding: .1rem .4rem; border-radius: 5px;
}

/* ── Pulse ring (map overlay) ──────────────────────── */
.tr-map-pulse {
    position: absolute; transform: translate(-50%, -50%);
    pointer-events: none; z-index: 1;
}
.tr-map-pulse::before,
.tr-map-pulse::after {
    content: ""; position: absolute;
    width: 48px; height: 48px; border-radius: 50%;
    border: 2.5px solid var(--red);
    top: -24px; left: -24px;
    animation: tr-pulse 2.4s ease-out infinite; opacity: 0;
}
.tr-map-pulse::after { animation-delay: 1.2s; }
@keyframes tr-pulse {
    0%   { transform: scale(.5); opacity: .7; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════ */
/*  TRACKDETAILS — ENHANCED COMPONENTS                     */
/* ═══════════════════════════════════════════════════════ */

/* ── Sidebar dark accent header ────────────────────── */
.tr-sidebar__accent {
    background: var(--navy); flex-shrink: 0;
    padding: 1rem 1.25rem;
}
.tr-sidebar__accent-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .85rem;
}
.tr-sidebar__accent-brand {
    display: flex; align-items: center; gap: .6rem;
}
.tr-sidebar__accent-brand img { height: 26px; filter: brightness(0) invert(1); opacity: .9; }
.tr-sidebar__accent-name {
    font-size: .72rem; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: rgba(255,255,255,.5);
}
.tr-sidebar__accent-actions { display: flex; gap: .35rem; }

.tr-chip-dark {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .28rem .65rem; border-radius: 100px;
    font-size: .67rem; font-weight: 600; letter-spacing: .02em;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.6); text-decoration: none; cursor: pointer;
    transition: background var(--dur), color var(--dur);
}
.tr-chip-dark:hover { background: rgba(255,255,255,.15); color: #fff; }
.tr-chip-dark--red { background: rgba(229,57,53,.2); border-color: rgba(229,57,53,.35); color: #ff8080; }
.tr-chip-dark--red:hover { background: var(--red); border-color: var(--red); color: #fff; }
.tr-chip-dark svg { width: 12px; height: 12px; }

.tr-sidebar__tracknum {
    display: flex; align-items: center; gap: .5rem;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--r); padding: .55rem .85rem;
}
.tr-sidebar__tracknum svg { color: rgba(255,255,255,.35); flex-shrink: 0; width: 14px; height: 14px; }
.tr-sidebar__tracknum-label {
    font-size: .6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: rgba(255,255,255,.35); margin-bottom: .1rem;
}
.tr-sidebar__tracknum-val {
    font-size: .9rem; font-weight: 700; color: #fff; letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
}

/* ── Rich status card ──────────────────────────────── */
.tr-status-card {
    display: flex; align-items: flex-start; gap: .9rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--bdr);
}
.tr-status-card__icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.tr-status-card__icon svg { width: 22px; height: 22px; }
.tr-status-card__icon--active   { background: rgba(37,99,235,.1);  color: var(--blue); }
.tr-status-card__icon--delivered { background: var(--green-soft);  color: var(--green); }
.tr-status-card__icon--pending  { background: rgba(217,119,6,.1); color: var(--amber); }

.tr-status-card__body { flex: 1; min-width: 0; }
.tr-status-card__badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .18rem .55rem; border-radius: 100px; margin-bottom: .4rem;
    font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.tr-status-card__badge--active   { background: rgba(37,99,235,.08);  color: var(--blue);  border: 1px solid rgba(37,99,235,.2); }
.tr-status-card__badge--delivered{ background: var(--green-soft);     color: var(--green); border: 1px solid rgba(5,150,105,.2); }
.tr-status-card__badge--pending  { background: rgba(217,119,6,.1);  color: var(--amber); border: 1px solid rgba(217,119,6,.2); }
.tr-status-card__badge-dot {
    width: 5px; height: 5px; border-radius: 50%; background: currentColor;
    animation: tr-status-pulse 2s ease-in-out infinite;
}
@keyframes tr-status-pulse { 0%,100%{opacity:1;} 50%{opacity:.3;} }
.tr-status-card__msg {
    font-size: .875rem; font-weight: 600; color: var(--t-h);
    line-height: 1.35; margin-bottom: .3rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tr-status-card__meta {
    display: flex; align-items: center; gap: .3rem;
    font-size: .75rem; color: var(--t-m); line-height: 1.4;
}
.tr-status-card__meta svg { color: var(--t-f); flex-shrink: 0; width: 12px; height: 12px; }
.tr-status-card__meta strong { color: var(--t-b); font-weight: 600; }

/* ── Journey step progress ─────────────────────────── */
.tr-journey {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--bdr); background: var(--off2);
}
.tr-journey__label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .7rem; color: var(--t-m); font-weight: 500; margin-bottom: .75rem;
}
.tr-journey__label strong { font-weight: 700; color: var(--t-h); }
.tr-journey__steps {
    display: flex; align-items: center;
}
.tr-journey__step {
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    flex: 0 0 auto;
}
.tr-journey__dot {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bdr); background: var(--white);
    color: var(--t-f); transition: all var(--dur);
}
.tr-journey__dot svg { width: 12px; height: 12px; }
.tr-journey__dot.done  { background: var(--red); border-color: var(--red); color: #fff; }
.tr-journey__dot.active {
    background: var(--red-soft); border-color: var(--red); color: var(--red);
    box-shadow: 0 0 0 4px var(--red-soft);
    animation: tr-step-pulse 2s ease-in-out infinite;
}
@keyframes tr-step-pulse { 0%,100%{box-shadow:0 0 0 4px var(--red-soft);} 50%{box-shadow:0 0 0 6px rgba(229,57,53,.06);} }
.tr-journey__step-label {
    font-size: .58rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .07em; color: var(--t-f); white-space: nowrap;
}
.tr-journey__step.done .tr-journey__step-label  { color: var(--red); }
.tr-journey__step.active .tr-journey__step-label { color: var(--red); font-weight: 700; }
.tr-journey__line {
    flex: 1; height: 2px; background: var(--bdr); margin: 0 4px;
    margin-bottom: 14px; /* aligns with dot center */
    transition: background var(--dur); border-radius: 1px;
}
.tr-journey__line.done { background: var(--red); }

/* ── Icon info rows (overview tab) ─────────────────── */
.tr-info-section { padding: .5rem 0; }
.tr-info-section-label {
    padding: .65rem 1.25rem .3rem;
    font-size: .62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--t-f);
}
.tr-info-row {
    display: flex; align-items: flex-start; gap: .85rem;
    padding: .65rem 1.25rem; border-bottom: 1px solid var(--bdr);
    transition: background var(--dur); cursor: default;
}
.tr-info-row:hover { background: var(--off2); }
.tr-info-row__icon {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
    background: var(--off); display: flex; align-items: center; justify-content: center;
    color: var(--t-m); margin-top: .05rem;
}
.tr-info-row__icon svg { width: 15px; height: 15px; }
.tr-info-row__body { flex: 1; min-width: 0; }
.tr-info-row__label {
    font-size: .65rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .09em; color: var(--t-f); margin-bottom: .15rem;
}
.tr-info-row__value {
    font-size: .875rem; font-weight: 500; color: var(--t-h);
    line-height: 1.4; word-break: break-word;
}

/* ── Mini stat grid (shipment specs) ───────────────── */
.tr-specs-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1px; background: var(--bdr);
    border-top: 1px solid var(--bdr);
    margin-bottom: 0;
}
.tr-spec-cell {
    background: var(--white); padding: .75rem 1rem;
    display: flex; flex-direction: column; gap: .15rem;
    transition: background var(--dur);
}
.tr-spec-cell:hover { background: var(--off2); }
.tr-spec-cell__val {
    font-size: 1.05rem; font-weight: 700; color: var(--t-h);
    letter-spacing: -.025em; line-height: 1;
}
.tr-spec-cell__lbl {
    font-size: .62rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .08em; color: var(--t-f);
}

/* ── Route tab empty state ─────────────────────────── */
.tr-route-empty {
    padding: 2rem 1.25rem; text-align: center;
}
.tr-route-empty__icon {
    width: 48px; height: 48px; border-radius: 14px; background: var(--off);
    display: flex; align-items: center; justify-content: center;
    color: var(--t-f); margin: 0 auto .85rem;
}
.tr-route-empty__icon svg { width: 24px; height: 24px; }
.tr-route-empty p { font-size: .875rem; color: var(--t-m); margin: 0; line-height: 1.65; }

/* ── Timeline (enhanced) ───────────────────────────── */
.tr-timeline-hint {
    padding: .6rem 1.25rem;
    font-size: .72rem; color: var(--t-f); font-style: italic;
    display: flex; align-items: center; gap: .35rem;
}
.tr-timeline-hint svg { width: 12px; height: 12px; color: var(--t-f); flex-shrink: 0; }

.tr-timeline { list-style: none; margin: 0; padding: 0 0 1rem; }
.tr-timeline__item {
    position: relative; display: grid; grid-template-columns: 42px 1fr;
    gap: 0 .5rem; padding: .6rem 1.25rem .6rem .75rem;
    cursor: pointer; transition: background var(--dur);
}
.tr-timeline__item:hover { background: var(--off2); }
.tr-timeline__item.is-active { background: rgba(229,57,53,.04); }

/* Vertical connecting line */
.tr-timeline__item::before {
    content: ""; position: absolute;
    left: calc(.75rem + 20px); top: 42px; bottom: -0.6rem;
    width: 2px; background: var(--bdr); border-radius: 1px;
}
.tr-timeline__item:last-child::before { display: none; }
.tr-timeline__item.is-current::before { background: var(--red-soft); }

.tr-timeline__dot {
    position: relative; z-index: 1; width: 40px; height: 40px;
    border-radius: 50%; flex-shrink: 0; align-self: start;
    display: flex; align-items: center; justify-content: center;
    font-size: .67rem; font-weight: 700; letter-spacing: .01em;
    background: var(--off); border: 2px solid var(--bdr); color: var(--t-f);
    transition: all var(--dur);
}
.tr-timeline__item.is-origin  .tr-timeline__dot { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.tr-timeline__item.is-current .tr-timeline__dot {
    background: var(--red); border-color: var(--red); color: #fff;
    box-shadow: 0 0 0 5px var(--red-soft);
}
.tr-timeline__item.is-active:not(.is-current) .tr-timeline__dot { border-color: var(--bdr-md); }

.tr-timeline__content { padding-top: .5rem; }
.tr-timeline__title {
    font-size: .875rem; font-weight: 600; color: var(--t-h);
    line-height: 1.3; margin-bottom: .2rem;
}
.tr-timeline__item.is-current .tr-timeline__title {
    color: var(--red-dk); display: flex; align-items: center; gap: .35rem;
}
.tr-timeline__item.is-current .tr-timeline__title::after {
    content: "LIVE"; font-size: .55rem; font-weight: 700; letter-spacing: .1em;
    background: var(--red); color: #fff; padding: .1rem .35rem; border-radius: 4px;
}
.tr-timeline__date {
    font-size: .72rem; color: var(--t-f); margin-bottom: .15rem;
    display: flex; align-items: center; gap: .25rem;
}
.tr-timeline__date svg { width: 11px; height: 11px; }
.tr-timeline__desc {
    margin: .3rem 0 0; font-size: .78rem; color: var(--t-m);
    line-height: 1.55; padding-top: .3rem; border-top: 1px solid var(--bdr);
}

/* ── Map HUD (enhanced cards) ──────────────────────── */
.tr-hud {
    position: absolute; top: 1rem; right: 1rem;
    display: flex; flex-direction: column; gap: .45rem; z-index: 5;
}
.tr-hud-card {
    background: var(--white); border: 1px solid var(--bdr);
    border-radius: var(--r); padding: .55rem .85rem;
    min-width: 140px; box-shadow: var(--sh);
    display: flex; align-items: center; gap: .55rem;
}
.tr-hud-card__icon {
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--off); color: var(--t-m);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tr-hud-card__icon--red   { background: var(--red-soft); color: var(--red); }
.tr-hud-card__icon--blue  { background: var(--blue-soft); color: var(--blue); }
.tr-hud-card__icon--green { background: var(--green-soft); color: var(--green); }
.tr-hud-card__icon svg { width: 15px; height: 15px; }
.tr-hud-card__val {
    font-size: .9rem; font-weight: 700; color: var(--t-h);
    letter-spacing: -.02em; line-height: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}
.tr-hud-card__lbl {
    font-size: .6rem; font-weight: 600; color: var(--t-f);
    text-transform: uppercase; letter-spacing: .09em; margin-top: .1rem;
}

/* ── Legend (refined) ──────────────────────────────── */
.tr-legend {
    position: absolute; bottom: 1.25rem; left: 1.25rem;
    background: var(--white); border: 1px solid var(--bdr);
    border-radius: var(--r); padding: .55rem .9rem;
    display: flex; align-items: center; gap: 1rem; z-index: 5;
    box-shadow: var(--sh); flex-wrap: wrap;
}
.tr-legend__title {
    font-size: .6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--t-f);
}
.tr-legend-item {
    display: flex; align-items: center; gap: .35rem;
    font-size: .7rem; color: var(--t-m); font-weight: 500;
}
.tr-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tr-legend-dot--origin  { background: var(--blue); }
.tr-legend-dot--transit { background: var(--t-f); }
.tr-legend-dot--current { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

/* ── Responsive ────────────────────────────────────── */
@media(max-width:768px){
    .tr-login { grid-template-columns: 1fr; }
    .tr-form-wrap { padding: 2rem 1.25rem; min-height: auto; }
    .tr-hud { top: .75rem; right: .75rem; }
    .tr-legend { bottom: .75rem; left: .75rem; }
    .tr-specs-grid { grid-template-columns: 1fr 1fr; }
    .tr-journey__step-label { font-size: .52rem; }
}
