:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --border: #dbe5f0;
  --text: #0f172a;
  --muted: #5f6f85;
  --accent: #2563eb;
  --accent-dim: #1d4ed8;
  --success: #34c759;
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(61, 156, 245, 0.15);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.notice {
  background: linear-gradient(165deg, rgba(255, 251, 235, 0.92), rgba(254, 243, 199, 0.92));
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
}

.notice__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.notice__text {
  margin: 0;
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #92400e;
  font-weight: 600;
}

.notice__icon {
  margin-right: 0.55rem;
  color: #b45309;
  font-size: 0.95em;
  vertical-align: -0.05em;
}

.notice--marquee .notice__inner {
  align-items: center;
}

.notice__marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.notice__marqueeTrack {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding-left: 100%;
  animation: notice-marquee 34s linear infinite;
}

.notice__sep {
  color: rgba(146, 64, 14, 0.55);
  font-weight: 900;
}

.notice--marquee:hover .notice__marqueeTrack {
  animation-play-state: paused;
}

@keyframes notice-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.875rem 1rem;
  padding-top: max(0.875rem, env(safe-area-inset-top, 0.875rem));
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.logo {
  text-decoration: none;
  padding: 0.2rem 0;
  margin: -0.2rem 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.logo img {
  height: 34px;
  width: auto;
  display: block;
}

.logo:hover {
  opacity: 0.92;
}

.tagline {
  font-size: 0.875rem;
  color: var(--muted);
}

.main {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  width: 100%;
}

body.page-tracking .main {
  padding-top: 1.1rem;
  max-width: 1120px;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.track-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.track-form input {
  flex: 1 1 200px;
  min-height: 48px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.track-form input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.track-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 156, 245, 0.2);
}

.track-form button {
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(165deg, var(--accent), var(--accent-dim));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
  touch-action: manipulation;
}

.track-form button:hover {
  filter: brightness(1.08);
}

.track-form button:active {
  transform: scale(0.98);
}

.live-section {
  margin-top: 1.75rem;
  padding: 1.15rem 1.1rem 1.25rem;
  background: linear-gradient(165deg, #ffffff, #f2f7ff);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
}

.live-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.live-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.live-hero-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
}

.live-eta-ring {
  --live-progress: 0;
  width: 86px;
  height: 86px;
  min-width: 86px;
  border-radius: 50%;
  padding: 5px;
  flex-shrink: 0;
  background: conic-gradient(
    var(--accent) calc(var(--live-progress) * 1%),
    #d7e2f0 0
  );
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}

.live-eta-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.live-eta-mins {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.live-eta-unit {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 2px;
}

.live-hero-body {
  flex: 1;
  min-width: 0;
}

.live-hero-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.live-hero-detail {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.live-progress-track {
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.live-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.45s ease-out;
}

.live-stats-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.live-stat--speed {
  color: var(--text);
  font-weight: 500;
}

.live-rider-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
}

@media (max-width: 420px) {
  .live-rider-card {
    grid-template-columns: auto 1fr;
  }

  .live-rider-btns {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .live-chip {
    flex: 1;
    justify-content: center;
  }
}

.live-rider-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent-dim), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-rider-name {
  margin: 0 0 0.15rem;
  font-weight: 600;
  font-size: 1rem;
}

.live-rider-line {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.live-rider-dot {
  margin: 0 0.25rem;
  opacity: 0.5;
}

.live-rider-stars {
  color: #f5a623;
  font-weight: 600;
}

.live-rider-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: filter 0.12s, transform 0.12s;
}

.live-chip:active {
  transform: scale(0.98);
}

.live-chip--call {
  background: linear-gradient(165deg, #34c759, #248a3d);
  color: #fff;
}

.live-chip--call:hover {
  filter: brightness(1.06);
}

.live-chip--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.live-chip--ghost:hover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.live-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(135deg, #ff3b30, #c62828);
  border-radius: 6px;
  box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.45);
  animation: live-pulse-ring 2s ease-out infinite;
  flex-shrink: 0;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: live-blink 1.1s step-end infinite;
}

@keyframes live-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes live-pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
  }
}

