:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #c99a35;
  --brand-dark: #9b7327;
  --dark: #101828;
  --success: #15803d;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(15,23,42,.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.track-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(228,231,236,.85);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
}
.track-header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.track-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-size: 17px;
  font-weight: 800;
}
.track-brand img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: cover;
  border-radius: 50%;
  background: #050505;
  border: 1px solid rgba(201,154,53,.55);
}
.track-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.track-theme-btn,
.track-home-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
.track-theme-btn [data-theme-icon] {
  font-size: 18px;
}
.mobile-back { display: none; }

.track-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 62px;
  background:
    radial-gradient(circle at 90% 10%, rgba(201,154,53,.18), transparent 29%),
    radial-gradient(circle at 5% 80%, rgba(17,24,39,.07), transparent 28%),
    linear-gradient(180deg, #ffffff, #f4f6f9);
}
.track-hero::after {
  content: "";
  position: absolute;
  right: -150px;
  top: -190px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(201,154,53,.14);
  box-shadow: 0 0 0 55px rgba(201,154,53,.035), 0 0 0 110px rgba(201,154,53,.025);
  pointer-events: none;
}
.track-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: 58px;
}
.track-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 18px;
  background: var(--dark);
  color: #fff;
  font-size: 27px;
  box-shadow: 0 12px 30px rgba(16,24,40,.18);
}
.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.track-intro h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(44px, 6vw, 72px);
  line-height: .98;
  letter-spacing: -.055em;
}
.track-intro > p {
  max-width: 630px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}
.track-benefits {
  display: grid;
  gap: 11px;
  margin-top: 28px;
}
.track-benefits div {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
}
.track-benefits b {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  flex: 0 0 33px;
  border: 1px solid rgba(201,154,53,.35);
  border-radius: 10px;
  background: rgba(201,154,53,.10);
  color: var(--brand-dark);
  font-size: 10px;
}

.track-search-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(228,231,236,.9);
  border-radius: 28px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.search-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}
.track-search-card h2 {
  margin: 15px 0 7px;
  font-size: 29px;
  letter-spacing: -.035em;
}
.track-search-card > p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.track-form {
  display: grid;
  gap: 14px;
}
.track-form label {
  display: grid;
  gap: 7px;
}
.track-form label > span {
  color: #344054;
  font-size: 11px;
  font-weight: 800;
}
.track-form input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #d0d5dd;
  border-radius: 13px;
  padding: 0 14px;
  outline: none;
  background: #fff;
  color: var(--text);
  transition: .18s ease;
}
.track-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(201,154,53,.11);
}
.track-submit {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 2px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  transition: .18s ease;
}
.track-submit:hover { background: var(--brand-dark); transform: translateY(-1px); }
.track-submit:disabled { opacity: .62; cursor: wait; }
.track-error {
  margin-top: 13px;
  padding: 12px 13px;
  border: 1px solid #fecdca;
  border-radius: 12px;
  background: #fef3f2;
  color: #b42318;
  font-size: 12px;
  line-height: 1.5;
}
.track-help {
  display: grid;
  grid-template-columns: 25px 1fr;
  align-items: start;
  gap: 9px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.track-help > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}
