:root {
  --ink: #111;
  --muted: #6b6560;
  --line: #e8e2da;
  --bg: #fff;
  --soft: #faf7f3;
  --gold: #a47a45;
  --gold-soft: #f3eadf;
  --ok: #2f7d4f;
  --warn: #b26a00;
  --bad: #b3372f;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { position: relative; display: flex; justify-content: center; padding: 28px 16px 8px; border-bottom: 1px solid var(--line); }
.lang { position: absolute; top: 14px; right: 16px; }
.lang select {
  appearance: none; -webkit-appearance: none;
  padding: 6px 28px 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b6560' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
}
.lang select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.brand img { display: block; width: 220px; height: auto; }

main { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }

.hero { text-align: center; padding: 48px 0 32px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 34px; letter-spacing: .5px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 28px; }

.search { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.search input {
  flex: 1; min-width: 0; height: 52px; padding: 0 16px;
  border: 1px solid #cfc7bd; border-radius: var(--radius);
  font-size: 17px; letter-spacing: .5px; background: #fff; color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search button {
  height: 52px; padding: 0 28px; border: 0; border-radius: var(--radius);
  background: var(--ink); color: #fff; font-size: 16px; letter-spacing: 1px; cursor: pointer;
}
.search button:hover { background: #2a2622; }
.search button:disabled { opacity: .6; cursor: progress; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

.msg { text-align: center; padding: 28px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); color: var(--muted); }
.msg strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; word-break: break-all; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; letter-spacing: .3px; background: var(--gold-soft); color: var(--gold); }
.badge.delivered { background: #e5f2ea; color: var(--ok); }
.badge.exception, .badge.undelivered, .badge.expired { background: #f7e4e2; color: var(--bad); }
.badge.pickup { background: #fdf0dc; color: var(--warn); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.meta b { color: var(--ink); font-weight: 500; }
.latest { margin-top: 14px; font-size: 15px; }
.latest small { display: block; color: var(--muted); font-size: 13px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); padding: 18px 12px 6px; list-style: none; margin: 0; }
.steps li { position: relative; text-align: center; font-size: 12px; color: var(--muted); padding-top: 22px; }
.steps li::before { content: ""; position: absolute; top: 6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; border: 2px solid #d6cec4; z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #e3ddd5; }
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--gold); border-color: var(--gold); }
.steps li.done::after { background: var(--gold); }

.card-head {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
  position: relative; padding: 20px 20px 16px; background: var(--soft);
  border: 0; border-bottom: 1px solid var(--line); cursor: default;
}
.card-head .row, .card-head .meta, .card-head .latest { display: flex; }
.card-head .latest { display: block; }
.latest-text { display: block; }
.chev { display: none; }

/* Multi-parcel orders: each card folds to its header */
.multi .card-head { cursor: pointer; padding-right: 48px; }
.multi .card-head:hover { background: #f6f1ea; }
.multi .chev { display: block; position: absolute; right: 20px; top: 26px; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.multi .card.open .chev { transform: rotate(-135deg); top: 31px; }
.multi .card:not(.open) .card-body { display: none; }
.multi .card:not(.open) .card-head { border-bottom: 0; }
.card-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Timeline: one heading per day, time | text rows */
.timeline { padding: 6px 20px 8px; }
.day-h { position: sticky; top: 0; background: #fff; padding: 12px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 52px 1fr; gap: 12px; position: relative; padding: 7px 0 7px 18px; border-left: 2px solid var(--line); margin-left: 5px; }
.tl li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #cfc7bd; }
.tl li.first::before { background: var(--gold); border-color: var(--gold); }
.tl li.first .ev-detail { font-weight: 600; }
.ev-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.ev-detail { font-size: 15px; line-height: 1.4; }
.ev-loc { font-size: 13px; color: var(--muted); }
.card.collapsed .extra { display: none; }

.more { display: block; width: calc(100% - 40px); margin: 4px 20px 20px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); cursor: pointer; font-size: 14px; }
.more:hover { border-color: var(--gold); }

.trbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; }
.linkbtn:disabled { color: var(--muted); text-decoration: none; cursor: progress; }

.spinner { width: 28px; height: 28px; margin: 0 auto 10px; border: 3px solid var(--gold-soft); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 32px; }
.foot p { margin: 4px 0; }

@media (max-width: 520px) {
  .brand img { width: 150px; }
  .top { justify-content: flex-start; padding: 18px 16px 12px; }
  .lang { top: 50%; transform: translateY(-50%); }
  .hero { padding: 32px 0 24px; }
  h1 { font-size: 27px; }
  .search { gap: 6px; }
  .search input { height: 50px; padding: 0 12px; font-size: 16px; letter-spacing: 0; }
  .search button { flex: none; height: 50px; padding: 0 16px; font-size: 15px; letter-spacing: .3px; }
  .steps li { font-size: 11px; }
  .timeline { padding: 4px 14px 8px; }
  .card-head { padding: 16px 14px 14px; }
  .multi .card-head { padding-right: 40px; }
  .multi .chev { right: 16px; }
  .tl li { grid-template-columns: 44px 1fr; gap: 8px; }
  .more { width: calc(100% - 28px); margin: 4px 14px 16px; }
}