.live-copy {
  margin: 0;
  flex: 1 1 180px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.live-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.map-wrap {
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.map-wrap--live {
  position: relative;
}

.map-live-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  pointer-events: none;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.map-live-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: live-blink 1.2s step-end infinite;
}

.live-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.live-toolbar-btn {
  flex: 1 1 auto;
  min-height: 46px;
  padding: 0 1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  touch-action: manipulation;
  transition: border-color 0.15s, background 0.15s;
}

.live-toolbar-btn:hover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.live-toolbar-btn--secondary {
  flex: 0 1 auto;
  min-width: 7rem;
}

.live-toolbar-icon {
  font-size: 1rem;
  opacity: 0.85;
}

.live-nudge {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.live-nudge:not([hidden]) {
  display: block;
}

.live-map {
  height: clamp(200px, 42vh, 340px);
  width: 100%;
  z-index: 0;
}

.live-map .leaflet-container {
  font-family: var(--font);
  background: var(--surface);
  touch-action: pan-x pan-y pinch-zoom;
}

/* Larger map zoom controls for touch */
.live-map .leaflet-bar a {
  min-width: 40px;
  min-height: 40px;
  line-height: 40px;
  font-size: 1.25rem;
}

.rider-marker-wrap {
  background: transparent !important;
  border: none !important;
}

.rider-marker {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.35s ease-out;
}

.rider-pulse {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.28);
  animation: rider-pulse 2s ease-out infinite;
}

@keyframes rider-pulse {
  0% {
    transform: scale(0.65);
    opacity: 1;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.rider-arrow {
  position: relative;
  z-index: 1;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid var(--accent);
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.25));
}

.dest-pin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.result {
  margin-top: 2.5rem;
}

.tracking-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.15rem;
  align-items: start;
}

@media (max-width: 920px) {
  .tracking-grid {
    grid-template-columns: 1fr;
  }
}

.tracking-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  padding: 1rem 1.1rem 1.1rem;
}

.delivery-date-card {
  background: #22c55e;
  border-radius: calc(var(--radius) + 6px);
  padding: 0.9rem 1rem 0.95rem;
  color: #ecfdf3;
  margin-bottom: 0.9rem;
}

