:root {
  color-scheme: dark;
  --bg: #050b14;
  --bg-soft: #07111f;
  --panel: rgba(10, 24, 41, 0.88);
  --panel-strong: #0c1a2c;
  --panel-hover: #10223a;
  --line: #203a56;
  --line-soft: rgba(84, 128, 169, 0.2);
  --text: #f3f8ff;
  --muted: #9bb0c7;
  --muted-strong: #bfd0e2;
  --blue: #38bdf8;
  --blue-strong: #1d8fff;
  --teal: #5eead4;
  --green: #39e69a;
  --amber: #fbbf24;
  --red: #fb7185;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(71, 113, 153, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71, 113, 153, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% -20%, rgba(29, 143, 255, 0.16), transparent 42%),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.16;
  pointer-events: none;
}

.page-glow-one {
  top: 8%;
  left: -180px;
  background: var(--blue-strong);
}

.page-glow-two {
  right: -190px;
  bottom: 5%;
  background: var(--teal);
}

.shell {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 72px 0 36px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  max-width: 760px;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.18), rgba(94, 234, 212, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 12px 30px rgba(0, 0, 0, 0.25);
}

.brand-mark svg {
  width: 32px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow,
.summary-label {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 690;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.intro {
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: 1.05rem;
}

.search-card,
.summary-card,
.history-card,
.empty-state,
.loading-state {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(13, 29, 49, 0.94), rgba(7, 18, 32, 0.94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-card {
  padding: 24px;
  border-color: rgba(56, 189, 248, 0.22);
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 600;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 22px;
  transform: translateY(-50%);
  fill: none;
  stroke: #89a7c6;
  stroke-width: 1.8;
  stroke-linecap: round;
}

input {
  width: 100%;
  height: 56px;
  padding: 0 18px 0 52px;
  border: 1px solid #294765;
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  background: rgba(3, 12, 23, 0.74);
  letter-spacing: 0.025em;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: #71879f;
}

input:hover {
  border-color: #3c6287;
}

input:focus-visible {
  border-color: var(--blue);
  background: #071525;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.13);
}

button {
  position: relative;
  display: inline-flex;
  min-width: 176px;
  height: 56px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  color: #fff;
  background: linear-gradient(135deg, #1f9cff, #176eea);
  box-shadow: 0 10px 30px rgba(23, 110, 234, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 680;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

button::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.16), transparent 75%);
  content: "";
  transform: translateX(-120%);
  transition: transform 420ms ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(23, 110, 234, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

button:hover:not(:disabled)::before {
  transform: translateX(120%);
}

button:focus-visible {
  outline: 3px solid rgba(94, 234, 212, 0.42);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.75;
}

.button-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

button.is-loading span:first-child {
  display: none;
}

button.is-loading .button-spinner {
  display: block;
}

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

.feedback {
  min-height: 0;
}

.feedback:not(:empty) {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(251, 113, 133, 0.42);
  border-radius: 12px;
  color: #ffd6dd;
  background: rgba(105, 22, 40, 0.32);
}

.empty-state {
  margin-top: 24px;
  padding: 58px 28px 54px;
  text-align: center;
}

.empty-illustration {
  position: relative;
  width: min(100%, 390px);
  height: 118px;
  margin: 0 auto 22px;
}

.route-line {
  position: absolute;
  height: 2px;
  border-top: 2px dashed rgba(56, 189, 248, 0.42);
}

.route-line-one {
  top: 65px;
  left: 16px;
  width: 43%;
  transform: rotate(-7deg);
}

.route-line-two {
  top: 54px;
  right: 16px;
  width: 40%;
  transform: rotate(8deg);
}

.route-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 3px solid var(--bg-soft);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.32), 0 0 18px rgba(94, 234, 212, 0.45);
}

.route-dot-start {
  top: 73px;
  left: 9px;
}

.route-dot-end {
  top: 65px;
  right: 9px;
}

.parcel-icon {
  position: absolute;
  top: 8px;
  left: 50%;
  display: grid;
  width: 90px;
  height: 90px;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 28px;
  background: #0c1d31;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.34), 0 0 42px rgba(56, 189, 248, 0.1);
  transform: translateX(-50%) rotate(-3deg);
}

.parcel-icon svg {
  width: 58px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.empty-state p {
  max-width: 510px;
  margin: 0 auto;
  color: var(--muted);
}

.loading-state {
  margin-top: 24px;
  padding: 28px;
}

.loading-head {
  display: grid;
  gap: 12px;
}

.skeleton {
  overflow: hidden;
  border-radius: 10px;
  background: #12263e;
}

.skeleton::after {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.075), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

.skeleton-badge {
  width: 120px;
  height: 26px;
}

.skeleton-title {
  width: min(70%, 390px);
  height: 36px;
}

.skeleton-text {
  width: min(88%, 520px);
  height: 18px;
}

.skeleton-progress {
  height: 72px;
  margin: 34px 0;
}

.skeleton-grid {
  display: grid;
  gap: 12px;
}

.skeleton-event {
  height: 96px;
}

.result {
  margin-top: 24px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-color: rgba(56, 189, 248, 0.27);
}

.summary-card::after {
  position: absolute;
  top: -100px;
  right: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.07);
  content: "";
  filter: blur(10px);
  pointer-events: none;
}

.summary-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(56, 189, 248, 0.36);
  border-radius: 999px;
  color: #b9eaff;
  background: rgba(30, 134, 199, 0.18);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge[data-status="delivered"] {
  border-color: rgba(57, 230, 154, 0.38);
  color: #bdfade;
  background: rgba(23, 157, 102, 0.2);
}

.status-badge[data-status="out_for_delivery"] {
  border-color: rgba(251, 191, 36, 0.42);
  color: #ffe7a7;
  background: rgba(163, 112, 15, 0.22);
}

.status-badge[data-status="exception"] {
  border-color: rgba(251, 113, 133, 0.42);
  color: #ffd0d8;
  background: rgba(165, 36, 63, 0.2);
}

.checked-at {
  color: var(--muted);
  font-size: 0.82rem;
}

.summary-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
}

.summary-main h2 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.status-description {
  max-width: 590px;
  margin: 0;
  color: var(--muted-strong);
}

.code-card {
  min-width: 225px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(3, 12, 23, 0.48);
}

.code-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.75rem;
}

.code-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: #dff5ff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  font-weight: 600;
}

.progress-steps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
}

