:root {
  --cream: #faf6f1;
  --rose: #9e5a63;
  --rose-dark: #7a4249;
  --espresso: #2a2220;
  --success: #16a34a;
  --line: rgba(158, 90, 99, 0.22);
  --muted: rgba(42, 34, 32, 0.65);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  background: var(--cream);
  color: var(--espresso);
  font-family: "DM Sans", sans-serif;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 1rem 1.25rem;
  text-align: center;
}

.brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--espresso);
  text-decoration: none;
}

.brand em { color: var(--rose); font-style: normal; }

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.search-card,
.result-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(42, 34, 32, 0.07);
}

.result-card { margin-top: 1.25rem; }

.field { margin-bottom: 0.85rem; }

.field label {
  display: block;
  font-family: "Jost", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(158, 90, 99, 0.12);
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 0.9rem;
  font-family: "Jost", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  color: #fff;
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.search-error {
  color: #c0392b;
  font-size: 0.82rem;
  margin-top: 0.75rem;
  text-align: center;
}

.status-hero {
  text-align: center;
  padding: 1rem 0.5rem 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.status-hero-label {
  font-family: "Jost", sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.status-hero-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: 0.35rem;
}

.status-hero-sub {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 36ch;
  margin: 0 auto;
}

.status-hero[data-status="shipped"] .status-hero-title,
.status-hero[data-status="delivered"] .status-hero-title {
  color: var(--success);
}

.status-hero[data-status="misplaced"] .status-hero-title {
  color: #b45309;
}

.alert-box {
  background: #fff7ed;
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.alert-box strong {
  display: block;
  font-family: "Jost", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b45309;
  margin-bottom: 0.35rem;
}

.alert-box p {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #7c2d12;
}

.btn-refund {
  width: 100%;
  margin-top: 0.85rem;
  border: none;
  border-radius: 8px;
  padding: 0.85rem;
  font-family: "Jost", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #b45309;
  color: #fff;
  cursor: pointer;
}

.refund-terms-title {
  font-family: "Jost", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7c2d12;
  margin-bottom: 0.35rem;
}

.refund-terms-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: #b45309;
  margin-bottom: 0.55rem;
}

.refund-terms-scroll-wrap {
  position: relative;
  margin-bottom: 0.85rem;
}

.refund-terms-scroll {
  max-height: 140px;
  overflow-y: auto;
  padding: 0.65rem 0.75rem 1.1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(180, 83, 9, 0.28);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #7c2d12;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 83, 9, 0.45) transparent;
}

.refund-terms-scroll::-webkit-scrollbar {
  width: 6px;
}

.refund-terms-scroll::-webkit-scrollbar-thumb {
  background: rgba(180, 83, 9, 0.45);
  border-radius: 999px;
}

.refund-terms-intro {
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
}

.refund-terms-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  counter-reset: refund-term;
}

.refund-terms-list li {
  counter-increment: refund-term;
  position: relative;
  padding: 0.55rem 0.65rem 0.55rem 2rem;
  border-radius: 7px;
  background: #fff;
  border: 1px solid rgba(180, 83, 9, 0.16);
  box-shadow: 0 1px 0 rgba(42, 34, 32, 0.04);
}

.refund-terms-list li::before {
  content: counter(refund-term);
  position: absolute;
  left: 0.55rem;
  top: 0.55rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Jost", sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background: #b45309;
}

.refund-terms-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.4rem;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(to bottom, rgba(255, 247, 237, 0), rgba(255, 247, 237, 0.95) 55%, #fff7ed);
  pointer-events: none;
}

.refund-terms-fade.hidden {
  display: none;
}

.refund-accept {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #7c2d12;
  margin-bottom: 0.85rem;
  cursor: pointer;
}

.refund-accept input {
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: #b45309;
}

.refund-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.55rem;
}

.refund-actions .btn-refund {
  margin-top: 0;
}

.btn-refund-back {
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: 8px;
  padding: 0.85rem 0.65rem;
  font-family: "Jost", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  color: #b45309;
  cursor: pointer;
}

.btn-refund:hover:not(:disabled) {
  background: #92400e;
}

.btn-refund:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.refund-success {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.25);
  font-size: 0.84rem;
  line-height: 1.5;
  color: #166534;
}

.refund-success strong {
  font-weight: 700;
}

.progress-track {
  margin-bottom: 1.25rem;
}

.progress-bar {
  height: 4px;
  background: rgba(158, 90, 99, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--rose), var(--success));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
}

.progress-steps li {
  text-align: center;
  font-size: 0.65rem;
  color: var(--muted);
}

.progress-steps li.done,
.progress-steps li.active {
  color: var(--espresso);
}

.progress-dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0 auto 0.25rem;
  border-radius: 50%;
  background: rgba(158, 90, 99, 0.1);
  color: var(--rose);
  font-size: 0.72rem;
  font-weight: 600;
}

.progress-steps li.done .progress-dot {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.progress-steps li.active .progress-dot {
  background: var(--rose);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(158, 90, 99, 0.2);
}

.progress-steps li.done.active .progress-dot {
  background: var(--success);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.progress-label {
  display: block;
  font-family: "Jost", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.code-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.result-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.tracking-code {
  font-family: "Montserrat", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--rose-dark);
}

.btn-copy {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: #fafafa;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-family: "Jost", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rose-dark);
  cursor: pointer;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
  font-family: "Montserrat", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.status-badge.pending {
  background: rgba(158, 90, 99, 0.1);
  color: var(--rose-dark);
}

.status-badge.delivered {
  background: rgba(22, 163, 74, 0.15);
}

.status-badge.alert {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.order-meta {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.order-meta strong {
  color: var(--espresso);
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
}

.carrier-box {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}

.carrier-box strong {
  display: block;
  font-family: "Jost", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.carrier-code {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--espresso);
  margin-bottom: 0.5rem;
}

.carrier-link {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rose-dark);
  text-decoration: none;
}

.carrier-link:hover {
  text-decoration: underline;
}

.timeline-title {
  font-family: "Jost", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.timeline {
  list-style: none;
  display: grid;
  gap: 0;
}

.timeline li {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  padding-bottom: 1rem;
  position: relative;
}

.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: rgba(158, 90, 99, 0.15);
}

.timeline li.done:not(:last-child)::after {
  background: rgba(22, 163, 74, 0.25);
}

.timeline li strong {
  display: block;
  color: var(--espresso);
  margin-bottom: 0.15rem;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
}

.timeline li.active strong {
  color: var(--rose-dark);
}

.timeline li.alert strong {
  color: #b45309;
}

.timeline li.alert .timeline-icon {
  background: rgba(180, 83, 9, 0.15);
  color: #b45309;
  font-weight: 700;
}

.timeline li.alert.active .timeline-icon {
  background: #b45309;
  color: #fff;
}

.timeline li.alert:not(:last-child)::after {
  background: rgba(180, 83, 9, 0.2);
}

.timeline li.empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.timeline-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(158, 90, 99, 0.1);
  color: var(--rose);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.timeline li.done .timeline-icon {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.timeline li.active .timeline-icon {
  background: var(--rose);
  color: #fff;
}

.timeline-date {
  font-size: 0.72rem;
  margin-top: 0.15rem;
  opacity: 0.8;
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  color: var(--rose-dark);
  font-size: 0.85rem;
  text-decoration: none;
}

.hidden { display: none !important; }
