/**
 * Vaelrum Tracking — enhanced dashboard UI.
 *
 * Theme-neutral: uses the theme's --accent / --accent-rgb when set, with safe
 * fallbacks. Sharp corners and the maroon, like the rest of the site (user 2026-10-27).
 *
 * Scope: everything is prefixed .vt- so it does not touch other theme styles.
 */

/* ---------- Design tokens ---------- */
:root {
  /* Theme-aware accent (vaelrum theme sets --accent/--accent-rgb) */
  --vt-accent: var(--accent, #9e1c2e);
  --vt-accent-rgb: var(--accent-rgb, 158, 28, 46);
  --vt-accent-bright: var(--accent-bright, #e0283f);

  /* Surfaces */
  --vt-bg: #ffffff;
  --vt-card: #ffffff;
  --vt-card-inset: #f5f6f8;
  --vt-card-border: #e8eaef;
  --vt-text: #111319;
  --vt-muted: #6b7280;
  --vt-divider: #eceef2;

  /* Hero gradient — tinted with the accent */
  --vt-hero-bg: linear-gradient(135deg,
    rgba(var(--vt-accent-rgb), 0.04) 0%,
    rgba(var(--vt-accent-rgb), 0.09) 55%,
    rgba(var(--vt-accent-rgb), 0.045) 100%);
  --vt-hero-blob: rgba(var(--vt-accent-rgb), 0.08);

  /* Delivered: the maroon too */
  --vt-success: var(--vt-accent);
  --vt-success-bg: rgba(var(--vt-accent-rgb), 0.06);
  --vt-success-border: rgba(var(--vt-accent-rgb), 0.25);

  /* Shape */
}
/* Force light theme on the shipment card regardless of OS/browser dark mode */
.vt-shipment { color-scheme: light; }

/* ---------- Shipment container ---------- */
.vt-shipment {
  color: var(--vt-text);
  font-family: inherit;
  display: grid;
  gap: 16px;
  margin: 10px 0 24px;
}
.vt-shipment * { box-sizing: border-box; }

/* ---------- Hero card ---------- */
.vt-hero {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: var(--vt-hero-bg), var(--vt-card);
  border: 1px solid var(--vt-card-border);
  padding: 22px clamp(18px, 3vw, 32px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  gap: 20px;
  align-items: start;
}
.vt-hero::before,
.vt-hero::after {
  content: '';
  position: absolute;
  border-radius: 0;
  background: var(--vt-hero-blob);
  pointer-events: none;
  z-index: 0;
}
.vt-hero::before { width: 280px; height: 280px; right: -80px; top: -120px; opacity: .9; }
.vt-hero::after  { width: 220px; height: 220px; right: 140px; bottom: -140px; opacity: 0.6; }

.vt-hero > * { position: relative; z-index: 1; }

/* --- Hero: left column --- */
.vt-hero__left { display: grid; gap: 14px; }
.vt-hero__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vt-hero__brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: rgba(var(--vt-accent-rgb), 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--vt-accent);
  flex-shrink: 0;
}
.vt-hero__brand-icon svg { width: 24px; height: 24px; }
.vt-hero__title {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--vt-text);
}
.vt-hero__sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--vt-muted);
}

.vt-hero__field-label {
  font-size: 12px;
  color: var(--vt-muted);
  font-weight: 500;
  margin-bottom: 2px;
}
.vt-hero__tn-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vt-hero__tn {
  font-size: clamp(20px, 2.3vw, 26px);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--vt-text);
  word-break: break-all;
}

