:root {
  --green: #0f9f64;
  --green-dark: #087449;
  --green-soft: #eaf8f1;
  --mint: #c8f1dd;
  --ink: #15211b;
  --muted: #68776f;
  --line: #e7eee9;
  --bg: #f7faf8;
  --card: #ffffff;
  --danger: #d95050;
  --warning: #d58a15;
  --blue: #2b74d6;
  --shadow: 0 10px 30px rgba(24, 40, 32, 0.08);
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 14px calc(92px + env(safe-area-inset-bottom));
}

.boot {
  min-height: 70vh;
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
  color: var(--green-dark);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -16px -14px 14px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(247, 250, 248, 0.92);
  backdrop-filter: blur(14px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 159, 100, 0.25);
}

.logo-title {
  display: grid;
  gap: 2px;
}

.logo-title strong {
  font-size: 16px;
}

.logo-title span {
  color: var(--muted);
  font-size: 12px;
}

.language {
  min-width: 118px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

.panel,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.stack {
  display: grid;
  gap: 12px;
}

.hero {
  display: grid;
  gap: 16px;
}

.hello {
  display: grid;
  gap: 4px;
}

.hello span {
  color: var(--muted);
  font-size: 13px;
}

.hello h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.12;
}

.route-card {
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #eefaf4 100%);
}

.route-labels {
  display: flex;
  justify-content: space-between;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 14px;
}

.route-line {
  position: relative;
  height: 76px;
  margin-top: 10px;
}

.route-line::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 40px;
  height: 4px;
  border-radius: 99px;
  background: repeating-linear-gradient(90deg, var(--green) 0 18px, transparent 18px 26px);
  opacity: 0.75;
}

.route-dot {
  position: absolute;
  top: 31px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 5px solid var(--green);
  z-index: 1;
}

.route-dot.end {
  right: 0;
}

.truck {
  position: absolute;
  top: 12px;
  left: 2%;
  width: 54px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 23px;
  box-shadow: 0 10px 18px rgba(15, 159, 100, 0.28);
  animation: moveTruck 4.2s ease-in-out infinite;
  z-index: 2;
}

@keyframes moveTruck {
  0%,
  12% {
    transform: translateX(0);
  }
  52% {
    transform: translateX(calc(min(100vw, 520px) - 120px));
  }
  100% {
    transform: translateX(0);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  min-height: 92px;
  padding: 14px;
  text-align: left;
  display: grid;
  gap: 8px;
  background: white;
  color: var(--ink);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  font-size: 24px;
}

.info-list {
  display: grid;
  gap: 10px;
}

.info-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fbf9;
  border: 1px solid var(--line);
}

.info-row span {
  color: var(--muted);
  font-size: 12px;
}

.info-row strong,
.info-row p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  word-break: break-word;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 46px;
  border-radius: 10px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.primary-btn {
  background: var(--green);
  color: white;
  box-shadow: 0 12px 22px rgba(15, 159, 100, 0.22);
}

.secondary-btn {
  background: var(--green-soft);
  color: var(--green-dark);
}

.ghost-btn {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 6px;
}

.section-title h2 {
  margin: 0;
  font-size: 19px;
}

.parcel-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.parcel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.parcel-top strong {
  word-break: break-word;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--green-soft);
}

.pill.warning {
  color: #81530e;
  background: #fff4d9;
}

.pill.blue {
  color: #174f96;
  background: #e8f1ff;
}

.pill.danger {
  color: #9a2626;
  background: #ffeaea;
}

.parcel-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.parcel-meta div {
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px;
  background: #fbfdfc;
}

.parcel-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field textarea,
.field select,
.searchbar input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.searchbar input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 159, 100, 0.12);
}

.searchbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.profile-head {
  display: grid;
  gap: 12px;
}

.profile-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  padding: 14px;
  color: white;
  background: var(--green);
}

.profile-code span {
  opacity: 0.86;
  font-size: 12px;
}

.profile-code strong {
  font-size: 26px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.menu-list {
  display: grid;
  gap: 8px;
}

.menu-item {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  text-align: left;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.menu-item span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.menu-item small {
  color: var(--muted);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  width: min(100%, 520px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.nav-btn {
  min-height: 56px;
  display: grid;
  place-items: center;
  gap: 3px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.nav-btn strong {
  font-size: 20px;
  line-height: 1;
}

.nav-btn.active {
  color: var(--green-dark);
  background: var(--green-soft);
}

.empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 50;
  transform: translate(-50%, 20px);
  max-width: min(92%, 420px);
  padding: 12px 14px;
  border-radius: 8px;
  background: #17251d;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: 0.22s ease;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(12, 22, 17, 0.32);
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
}

.modal.open {
  display: grid;
  align-items: end;
}

.modal-sheet {
  width: min(100%, 520px);
  max-height: 86vh;
  overflow: auto;
  margin: 0 auto;
  border-radius: 8px;
  background: white;
  padding: 16px;
  box-shadow: 0 18px 44px rgba(10, 22, 15, 0.22);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f3f7f5;
  color: var(--ink);
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  border-left: 3px solid var(--green);
  padding: 4px 0 4px 10px;
}

.history-item small {
  color: var(--muted);
}

@media (max-width: 390px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .hello h1 {
    font-size: 22px;
  }

  .parcel-meta,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .searchbar {
    grid-template-columns: 1fr;
  }

  .language {
    min-width: 104px;
    font-size: 13px;
  }
}