.track-help p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.track-result-section {
  padding: 28px 0 68px;
}
.result-shell {
  display: grid;
  gap: 14px;
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 23px 25px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 10px 35px rgba(15,23,42,.05);
}
.result-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.result-head h2 {
  margin: 5px 0 0;
  font-size: 23px;
  letter-spacing: -.03em;
}
.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef2f6;
  font-size: 11px;
  font-weight: 800;
}
.status-pill.new { background: #fff7ed; color: #9a3412; }
.status-pill.confirmed { background: #eff6ff; color: #1d4ed8; }
.status-pill.preparing { background: #fffbeb; color: #92400e; }
.status-pill.delivered { background: #ecfdf3; color: #067647; }
.status-pill.cancelled { background: #fef2f2; color: #b42318; }

.timeline {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.step {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 70px;
  opacity: .35;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  transition: .2s ease;
}
.step b {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid #d0d5dd;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}
.step.done,
.step.active {
  opacity: 1;
  color: var(--text);
}
.step.done b,
.step.active b {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.line {
  height: 3px;
  border-radius: 999px;
  background: #e4e7ec;
}
.line.done { background: var(--brand); }

.cancelled {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 19px;
  border: 1px solid #fecdca;
  border-radius: 16px;
  background: #fef3f2;
  color: #b42318;
}
.cancelled > span {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  flex: 0 0 35px;
  border-radius: 50%;
  background: #fee4e2;
  font-weight: 800;
}
.cancelled strong { font-size: 13px; }
.cancelled p { margin: 3px 0 0; font-size: 11px; }

.track-grid {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: 14px;
}
.track-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.track-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}
.track-card-title > span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}
.track-card-title h3 {
  margin: 0;
  font-size: 15px;
}
.info-list {
  display: grid;
  gap: 13px;
}
.info-list div {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.info-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.info-list span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.info-list strong {
  font-size: 12px;
  text-align: right;
}
.track-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.track-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  padding: 5px;
  border-radius: 11px;
  background: var(--surface-soft);
}
.track-item h4 {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.4;
}
.track-item small {
  color: var(--muted);
  font-size: 10px;
}
.track-item > strong {
  font-size: 12px;
  white-space: nowrap;
}
.track-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding-top: 17px;
  border-top: 2px solid var(--line);
}
.track-total span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.track-total strong {
  font-size: 25px;
}
.auto-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 5px rgba(18,183,106,.10);
}

.track-bottom-help {
  padding: 0 0 80px;
}
.bottom-help-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 34px 36px;
  border-radius: 24px;
  background: var(--dark);
  color: #fff;
}
.bottom-help-card .eyebrow { color: #e6c979; }
.bottom-help-card h2 {
  margin: 0;
  font-size: 29px;
  letter-spacing: -.035em;
}
.bottom-help-card p {
  max-width: 670px;
  margin: 8px 0 0;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.65;
}
.bottom-help-card > a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 17px;
  border-radius: 13px;
  background: #fff;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

/* Dark mode */
html[data-theme="dark"] {
  --bg: #090d13;
  --surface: #111827;
  --surface-soft: #182131;
  --text: #f8fafc;
  --muted: #98a2b3;
  --line: #283548;
  --dark: #05080d;
  --shadow: 0 24px 70px rgba(0,0,0,.38);
}
html[data-theme="dark"] body {
  background: var(--bg);
}
html[data-theme="dark"] .track-header {
  background: rgba(9,13,19,.90);
  border-bottom-color: rgba(40,53,72,.9);
}
html[data-theme="dark"] .track-theme-btn,
html[data-theme="dark"] .track-home-btn,
html[data-theme="dark"] .track-search-card,
html[data-theme="dark"] .result-head,
html[data-theme="dark"] .timeline,
html[data-theme="dark"] .track-card {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
html[data-theme="dark"] .track-hero {
  background:
    radial-gradient(circle at 90% 10%, rgba(201,154,53,.14), transparent 29%),
    radial-gradient(circle at 5% 80%, rgba(255,255,255,.035), transparent 28%),
    linear-gradient(180deg, #0f1621, #090d13);
}
html[data-theme="dark"] .track-benefits div,
html[data-theme="dark"] .track-form label > span {
  color: #cbd5e1;
}
html[data-theme="dark"] .track-form input {
  background: #0d131c;
  color: #f8fafc;
  border-color: var(--line);
}
html[data-theme="dark"] .track-help > span,
html[data-theme="dark"] .track-card-title > span,
html[data-theme="dark"] .track-item img {
  background: var(--surface-soft);
}
html[data-theme="dark"] .step b {
  background: #111827;
  border-color: #475467;
}
html[data-theme="dark"] .line {
  background: #344054;
}
html[data-theme="dark"] .cancelled {
  background: rgba(180,35,24,.12);
  border-color: rgba(254,205,202,.16);
  color: #f97066;
}
html[data-theme="dark"] .cancelled > span {
  background: rgba(180,35,24,.22);
}
html[data-theme="dark"] .status-pill.new { background: rgba(154,52,18,.20); color: #fdba74; }
html[data-theme="dark"] .status-pill.confirmed { background: rgba(29,78,216,.22); color: #93c5fd; }
html[data-theme="dark"] .status-pill.preparing { background: rgba(146,64,14,.20); color: #fcd34d; }
html[data-theme="dark"] .status-pill.delivered { background: rgba(6,118,71,.22); color: #86efac; }
html[data-theme="dark"] .status-pill.cancelled { background: rgba(180,35,24,.20); color: #fca5a5; }

@media (max-width: 860px) {
  .track-hero {
    padding-top: 50px;
  }
  .track-hero-grid,
  .track-grid {
    grid-template-columns: 1fr;
  }
  .track-hero-grid {
    gap: 34px;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(100% - 24px, 1120px);
  }
  .track-header-inner {
    min-height: 66px;
    gap: 8px;
  }
  .track-brand img {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
  }
  .track-brand > span {
    display: none;
  }
  .track-header-actions {
    gap: 6px;
  }
  .track-theme-btn,
  .track-home-btn {
    min-height: 38px;
    padding: 0 10px;
    font-size: 11px;
  }
  .track-theme-btn [data-theme-text] {
    display: none;
  }
  .desktop-back { display: none; }
  .mobile-back { display: inline; }

  .track-hero {
    padding: 37px 0 36px;
  }
  .track-intro h1 {
    font-size: 41px;
  }
  .track-intro > p {
    font-size: 14px;
  }
  .track-benefits {
    display: none;
  }
  .track-search-card {
    padding: 21px 17px;
    border-radius: 21px;
  }
  .track-result-section {
    padding-top: 18px;
  }
  .result-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 19px;
  }
  .timeline {
    grid-template-columns: 1fr;
    justify-items: stretch;
    padding: 21px;
  }
  .step {
    grid-template-columns: 40px 1fr;
    justify-items: start;
    align-items: center;
    min-width: 0;
    text-align: left;
  }
  .line {
    width: 3px;
    height: 22px;
    margin: 4px 0 4px 18px;
  }
  .track-card {
    padding: 18px;
  }
  .info-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .info-list strong {
    text-align: left;
  }
  .track-item {
    grid-template-columns: 48px 1fr;
  }
  .track-item img {
    width: 48px;
    height: 48px;
  }
  .track-item > strong {
    grid-column: 2;
    margin-top: -5px;
  }
  .track-bottom-help {
    padding-bottom: 55px;
  }
  .bottom-help-card {
    align-items: flex-start;
    flex-direction: column;
    padding: 26px 22px;
  }
  .bottom-help-card h2 {
    font-size: 25px;
  }
  .bottom-help-card > a {
    width: 100%;
  }
}


/* =========================================================
   Tracking logo / mobile hardening
   ========================================================= */
.track-brand{
  min-width:0;
  flex:0 1 auto;
  overflow:hidden;
}

.track-brand img{
  width:44px !important;
  height:44px !important;
  min-width:44px !important;
  max-width:44px !important;
  flex:0 0 44px !important;
  object-fit:cover !important;
  border-radius:50% !important;
}

.track-brand span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.track-header-inner{
  min-width:0;
}

.track-header-actions{
  flex:0 0 auto;
}

@media(max-width:700px){
  .track-header-inner{
    min-height:64px;
    gap:8px;
  }

  .track-brand{
    gap:8px;
    max-width:min(54vw,210px);
  }

  .track-brand img{
    width:36px !important;
    height:36px !important;
    min-width:36px !important;
    max-width:36px !important;
    flex-basis:36px !important;
  }

  .track-brand span{
    font-size:13px;
  }

  .track-header-actions{
    gap:5px;
  }

  .track-theme-btn,
  .track-home-btn{
    min-height:36px;
    padding:0 9px;
    border-radius:10px;
    font-size:10px;
  }

  .track-theme-btn [data-theme-text]{
    display:none;
  }

  .desktop-back{
    display:none;
  }

  .mobile-back{
    display:inline;
  }
}

@media(max-width:390px){
  .track-brand{
    max-width:44vw;
  }

  .track-brand span{
    font-size:11px;
  }

  .track-home-btn{
    padding:0 7px;
  }
}


/* Receipt action */
.track-result-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:16px;
}
.track-receipt-btn{
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  color:var(--text);
  font-size:12px;
  font-weight:800;
  text-decoration:none;
}
.track-receipt-btn:hover{
  border-color:var(--brand);
}
html[data-theme="dark"] .track-receipt-btn{
  background:#111827;
  border-color:#344054;
  color:#f8fafc;
}