.progress-steps::before,
.progress-steps::after {
  position: absolute;
  top: 10px;
  right: 12.5%;
  left: 12.5%;
  height: 2px;
  content: "";
}

.progress-steps::before {
  background: #25415e;
}

.progress-steps::after {
  right: auto;
  width: var(--progress-width, 0%);
  max-width: 75%;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  transition: width 500ms ease;
}

.progress-steps li {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 9px;
  color: #6f879f;
  font-size: 0.78rem;
  text-align: center;
}

.step-dot {
  width: 22px;
  height: 22px;
  border: 5px solid var(--panel-strong);
  border-radius: 50%;
  background: #31506d;
  box-shadow: 0 0 0 1px #31506d;
}

.progress-steps li.is-complete,
.progress-steps li.is-current {
  color: #d7ecff;
}

.progress-steps li.is-complete .step-dot,
.progress-steps li.is-current .step-dot {
  background: var(--teal);
  box-shadow: 0 0 0 1px var(--teal), 0 0 18px rgba(94, 234, 212, 0.35);
}

.progress-steps li.is-current .step-dot {
  animation: pulse 2s ease-in-out infinite;
}

.history-card {
  margin-top: 18px;
  padding: 28px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.section-heading h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.event-count {
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(4, 13, 24, 0.5);
  font-size: 0.75rem;
}

.timeline {
  margin: 0;
  padding: 8px 0 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 21px 0;
}

.timeline-item:not(:last-child) {
  border-bottom: 1px solid rgba(84, 128, 169, 0.12);
}

.timeline-marker {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #315370;
  border-radius: 50%;
  color: #91b1cc;
  background: #10243a;
  font-size: 0.84rem;
  font-weight: 800;
}

.timeline-item:first-child .timeline-marker {
  border-color: rgba(94, 234, 212, 0.52);
  color: #03281e;
  background: var(--teal);
  box-shadow: 0 0 22px rgba(94, 234, 212, 0.22);
}

.timeline-copy h3 {
  margin: 1px 0 5px;
  font-size: 1rem;
  font-weight: 630;
  line-height: 1.35;
}

.timeline-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-location {
  display: inline-block;
  margin-top: 7px;
  color: #a9cfee;
  font-size: 0.8rem;
}

.timeline-time {
  min-width: 138px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  text-align: right;
  white-space: nowrap;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 10px 0 38px;
  color: #70869d;
  font-size: 0.76rem;
}

.security-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(57, 230, 154, 0.5);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--teal), 0 0 14px rgba(94, 234, 212, 0.18); }
  50% { box-shadow: 0 0 0 1px var(--teal), 0 0 26px rgba(94, 234, 212, 0.48); }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 980px);
    padding-top: 38px;
  }

  .page-header {
    gap: 15px;
    margin-bottom: 24px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .brand-mark svg {
    width: 27px;
  }

  .search-card,
  .summary-card,
  .history-card,
  .loading-state {
    padding: 20px;
    border-radius: 18px;
  }

  .search-row,
  .summary-main {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .summary-main {
    align-items: stretch;
  }

  .code-card {
    min-width: 0;
  }

  .summary-topline {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 23px;
  }

  .progress-steps {
    margin-top: 30px;
  }

  .progress-steps li {
    gap: 7px;
    font-size: 0.67rem;
  }

  .timeline-item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
  }

  .timeline-marker {
    width: 28px;
    height: 28px;
  }

  .timeline-time {
    grid-column: 2;
    min-width: 0;
    margin-top: -8px;
    text-align: left;
  }

  .empty-state {
    padding: 44px 20px 40px;
    border-radius: 18px;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 1.8rem;
  }

  .intro {
    font-size: 0.95rem;
  }

  .page-header {
    align-items: center;
  }

  .eyebrow {
    font-size: 0.66rem;
  }

  .progress-steps li span:last-child {
    max-width: 65px;
  }

  .section-heading {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