.delivery-date-label {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.delivery-date-main {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}

.delivery-date-day {
  font-size: 8.4rem;
  font-weight: 800;
  line-height: 1;
}

.delivery-date-suffix {
  font-size: 2.9rem;
  align-self: flex-start;
  margin-top: 0.1rem;
}

.delivery-date-monthyear {
  font-size: 4rem;
  font-weight: 600;
}

.delivery-date-status-label {
  margin: 0 0 0.1rem;
  font-size: 0.8rem;
  opacity: 0.9;
}

.delivery-date-status-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.tracking-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.tracking-card-label {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.tracking-card-status {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #b42318;
}

.tracking-map {
  margin: 0.85rem 0 0.95rem;
}

.live-rider-card--compact {
  margin: 0 0 0.75rem;
}

.live-bar--tight {
  margin-bottom: 0.75rem;
}

.tracking-timeline {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.tracking-timeline-title {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
}

.tracking-timeline .timeline {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  padding: 1rem 1.1rem;
}

.order-card-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.order-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #e7ebf2;
  background: #f1f4f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  font-size: 0.95rem;
}

.order-card-title {
  margin: 0;
  font-weight: 800;
  color: #111827;
  font-size: 0.95rem;
}

.order-kv {
  display: grid;
  gap: 0.6rem;
}

.order-kv-row {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  border-top: 1px dashed var(--border);
  padding-top: 0.55rem;
}

.order-kv-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.order-kv-k {
  color: var(--muted);
  font-size: 0.82rem;
}

.order-kv-v {
  color: #111827;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: right;
  word-break: break-word;
}

.order-panel .delivery-details-card {
  margin-top: 1.15rem;
}

.rider-info-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  margin-bottom: 0.9rem;
}

.panel-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.panel-action-btn {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: #ffffff;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  touch-action: manipulation;
}

.panel-action-btn:not(.panel-action-btn--primary):hover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.panel-action-btn:active {
  transform: scale(0.98);
}

.panel-action-btn--primary {
  border: none;
  color: #ffffff;
  background: linear-gradient(165deg, var(--accent), var(--accent-dim));
}

.panel-action-btn--primary:hover {
  background: linear-gradient(165deg, var(--accent), var(--accent-dim));
  filter: brightness(1.06);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 3000;
}

.modal {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid rgba(219, 229, 240, 0.8);
  border-radius: calc(var(--radius) + 10px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: #f6f8fc;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  margin: 0;
  font-weight: 800;
  color: #111827;
  font-size: 1rem;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  color: #111827;
}

.modal-close:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-body {
  padding: 1rem 1.15rem 1.1rem;
}

.modal-msg {
  margin: 0 0 0.85rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
}

.modal-hint {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.modal-qr {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  background: #ffffff;
  padding: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 280px;
  margin: 0 auto;
}

.modal-qr img {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
}

.modal-qr-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.modal-qr-actions .modal-btn {
  min-height: 40px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}

.modal-tx-msg {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: center;
}

.modal-tx-msg.is-success {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.modal-foot {
  padding: 0 1.15rem 1.15rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.modal-foot--inline {
  padding: 0;
  margin-top: 0.75rem;
}

.modal-btn {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: calc(var(--radius) + 2px);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
  touch-action: manipulation;
}

.modal-btn:active {
  transform: scale(0.98);
}

.modal-btn--primary {
  border: none;
  color: #ffffff;
  background: linear-gradient(165deg, var(--accent), var(--accent-dim));
}

.modal-btn--ghost {
  background: transparent;
}

.modal-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.query-form {
  display: grid;
  gap: 0.75rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #111827;
}

.req-star {
  color: #dc2626;
  font-weight: 900;
  margin-left: 0.15rem;
}

.query-form input,
.query-form select {
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: #ffffff;
  font: inherit;
  color: var(--text);
  outline: none;
}

.query-form input.has-error,
.query-form select.has-error {
  border-color: rgba(220, 38, 38, 0.7);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.field-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #dc2626;
  line-height: 1.25;
}

.query-form input:focus,
.query-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 156, 245, 0.2);
}

.query-msg {
  margin: 0.1rem 0 0;
  font-weight: 800;
}

.query-msg.is-success {
  color: #16a34a;
}

.query-msg.is-error {
  color: #dc2626;
}

.query-notice {
  margin: 0 0 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
}

.query-notice.is-success {
  color: #166534;
  background: #ecfdf5;
  border: 1px solid #86efac;
}

.query-notice.is-error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.rider-info-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #2563eb;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.rider-info-text {
  flex: 1;
  min-width: 0;
}

.rider-info-name {
  margin: 0 0 0.1rem;
  font-weight: 700;
  font-size: 0.98rem;
  color: #111827;
}

.rider-info-line {
  margin: 0;
  font-size: 0.86rem;
  color: #6b7280;
}

.rider-info-dot {
  margin: 0 0.25rem;
}

.rider-info-rating {
  color: #f59e0b;
  font-weight: 600;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.1rem 1.15rem;
}

.result > .result-card {
  margin-top: 0.9rem;
}

.delivery-details-card {
  margin-top: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  overflow: hidden;
}

.delivery-details-head {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem 1.1rem;
  background: #f6f8fc;
  border-bottom: 1px solid var(--border);
}

.delivery-details-head-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid #e7ebf2;
  background: #f1f4f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #374151;
  line-height: 1;
}

.delivery-details-title {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 700;
  color: #1f2937;
}

.delivery-details-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.84rem;
  color: #6b7280;
}

.delivery-details-body {
  padding: 1rem 1.1rem;
}

.nps-card {
  margin-top: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  padding: 1.05rem 1.1rem 1.15rem;
}

.nps-title {
  margin: 0 0 0.9rem;
  font-weight: 700;
  color: #111827;
  font-size: 0.95rem;
  line-height: 1.45;
}

.nps-scale {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.nps-pill {
  min-height: 40px;
  border-radius: 999px;
  --nps-hue: 210;
  --nps-color: hsl(var(--nps-hue) 78% 46%);
  border: 1px solid color-mix(in srgb, var(--nps-color), #ffffff 75%);
  background: #ffffff;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: #111827;
  cursor: pointer;
  transition: transform 0.12s, background-color 0.12s, border-color 0.12s;
}

.nps-pill:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--nps-color), #ffffff 55%);
}

