:root {
  color-scheme: light;
  --page-bg: #f5efe6;
  --bg: #f5efe6;
  --ink: #231f1c;
  --ink-2: #403832;
  --ink-3: #655b53;
  --muted: #786c62;
  --faint: #897b70;
  --line: #e2d7c9;
  --rule: #d9cbbc;
  --dot: #9c8a79;
  --step-active: #79604d;
  --step-todo: #e6dacd;
  --green: #75432f;
  --green-ink: #75432f;
  --green-bg: #ead9c6;
  --green-ring: #e5d2bd;
  --card: #faf6ef;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 924px;
  min-height: 100vh;
  margin: 12px auto 0;
  background: var(--bg);
  padding: 34px 16px 64px;
}
.inner { max-width: 740px; margin: 0 auto; }

[hidden] { display: none !important; }

/* ---------- Header ---------- */
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.head .right { text-align: right; }
.eyebrow {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 7px;
}
.head-value { font-size: 17px; font-weight: 700; }

/* ---------- Stepper ---------- */
.steps {
  list-style: none; margin: 22px auto 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 740px;
}
.step {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  font-size: 11.5px; font-weight: 500; color: var(--ink);
}
.step .ic {
  position: relative; z-index: 1;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
}
.step .ic svg { width: 16px; height: 16px; }
.step .lbl { margin-top: 10px; max-width: 72px; line-height: 1.35; }
.step:not(:last-child)::after {
  content: ""; position: absolute; z-index: 0;
  top: 20px; left: 50%; width: 100%; height: 2px;
  background: var(--line);
}
.step.done:not(:last-child)::after { background: var(--ink); }
.step.current:not(:last-child)::after {
  background: linear-gradient(90deg, var(--step-active) 50%, var(--line) 50%);
}
.step.current .ic { background: var(--step-active); }
.step.current .lbl { color: var(--step-active); }
.step.todo .ic { background: var(--step-todo); }
.step.todo .lbl { color: var(--faint); }