.vt-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 700;
  width: fit-content;
  background: var(--vt-card-inset);
  color: var(--vt-text);
  border: 1px solid var(--vt-card-border);
}
.vt-status-pill.is-delivered {
  background: var(--vt-success-bg);
  color: var(--vt-success);
  border-color: var(--vt-success-border);
}
.vt-status-pill__ico {
  width: 20px;
  height: 20px;
  border-radius: 0;
  background: var(--vt-success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vt-status-pill__ico svg { width: 12px; height: 12px; }

.vt-hero__delivered-on {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.vt-hero__cal {
  width: 38px;
  height: 38px;
  border-radius: 0;
  background: rgba(var(--vt-accent-rgb), 0.12);
  color: var(--vt-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vt-hero__cal svg { width: 20px; height: 20px; }
.vt-hero__delivered-text { font-size: 13px; line-height: 1.5; }
.vt-hero__delivered-text .vt-muted { color: var(--vt-muted); font-size: 12px; display: block; }
.vt-hero__delivered-text strong { color: var(--vt-text); font-weight: 700; font-size: 14px; }

/* --- Hero: center column (3D box) --- */
.vt-hero__box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}
.vt-hero__box img {
  width: 100%;
  max-width: 240px;
  height: auto;
  display: block;
}

/* --- Hero: right column --- */
.vt-hero__right {
  display: grid;
  gap: 14px;
}

.vt-route {
  background: var(--vt-card);
  border: 1px solid var(--vt-card-border);
  border-radius: 0;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.vt-route__node {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vt-route__node:last-child { justify-content: flex-end; }
.vt-flag {
  width: 36px;
  height: 27px;
  object-fit: cover;
  border-radius: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.vt-route__label { font-size: 11px; color: var(--vt-muted); font-weight: 500; display: block; line-height: 1.1; }
.vt-route__code { font-size: 14px; font-weight: 800; letter-spacing: 0.05em; color: var(--vt-text); line-height: 1.2; }
.vt-route__path { display: flex; align-items: center; justify-content: center; color: var(--vt-accent); }
.vt-route__path svg { width: 56px; height: 24px; }

.vt-confirm {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--vt-success-bg);
  border: 1px solid var(--vt-success-border);
  border-radius: 0;
}
.vt-confirm__ico {
  width: 36px;
  height: 36px;
  border-radius: 0;
  background: var(--vt-success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vt-confirm__ico svg { width: 20px; height: 20px; }
.vt-confirm__title { font-weight: 700; color: var(--vt-success); font-size: 15px; display: block; }
.vt-confirm__text { margin: 2px 0 0; font-size: 13px; color: var(--vt-text); opacity: 0.85; }

/* ---------- Horizontal step strip ---------- */
.vt-steps {
  list-style: none;
  margin: 0;
  padding: 22px clamp(18px, 3vw, 32px);
  background: var(--vt-card);
  border: 1px solid var(--vt-card-border);
  border-radius: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}
.vt-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  text-align: center;
}
.vt-step::before {
  content: '';
  position: absolute;
  top: 24px; /* middle of 48px icon */
  left: calc(-50% + 24px);
  right: calc(50% + 24px);
  height: 2px;
  background: var(--vt-divider);
  z-index: 0;
}
.vt-step:first-child::before { display: none; }
.vt-step.is-done::before { background: rgba(var(--vt-accent-rgb), 0.55); }

.vt-step__ico {
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: var(--vt-card-inset);
  color: var(--vt-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  border: 2px solid var(--vt-card-inset);
}
.vt-step__ico svg { width: 22px; height: 22px; }
.vt-step__label { font-size: 13px; color: var(--vt-muted); font-weight: 500; }

.vt-step.is-done .vt-step__ico {
  background: rgba(var(--vt-accent-rgb), 0.12);
  color: var(--vt-accent);
  border-color: rgba(var(--vt-accent-rgb), 0.12);
}
.vt-step.is-current .vt-step__ico {
  background: var(--vt-accent);
  color: #fff;
  border-color: var(--vt-accent);
  box-shadow: 0 6px 18px -4px rgba(var(--vt-accent-rgb), 0.5);
}
.vt-step.is-done .vt-step__label { color: var(--vt-text); font-weight: 600; }
.vt-step.is-current .vt-step__label { color: var(--vt-accent); font-weight: 700; }

/* ---------- Tracking history card ---------- */
.vt-history {
  background: var(--vt-card);
  border: 1px solid var(--vt-card-border);
  border-radius: 0;
  padding: 22px clamp(18px, 3vw, 28px);
}
.vt-history__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.vt-history__ico {
  width: 38px;
  height: 38px;
  border-radius: 0;
  background: var(--vt-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vt-history__ico svg { width: 20px; height: 20px; }
.vt-history__title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--vt-text);
}

.vt-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.vt-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--vt-divider);
}
.vt-event {
  display: grid;
  grid-template-columns: 32px minmax(140px, 1.2fr) 2fr;
  gap: 16px;
  align-items: center;
  padding: 12px 14px 12px 12px; /* the square sits inside the latest update's light red band, off its edge */
  border-radius: 0;
  position: relative;
  margin-bottom: 2px;
}
.vt-event__dot {
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: var(--vt-card);
  border: 2px solid var(--vt-divider);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  color: var(--vt-muted);
}
.vt-event__dot svg { width: 14px; height: 14px; }
.vt-event__when { font-size: 13px; color: var(--vt-muted); line-height: 1.4; }
.vt-event__when strong { display: block; color: var(--vt-text); font-weight: 600; font-size: 13px; }
.vt-event__body { font-size: 14px; }
.vt-event__title { font-weight: 700; color: var(--vt-text); display: block; }
.vt-event__place { color: var(--vt-muted); font-size: 13px; display: block; margin-top: 2px; letter-spacing: 0.02em; }

.vt-event.is-latest {
  background: var(--vt-success-bg);
}
.vt-event.is-latest .vt-event__dot {
  background: var(--vt-success);
  color: #fff;
  border-color: var(--vt-success);
}
.vt-event.is-latest .vt-event__title { color: var(--vt-success); }

/* ---------- Footer row: Track with [carrier] + Package Details ---------- */
.vt-footer {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 16px;
}
.vt-courier {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--vt-card);
  border: 1px solid var(--vt-card-border);
  border-radius: 0;
  text-decoration: none !important;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.vt-courier:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--vt-accent-rgb), 0.4);
  box-shadow: 0 8px 20px -8px rgba(var(--vt-accent-rgb), 0.25);
}
.vt-courier__logo {
  width: 70px;
  height: 70px;
  border-radius: 0;
  background: rgba(var(--vt-accent-rgb), 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 10px;
}
.vt-courier__logo img, .vt-courier__logo svg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.vt-courier__label { font-size: 12px; color: var(--vt-muted); display: block; font-weight: 500; }
.vt-courier__name { font-size: 18px; font-weight: 800; color: var(--vt-text); display: block; letter-spacing: -0.01em; }
.vt-courier__url {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--vt-accent);
  font-weight: 500;
}
.vt-courier__url svg { width: 11px; height: 11px; }

.vt-package {
  background: var(--vt-card);
  border: 1px solid var(--vt-card-border);
  border-radius: 0;
  padding: 20px;
}
.vt-package__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.vt-package__ico {
  width: 38px;
  height: 38px;
  border-radius: 0;
  background: rgba(var(--vt-accent-rgb), 0.12);
  color: var(--vt-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vt-package__ico svg { width: 20px; height: 20px; }
.vt-package__title { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--vt-text); }

.vt-package__grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 1fr 1fr;
  gap: 12px;
  padding: 14px 16px;
  background: var(--vt-card-inset);
  border-radius: 0;
}
.vt-package__field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vt-package__field-label { font-size: 11px; color: var(--vt-muted); font-weight: 500; }
.vt-package__field-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--vt-text);
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-all;
}

/* ---------- Copy button ---------- */
.vt-copy {
  border: 0;
  background: transparent;
  color: var(--vt-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .12s ease, background .12s ease;
  font: inherit;
  line-height: 0;
}
.vt-copy:hover { color: var(--vt-accent); background: rgba(var(--vt-accent-rgb), 0.08); }
.vt-copy svg { width: 16px; height: 16px; }
.vt-copy.is-copied { color: var(--vt-success); }

/* ---------- Items (in-parcel) + legacy fallback ---------- */
.vt-shipment .track-ship__items,
.vt-shipment .track-ship__live {
  background: var(--vt-card);
  border: 1px solid var(--vt-card-border);
  border-radius: 0;
  padding: 14px 16px;
  margin: 0;
  font-size: 14px;
}
.vt-shipment .track-ship__items p { margin: 0 0 6px; font-weight: 700; color: var(--vt-text); }
.vt-shipment .track-ship__items ul { margin: 0; padding-left: 18px; }
.vt-shipment .track-ship__items li { color: var(--vt-muted); margin-bottom: 2px; }

/* Hide legacy nodes that we've replaced with new structure (only when rich UI active) */
.vt-shipment > .track-ship__line,
.vt-shipment > .track-prog,
.vt-shipment > .track-ship__link { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .vt-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .vt-hero__box { order: -1; min-height: 140px; }
  .vt-hero__box img { max-width: 180px; }
  .vt-footer { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .vt-hero { padding: 18px; }
  .vt-steps { padding: 18px 10px; gap: 6px; }
  .vt-step__ico { width: 40px; height: 40px; }
  .vt-step__ico svg { width: 18px; height: 18px; }
  .vt-step::before { top: 20px; left: calc(-50% + 20px); right: calc(50% + 20px); }
  .vt-step__label { font-size: 11px; }
  .vt-event {
    grid-template-columns: 28px 1fr;
    gap: 10px;
  }
  .vt-event__when, .vt-event__body { grid-column: 2; }
  .vt-event__when { order: 1; }
  .vt-event__body { order: 2; margin-top: 2px; }
  .vt-event__dot { grid-row: span 2; }
  .vt-package__grid { grid-template-columns: 1fr; gap: 10px; }
  .vt-courier { padding: 14px; }
  .vt-courier__logo { width: 56px; height: 56px; }
}

/* ---------- Backward-compat: pure (no-rich) legacy fallback ---------- */
.track-ship:not(.vt-shipment) .track-ship__banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 0 0 12px;
  border: 1px solid var(--vt-success-border);
  border-radius: 0;
  background: var(--vt-success-bg);
  color: var(--vt-success);
  font-size: 14px;
}

/* ---------- The Vaelrum look (Phase 35, user 2026-10-27): sharp, maroon, the theme's fonts ---------- */
.vt-hero::before, .vt-hero::after { display: none; }
.vt-hero { background: var(--glow-bg, #120306); border-color: transparent; color: #fff; }
.vt-hero .vt-hero__title, .vt-hero .vt-hero__tn, .vt-hero .vt-route__code, .vt-hero .vt-hero__delivered-text strong { color: #fff; }
.vt-hero .vt-hero__sub, .vt-hero .vt-hero__field-label, .vt-hero .vt-muted, .vt-hero .vt-route__label { color: rgba(255, 255, 255, 0.7); }
.vt-hero .vt-copy { color: rgba(255, 255, 255, 0.8); }
.vt-hero__brand-icon, .vt-hero__cal { background: rgba(255, 255, 255, 0.1); color: #fff; }
.vt-hero .vt-status-pill { background: var(--vt-accent); border-color: var(--vt-accent); color: #fff; text-transform: uppercase; letter-spacing: 0.08em; }
.vt-hero .vt-status-pill__ico { background: #fff; color: var(--vt-accent); }
.vt-hero .vt-route, .vt-hero .vt-confirm { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }
.vt-hero .vt-confirm__title { color: #fff; }
.vt-hero .vt-confirm__text { color: rgba(255, 255, 255, 0.75); }
.vt-hero .vt-confirm__ico { background: var(--vt-accent); color: #fff; }
.vt-hero__title, .vt-hero__tn, .vt-history__title, .vt-package__title, .vt-courier__name, .vt-route__code { font-family: var(--font-head, inherit); }
.vt-history__title, .vt-package__title, .vt-step__label, .vt-hero__field-label, .vt-courier__label, .vt-package__field-label { text-transform: uppercase; letter-spacing: 0.06em; }
.vt-history__title, .vt-package__title { font-size: 15px; }
/* a long history scrolls in its own box (a focusable named region, .vt-scroll) (the line is drawn per update, so it runs on while scrolling) */
.vt-scroll { max-height: 440px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--vt-accent) var(--vt-card-inset); padding-right: 10px; }
.vt-scroll:focus-visible { outline: 2px solid var(--vt-accent); outline-offset: 2px; }
.vt-timeline::before { display: none; }
.vt-event:not(:last-child)::after { content: ''; position: absolute; left: 27px; top: 50%; height: 100%; width: 2px; background: var(--vt-divider); }
.vt-event__dot { position: relative; }
/* the parcel: the box, its carrier's logo printed on the white label (the label's place and slant in the picture) */
.vt-parcel { position: relative; display: block; width: 100%; max-width: 300px; container-type: inline-size; }
.vt-parcel > img { display: block; width: 100%; max-width: 100%; height: auto; } /* not the 240px of .vt-hero__box img: the label is placed on the full picture */
.vt-parcel__label { position: absolute; left: 37.2%; top: 52.4%; width: 18.2%; height: 14.3%; transform: skewY(22.2deg); transform-origin: 0 0; display: flex; align-items: center; justify-content: center; padding: 1.5%; }
.vt-parcel__label img { display: block; max-width: 92%; max-height: 90%; width: auto; height: auto; object-fit: contain; }
.vt-parcel__name { font-family: var(--font-head, inherit); font-size: clamp(6px, 3.6cqw, 12px); font-weight: 700; line-height: 1.1; text-align: center; text-transform: uppercase; color: #111; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.vt-hero .vt-copy:hover { color: #fff; }
.vt-hero .vt-copy:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 960px) { .vt-parcel { max-width: 240px; } } /* phones: a smaller box over the text */