.nps-pill.is-active {
  background: color-mix(in srgb, var(--nps-color), #ffffff 85%);
  border-color: color-mix(in srgb, var(--nps-color), #ffffff 40%);
  color: color-mix(in srgb, var(--nps-color), #000000 12%);
}

.nps-pill:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.nps-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.nps-form {
  display: grid;
  gap: 0.55rem;
}

.nps-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #111827;
}

.nps-remarks {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: #ffffff;
  font: inherit;
  color: var(--text);
  outline: none;
}

.nps-remarks:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 156, 245, 0.2);
}

.nps-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.nps-sent {
  color: #0f766e;
  font-weight: 700;
}

.nps-error {
  margin: 0;
  color: #b42318;
  font-weight: 600;
  font-size: 0.85rem;
}

.nps-submit {
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  border-radius: calc(var(--radius) + 2px);
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(165deg, var(--accent), var(--accent-dim));
  transition: transform 0.12s, filter 0.12s;
}

.nps-submit:hover {
  filter: brightness(1.08);
}

.nps-submit:active {
  transform: scale(0.98);
}

.nps-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.nps-count {
  font-variant-numeric: tabular-nums;
}

.delivery-details-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.delivery-details-row + .delivery-details-row {
  margin-top: 0.8rem;
}

.delivery-details-row-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #e7ebf2;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #4b5563;
  line-height: 1;
}

.delivery-details-content {
  flex: 1;
  min-width: 0;
}

.delivery-details-row-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #1f2937;
}

.delivery-details-row-text {
  margin: 0.18rem 0 0;
  color: #4b5563;
  font-size: 0.92rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.delivery-details-row-phone {
  margin: 0.45rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  word-break: break-word;
}

.delivery-details-row-hint {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: #6b7280;
}

.result-head {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 480px) {
  .result-head {
    grid-template-columns: 1fr 1fr;
  }
}

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

.result-awb {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.result-status {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent);
}

.eta {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--muted);
}

.eta-label {
  margin-right: 0.5rem;
}

.eta strong {
  color: var(--text);
  font-weight: 600;
}

.timeline-title {
  margin: 2rem 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

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

.timeline li {
  position: relative;
  padding: 0 0 1.25rem 1.75rem;
  border-left: 2px solid var(--border);
  margin-left: 0.35rem;
}

.timeline li:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
}

.timeline li.done::before {
  background: var(--success);
  border-color: var(--surface);
}

.timeline li.done {
  border-left-color: rgba(52, 199, 89, 0.35);
}

.timeline .step-title {
  margin: 0 0 0.2rem;
  font-weight: 600;
  font-size: 1rem;
}

.timeline li:not(.done) .step-title {
  color: var(--muted);
}

.timeline .step-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.error {
  margin-top: 1.5rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid rgba(255, 59, 48, 0.35);
  border-radius: var(--radius);
  color: #b42318;
  font-size: 0.9rem;
}

.footer {
  margin-top: auto;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.footer code {
  font-size: 0.85em;
  color: var(--accent);
  word-break: break-word;
}

@media (min-width: 640px) {
  .main {
    padding: 2.5rem 1.25rem 3rem;
  }

  body.page-tracking .main {
    padding-top: 1.5rem;
  }

  .header-inner {
    padding: 1rem 1.25rem;
    padding-top: max(1rem, env(safe-area-inset-top, 1rem));
  }

  .result-card {
    padding: 1.25rem 1.5rem;
  }

  .timeline li {
    padding-left: 2rem;
    margin-left: 0.5rem;
  }
}

@media (max-width: 639px) {
  .track-form {
    flex-direction: column;
  }

  .track-form input,
  .track-form button {
    flex: none;
    width: 100%;
  }

  .live-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .live-section {
    padding: 1rem 0.85rem 1.1rem;
  }

  .live-hero-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .live-hero-body {
    width: 100%;
    text-align: left;
  }

  .live-toolbar {
    flex-direction: column;
  }

  .live-toolbar-btn--secondary {
    min-width: unset;
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(1.5rem, 6.5vw, 2rem);
  }
}
