:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #d7deea;
  --paper: #ffffff;
  --soft: #f7fafc;
  --bg: #eef3f8;
  --blue: #2563eb;
  --green: #0f8f66;
  --green-soft: #eaf8f2;
  --amber: #b7791f;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #fbfdff 0, var(--bg) 440px, #e9eef5 100%);
  color: var(--ink);
}

.tracking-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 54px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero-copy { min-width: 0; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
}

.status-pill {
  display: inline-flex;
  max-width: 360px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid #a7d7c1;
  border-radius: 999px;
  background: var(--green-soft);
  color: #08684a;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.hero-subtitle {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.35;
}

.status-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 18px 0 14px;
  padding: 24px;
  border: 1px solid #a7d7c1;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.status-card strong {
  display: block;
  margin-top: 6px;
  font-size: 34px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.progress-panel {
  margin: 14px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.progress-step {
  position: relative;
  min-height: 70px;
  padding: 12px 12px 12px 44px;
  border: 1px solid #d9e1ec;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--muted);
}

.progress-step::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 20px;
  height: 2px;
  background: #d9e1ec;
}

.progress-step:first-child::before { display: none; }

.progress-step span {
  position: absolute;
  left: 14px;
  top: 17px;
  width: 18px;
  height: 18px;
  border: 2px solid #b7c3d4;
  border-radius: 50%;
  background: #fff;
}

.progress-step strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.progress-step.active {
  border-color: #a7d7c1;
  background: var(--green-soft);
  color: #075f45;
}

.progress-step.active span {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 4px #fff;
}

.progress-step.current {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.status-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 18px;
  background: var(--green);
  color: #fff;
  font-size: 30px;
  font-weight: 900;
}

.panel {
  margin: 16px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 2px rgba(17, 19, 23, 0.04);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.grid article {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}

.grid .wide { grid-column: span 3; }

.label,
.grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.25;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-count {
  display: inline-flex;
  min-width: 34px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
}

.packages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.package {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.package-title {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 900;
}

.package-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #3b4656;
  line-height: 1.35;
}

.meta-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid #cfd8e5;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.package-comment {
  margin-top: 10px;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  min-height: 58px;
  padding: 0 0 20px 30px;
  border-left: 2px solid #d2dbe8;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 2px var(--blue);
}

.timeline-item:first-child::before {
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green);
}

.timeline-title {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.timeline-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.empty-state {
  max-width: 700px;
  margin-top: 22px;
  border: 1px solid var(--line);
}

.empty-state p {
  margin: 10px 0 0;
  line-height: 1.55;
}

.muted { color: var(--muted); }
.hidden { display: none; }

.sender-link {
  color: var(--ink);
  text-decoration: none;
}

.sender-link[href]:not([href="#"]) {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

@media (max-width: 820px) {
  .tracking-shell { width: min(100% - 24px, 980px); padding-top: 18px; }
  .hero { grid-template-columns: 1fr; align-items: start; padding: 20px; }
  h1 { font-size: 38px; }
  .status-pill { justify-content: flex-start; }
  .progress-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-step::before { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid .wide { grid-column: span 2; }
  .packages { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .tracking-shell { width: min(100% - 18px, 980px); }
  .hero { padding-top: 18px; }
  h1 { font-size: 31px; }
  h2 { font-size: 20px; }
  .status-card { grid-template-columns: 1fr; padding: 18px; }
  .status-card strong { font-size: 25px; }
  .status-mark { width: 54px; height: 44px; border-radius: 14px; font-size: 22px; }
  .progress-panel { padding: 14px; }
  .progress-steps { grid-template-columns: 1fr; }
  .progress-step { min-height: 58px; }
  .grid { grid-template-columns: 1fr; }
  .grid .wide { grid-column: auto; }
  .panel { padding: 15px; }
}
