:root {
  color-scheme: light;
  --ink: #171614;
  --paper: #fff;
  --muted: #5e5952;
  --line: #ded8ce;
  --soft: #f8f6f1;
  --gold: #8a6a32;
  --gold-light: #d6b981;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.5 "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.tracking-shell {
  max-width: 976px;
  margin-inline: auto;
  padding: clamp(24px, 5vw, 70px) 16px 32px;
}

.is-embedded .tracking-shell { padding: 2px 2px 12px; }

.lookup-card {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.lookup-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  border-radius: 7px 0 0 7px;
  background: var(--ink);
  color: #fffaf1;
  padding: clamp(24px, 4vw, 48px);
}

.lookup-intro::before {
  content: "";
  width: 32px;
  height: 2px;
  background: var(--gold-light);
  margin-bottom: 23px;
}

.lookup-intro h1 {
  max-width: 11ch;
  font: 400 clamp(2.35rem, 5.15vw, 3.65rem)/1.03 var(--serif);
  letter-spacing: -.045em;
}

.lookup-intro p {
  max-width: 25ch;
  margin-top: 18px;
  color: #d6cec0;
  font-size: .9375rem;
  line-height: 1.65;
}

#tracking-form {
  display: grid;
  align-content: center;
  min-width: 0;
  gap: 20px;
  padding: clamp(24px, 4.4vw, 46px);
}

.field { display: grid; gap: 7px; }
.field label { font-size: .875rem; font-weight: 650; }

.field input {
  min-width: 0;
  width: 100%;
  height: 51px;
  padding: 0 13px;
  border: 1px solid #bfb7aa;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}

.field input:focus { border-color: var(--gold); }
.field input::placeholder { color: #68635c; opacity: 1; }
.field small { color: var(--muted); font-size: .8125rem; }

.primary {
  width: 100%;
  min-height: 51px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 11px 18px;
  background: var(--ink);
  color: #fffaf1;
  cursor: pointer;
  font-size: .9375rem;
  font-weight: 650;
}

.primary:hover { background: #322a20; }
.primary:disabled { opacity: .65; cursor: wait; }

.message {
  padding: 13px 16px;
  border-left: 2px solid var(--gold);
  background: #f7f1e4;
  color: #54401e;
  font-size: .875rem;
  line-height: 1.6;
}

.message.error { border-color: #943e34; background: #fff0ed; color: #832e25; }

.result { margin-top: 30px; scroll-margin-top: 12px; }
.result:focus { outline: none; }
.result > .message { margin-top: 16px; }

.status-panel {
  padding: clamp(22px, 4vw, 37px);
  border-radius: 8px;
  background: var(--ink);
  color: #fffaf1;
}

.status-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #4f473c;
  color: #dfceb0;
  font-size: .8125rem;
}

.status-meta strong { font-weight: 650; }

.status-panel h2 {
  margin-top: 19px;
  font: 400 clamp(1.8rem, 4.2vw, 2.65rem)/1.13 var(--serif);
  letter-spacing: -.03em;
}

.status-panel > p { max-width: 64ch; margin-top: 9px; color: #e0d9cd; font-size: .9375rem; }

.status-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 18px; }

.status-chips span {
  border: 1px solid #645847;
  border-radius: 4px;
  padding: 4px 8px;
  color: #f2e7d6;
  font-size: .75rem;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}

.timeline-card, .details-card {
  min-width: 0;
  padding: clamp(19px, 3vw, 29px);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.details-card { background: var(--soft); }

.timeline-card > h3, .details-card > h3 {
  margin-bottom: 20px;
  font: 400 1.35rem/1.3 var(--serif);
}

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

.step {
  position: relative;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  gap: 13px;
  min-height: 50px;
  padding-bottom: 18px;
}

.step:last-child { min-height: 0; padding-bottom: 0; }

.step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.step.complete:not(:last-child)::before { background: #b6a17e; }

.step-marker {
  z-index: 0;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid #c9c0b2;
  border-radius: 50%;
  background: var(--paper);
  font-size: .75rem;
}

.step.complete .step-marker { border-color: var(--gold); background: var(--gold); color: #fff; }
.step.current .step-marker { border: 2px solid var(--gold); }

.step.current .step-marker::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.step h4 { font-size: .875rem; line-height: 19px; font-weight: 500; color: var(--muted); }
.step.complete h4, .step.current h4 { color: var(--ink); }
.step.current h4 { font-weight: 700; }
.step p, .step time { display: block; margin-top: 4px; color: var(--muted); font-size: .8125rem; }

.current-label {
  display: inline-block;
  margin-top: 5px;
  color: #755620;
  font-size: .75rem;
  font-weight: 650;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.order-item img { flex: none; width: 48px; height: 56px; object-fit: contain; background: #fff; }
.order-item h4, .delivery-detail h4 { font-size: .875rem; font-weight: 650; }
.order-item p { margin-top: 3px; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.delivery-detail { margin-top: 7px; border-top: 1px solid var(--line); padding-top: 14px; }
.delivery-detail p { margin-top: 4px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.parcel { margin-top: 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); padding: 10px 12px; }
.parcel a, .store-link { display: inline-block; color: #694d22; font-size: .875rem; text-underline-offset: 4px; }
.parcel a { margin-top: 5px; }

.refresh-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 10px 0 0;
  color: var(--muted);
  font-size: .8125rem;
}

.refresh-button {
  cursor: pointer;
  min-height: 44px;
  border: 0;
  padding: 7px 0;
  background: none;
  color: var(--ink);
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
}

.refresh-button:disabled { opacity: .6; }

.help {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
  gap: 13px 32px;
  margin-top: 34px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.help h2 { font: 400 1.375rem/1.25 var(--serif); margin-bottom: 7px; }
.help details { border-bottom: 1px solid var(--line); }

.help summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px;
  align-items: center;
  gap: 9px;
  padding: 11px 4px 11px 0;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-size: .875rem;
  font-weight: 600;
}

.help summary::-webkit-details-marker { display: none; }

.help summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}

.help details[open] summary::after { transform: rotate(225deg); }
.help details p { max-width: 66ch; margin: 0 18px 13px 0; font-size: .875rem; line-height: 1.65; color: var(--muted); }

@media (max-width: 640px) {
  .lookup-card, .result-grid, .help { grid-template-columns: minmax(0, 1fr); }
  .lookup-intro { padding: 24px 22px 25px; border-radius: 7px 7px 0 0; }
  .lookup-intro::before { margin-bottom: 13px; }
  .lookup-intro h1 { max-width: none; font-size: clamp(1.85rem, 8.9vw, 2.7rem); }
  .lookup-intro p { margin-top: 8px; max-width: 34ch; font-size: .875rem; }
  #tracking-form { padding: 22px; gap: 17px; }
  .help { margin-top: 24px; padding-top: 19px; }
  .help-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
  .help h2 { margin: 0; font-size: 1.2rem; }
}