/* ---------- Status line ---------- */
.status { text-align: center; margin: 40px 0 42px; }
.status-main {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
}
.status-main svg { width: 15px; height: 15px; color: var(--green); }
.spinner {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid #d9cbbc; border-top-color: #874b31;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-sub { font-size: 11px; color: var(--faint); margin-top: 8px; }

/* ---------- Latest update ---------- */
.latest { position: relative; padding-left: 47px; margin-bottom: 36px; }
.latest .dot {
  position: absolute; left: 0; top: 4px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: #fff;
  box-shadow: 0 0 0 4px var(--green-ring);
}
.latest .dot svg { width: 14px; height: 14px; }
.latest::after {
  content: ""; position: absolute; left: 15px; top: 44px;
  width: 2px; height: 38px; background: var(--green-ring);
}
.card { background: var(--card); border-radius: 10px; overflow: hidden; }
.card-head {
  background: var(--green-bg); color: var(--green-ink);
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: 12px 14px;
}
.card-body { padding: 13px 14px 18px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.ev { position: relative; padding: 0 0 24px 47px; min-height: 70px; }
.ev .dot {
  position: absolute; left: 1px; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--dot); color: #fff;
}
.ev .dot svg { width: 12px; height: 12px; }
.ev::after {
  content: ""; position: absolute; left: 15px; top: 38px; bottom: 4px;
  width: 2px; background: var(--line);
}
.ev:last-child::after { display: none; }

.ev-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 5px; }
.ev-title { font-size: 14.5px; font-weight: 500; color: #231f1c; }
.ev-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ev-desc { font-size: 13px; color: var(--ink-3); margin-top: 9px; line-height: 1.5; }
.ev-loc { color: var(--muted); }
.ev.faded .ev-title, .ev.faded .ev-desc { color: var(--muted); }
.card .ev-title { color: var(--ink); }
.card .ev-row { padding-top: 0; }

/* ---------- Order details ---------- */
.details { margin-top: 26px; }
.details-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--rule);
}
.details-head h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .12em; color: #403832; }
.edit {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green-ink); font-size: 13px; font-weight: 500; text-decoration: none;
}
.edit svg { width: 13px; height: 13px; }
.edit:hover { text-decoration: underline; }
.rows { margin: 0; }
.row {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.row dt { color: #655b53; flex-shrink: 0; }
.row dd { margin: 0; text-align: right; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.row.total { border-bottom: 0; }
.row.total dt, .row.total dd { font-weight: 700; color: var(--ink); }

.close {
  display: flex; align-items: center; gap: 8px;
  margin: 60px auto 0; padding: 12px 38px;
  border: 1px solid #d9cbbc; border-radius: 999px; background: #faf6ef;
  font: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.close svg { width: 13px; height: 13px; }
.close:hover { background: #ede2d5; }

/* ---------- Lookup form ---------- */
.lookup { max-width: 420px; margin: 40px auto; }
.lookup h1 { font-size: 24px; margin: 0 0 8px; }
.lookup-sub { color: var(--ink-3); font-size: 14px; margin: 0 0 24px; line-height: 1.5; }
.lookup label { display: block; margin-bottom: 14px; }
.lookup label span { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 6px; color: var(--ink-2); }
.lookup input {
  width: 100%; padding: 11px 12px; font: inherit; font-size: 14px;
  border: 1px solid var(--rule); border-radius: 8px; background: #faf6ef; color: var(--ink);
}
.lookup input:focus { outline: 2px solid var(--green-ring); border-color: var(--green); }
.lookup-error { color: var(--danger); font-size: 13px; margin: 0 0 12px; }
.btn-primary {
  width: 100%; padding: 12px; border: 0; border-radius: 8px;
  background: var(--ink); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-primary:disabled { opacity: .6; cursor: default; }

/* ---------- Demo scrubber (test only) ---------- */
.demo-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: 999px;
  background: #231f1c; color: #fff; font-size: 13px;
  box-shadow: 0 6px 24px rgba(0,0,0,.2); z-index: 10;
  max-width: calc(100vw - 32px);
}
.demo-bar label { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.demo-bar input { width: 200px; max-width: 40vw; accent-color: #d6b797; }
.demo-tag { font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 3px 7px; border-radius: 4px; background: #d6b797; color: #231f1c; }

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  .page { margin-top: 0; padding-top: 24px; }
  .step { font-size: 10.5px; }
  .step .ic { width: 36px; height: 36px; }
  .step:not(:last-child)::after { top: 17px; }
  .ev-row { flex-direction: column; gap: 3px; }
  .ev-time { font-size: 11.5px; }
  .row { flex-direction: column; gap: 4px; }
  .row dd { text-align: left; }
}

/* Readable typography and responsive spacing. */
body { font-size: 16px; line-height: 1.5; }
.page { max-width: 980px; margin-top: 24px; padding: 36px 36px 88px; border-radius: 20px 20px 0 0; }
.inner { max-width: 780px; }
.preview-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 28px; padding: 12px 16px; border: 1px solid #ddcbb7; border-radius: 12px; background: #eee3d6; color: #67432f; font-size: 14px; }
.preview-note strong { font-weight: 700; }
.eyebrow { font-size: 12px; font-weight: 700; color: #786c62; margin-bottom: 4px; }
.head-value { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.steps { margin-top: 30px; }
.step { font-size: 14px; font-weight: 700; }
.step .ic { width: 46px; height: 46px; }
.step .ic svg { width: 19px; height: 19px; }
.step .lbl { max-width: 100px; }
.step:not(:last-child)::after { top: 22px; }
.step.current .lbl { color: #655b53; }
.step.todo .lbl { color: #786c62; }
.step.todo .ic { color: #897b70; }
.status { margin: 32px 0; padding: 18px 16px; border: 1px solid #e2d7c9; border-radius: 14px; background: #faf6ef; }
.status-main { font-size: 17px; font-weight: 700; }
.status-sub { font-size: 14px; color: #786c62; line-height: 1.55; }
.card { border: 1px solid #ddcbb7; border-radius: 14px; }
.card-head { font-size: 12px; font-weight: 700; padding: 12px 16px; }
.card-body { padding: 16px; }
.ev-title { font-size: 17px; font-weight: 700; }
.ev-time { font-size: 14px; color: #786c62; }
.ev-desc { font-size: 15px; color: #655b53; margin-top: 6px; line-height: 1.6; }
.ev-loc, .ev.faded .ev-title, .ev.faded .ev-desc { color: #786c62; }
.ev { padding-bottom: 28px; }
.details { margin-top: 32px; padding: 22px; border: 1px solid #e2d7c9; border-radius: 16px; }
.details-head h2 { font-size: 14px; font-weight: 700; }
.edit { font-size: 15px; font-weight: 700; min-height: 44px; }
.row { font-size: 16px; padding: 14px 0; }
.row dd { font-weight: 700; }
.close { min-height: 48px; font-size: 16px; font-weight: 700; margin-top: 36px; }
.lookup h1 { font-size: 30px; font-weight: 700; }
.lookup-sub, .lookup label span, .lookup-error { font-size: 16px; }
.lookup input { font-size: 16px; min-height: 48px; }
.lookup label span, .btn-primary { font-weight: 700; }
.btn-primary { font-size: 16px; min-height: 48px; }
.demo-bar { border-radius: 16px; width: min(460px, calc(100vw - 24px)); padding: 12px 16px; }
.demo-bar label { flex: 1; flex-wrap: wrap; gap: 4px 8px; font-size: 14px; }
.demo-bar input { flex: 1; min-width: 110px; max-width: 100%; height: 24px; }
:focus-visible { outline: 3px solid #75432f; outline-offset: 4px; }
@media (max-width: 600px) {
  .page { margin-top: 0; padding: 20px 16px 112px; border-radius: 0; }
  .preview-note { margin-bottom: 24px; font-size: 13px; padding: 10px 12px; }
  .preview-note span { flex-basis: 100%; }
  .head-value { font-size: 20px; }
  .head > div { max-width: 58%; }
  .head .right { max-width: 40%; }
  .steps { margin-top: 26px; }
  .step { font-size: 12px; }
  .step .ic { width: 38px; height: 38px; }
  .step .ic svg { width: 17px; height: 17px; }
  .step:not(:last-child)::after { top: 18px; }
  .step .lbl { max-width: 72px; }
  .status { margin: 24px 0 28px; padding: 16px 12px; }
  .status-main { font-size: 16px; }
  .latest, .ev { padding-left: 40px; }
  .latest { margin-bottom: 28px; }
  .ev-row { flex-direction: column; align-items: flex-start; gap: 5px; }
  .ev-title { font-size: 16px; }
  .ev-time { font-size: 13px; white-space: normal; }
  .ev-desc { font-size: 15px; }
  .card-head { font-size: 11px; letter-spacing: .06em; padding: 12px; }
  .card-body { padding: 14px 12px; }
  .details { padding: 16px; }
  .row { flex-direction: column; gap: 5px; }
  .row dt { font-size: 14px; color: #786c62; }
  .row dd { text-align: left; font-size: 16px; }
  .close { width: 100%; justify-content: center; }
  .demo-bar { bottom: 10px; gap: 8px; }
  .demo-tag { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.demo-bar.accelerated { flex-wrap: wrap; border-radius: 16px; }
.demo-speed { font-size: 13px; color: #ead9c6; }
.shipping-partners { display: grid; grid-template-columns: 1.3fr .95fr 1.65fr .4fr; align-items: center; gap: 28px; max-width: 570px; margin: 56px auto 48px; padding: 12px 0; }
.shipping-partners img { display: block; width: 100%; height: 40px; object-fit: contain; }
.shipping-partners img:last-child { height: 46px; }
.faq h2 { margin: 0 0 24px; font-size: clamp(24px, 4vw, 30px); font-weight: 700; letter-spacing: -.025em; }
.faq details { margin-bottom: 14px; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; background: var(--card); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; list-style: none; cursor: pointer; padding: 20px 22px; font-size: 17px; font-weight: 700; line-height: 1.45; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; width: 9px; height: 9px; flex-shrink: 0; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(45deg); margin: -4px 2px 0 0; }
.faq details[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq summary:hover { background: var(--green-bg); }
.faq-answer { padding: 18px 22px 22px; color: var(--ink-3); font-size: 16px; line-height: 1.7; }
.faq-answer p { margin: 0; }
.faq-answer a { color: var(--green-ink); text-underline-offset: 3px; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .shipping-partners { margin: 36px auto; padding: 8px 0; gap: 14px; }
  .shipping-partners img { height: 28px; }
  .shipping-partners img:last-child { height: 34px; }
  .faq h2 { margin-bottom: 18px; }
  .faq summary { padding: 18px 16px; font-size: 16px; gap: 16px; }
  .faq-answer { padding: 16px; }
}
.demo-playback { margin-left: auto; min-height: 44px; min-width: 76px; padding: 8px 14px; border: 1px solid #a98b70; border-radius: 8px; background: #75432f; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }

/* Reveal order details gently without replaying during milestone updates. */
.view-enter { animation: order-reveal 480ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes order-reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .view-enter { animation: none; }
}
