@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap');

:root {
  --red: #f71924;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e8edf4;
  --soft: #f7f9fc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: #eef2f7;
  color: var(--ink);
  font-family: "Source Sans Pro", sans-serif;
}

button, input, textarea {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.phone-shell {
  position: relative;
  width: min(100vw, 430px);
  height: min(100vh, 932px);
  height: min(100dvh, 932px);
  overflow: hidden;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.18);
}

.app-screen {
  height: 100%;
  overflow: hidden;
  padding: 14px 16px calc(72px + env(safe-area-inset-bottom));
}

.mobile-header,
.page-title,
.card-head,
.brand,
.driver-hero,
.bottom-nav {
  display: flex;
  align-items: center;
}

.mobile-header,
.page-title,
.card-head {
  justify-content: space-between;
}

.mobile-header {
  height: 50px;
}

.brand {
  gap: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid var(--red);
  border-left-color: #222832;
  border-radius: 13px;
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 15px;
  font-style: italic;
  text-transform: uppercase;
}

.brand b {
  color: var(--red);
}

.brand small {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #111827;
  font-weight: 900;
}

.alert-dot {
  position: relative;
  color: var(--red);
}

.view {
  display: none;
  height: calc(100% - 50px);
  overflow-y: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.view.active {
  display: block;
}

.driver-hero {
  gap: 12px;
  padding: 12px 0;
}

.driver-avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #eaf1fb;
  color: #111827;
  font-weight: 900;
}

.driver-hero span,
.driver-hero p,
.card p,
.card small,
.trip-card p,
.tracking-info span,
.trip-facts span {
  color: var(--muted);
}

h1, h2, p {
  margin: 0;
}

.driver-hero h1 {
  margin: 2px 0;
  font-size: 20px;
}

.page-title {
  height: 48px;
}

.page-title h1 {
  font-size: 17px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.06);
}

.overview-card,
.current-trip,
.trip-list,
.detail-card,
.trip-facts,
.tracking-info,
.checklist,
.task-card,
.profile-head,
.pod-form,
.settings-list,
.alert-list-mobile {
  margin-top: 12px;
}

.card-head strong,
.card-head h2 {
  font-size: 14px;
}

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

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.overview-grid div {
  display: grid;
  gap: 7px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.overview-grid i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #fff0f1;
  color: var(--red);
  font-style: normal;
  font-weight: 900;
}

.overview-grid strong {
  font-size: 22px;
}

.overview-grid span {
  font-size: 12px;
}

.current-trip h2,
.detail-card h2,
.compact-card h2 {
  margin: 14px 0 8px;
  font-size: 17px;
}

.pill,
.active-pill,
.priority {
  border-radius: 8px;
  background: #dbeafe;
  color: #1f4e8c;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
}

.active-pill {
  background: #d8f2de;
  color: #176033;
}

.priority {
  background: #ffe0e3;
  color: var(--red);
}

.progress-line {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7ebf1;
  margin: 12px 0 16px;
}

.progress-line b {
  display: block;
  width: 65%;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
}

.primary {
  width: 100%;
  height: 46px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ff3138, #e9151f);
  color: #fff;
  font-weight: 800;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.tabs button {
  height: 40px;
  color: var(--muted);
  font-size: 13px;
}

.tabs button.active {
  border-bottom: 2px solid var(--red);
  color: var(--red);
}

.trip-card {
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
}

.trip-card .card-head {
  align-items: flex-start;
}

.trip-card h2 {
  font-size: 18px;
}

.mobile-map {
  position: relative;
  height: clamp(260px, 37dvh, 330px);
  overflow: hidden;
  border-radius: 14px;
  margin-top: 12px;
  background:
    linear-gradient(35deg, transparent 0 46%, #dce3ec 47% 48%, transparent 49%),
    linear-gradient(120deg, transparent 0 46%, #dce3ec 47% 48%, transparent 49%),
    #f7fbff;
  background-size: 38px 38px, 48px 48px, auto;
}

.mobile-map.tall {
  height: clamp(350px, 52dvh, 480px);
}

.mobile-map svg {
  position: absolute;
  inset: 20px 35px;
  width: calc(100% - 70px);
  height: calc(100% - 40px);
}

.mobile-map path {
  fill: none;
  stroke: var(--red);
  stroke-width: 6;
  stroke-linecap: round;
}

.stop,
.truck-marker {
  position: absolute;
  z-index: 2;
  font-weight: 800;
}

.origin {
  left: 60px;
  top: 48px;
}

.destination {
  right: 28px;
  bottom: 28px;
}

.truck-marker {
  display: grid;
  place-items: center;
  left: 178px;
  top: 160px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
}

.trip-facts p,
.tracking-info p {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.checklist {
  display: grid;
  gap: 14px;
}

.checklist label {
  color: #374151;
  font-size: 14px;
}

.task-card {
  position: relative;
}

.task-card .priority {
  position: absolute;
  right: 16px;
  top: 16px;
}

.alert-item-mobile {
  display: grid;
  grid-template-columns: 42px 1fr 45px;
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.alert-item-mobile i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.alert-item-mobile p,
.alert-item-mobile time {
  color: var(--muted);
  font-size: 12px;
}

.profile-head {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
}

.settings-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.settings-list button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  text-align: left;
}

.settings-list .logout {
  color: var(--red);
}

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

.photo-box {
  position: relative;
  display: grid;
  place-items: center;
  gap: 7px;
  height: clamp(126px, 19dvh, 160px);
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #111827;
  font-weight: 800;
  background: #fff;
}

.photo-box .camera-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid #111827;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.photo-box small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

#podPhotoPreview {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#podPhotoPreview[src] {
  display: block;
}

.photo-box:has(#podPhotoPreview[src]) b,
.photo-box:has(#podPhotoPreview[src]) small,
.photo-box:has(#podPhotoPreview[src]) .camera-icon {
  position: relative;
  z-index: 1;
}

.photo-box:has(#podPhotoPreview[src])::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(17, 24, 39, 0.62));
  content: '';
}

.photo-box:has(#podPhotoPreview[src]) b,
.photo-box:has(#podPhotoPreview[src]) small {
  color: #fff;
}

#podPhotoInput {
  display: none;
}

.pod-form label {
  display: grid;
  gap: 8px;
  color: #374151;
  font-size: 13px;
}

.pod-form input,
.pod-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
  padding: 11px;
}

.pod-form textarea {
  min-height: 86px;
  resize: none;
}

.pod-message {
  min-height: 18px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

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

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(62px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav button {
  color: #374151;
  font-size: 11px;
}

.bottom-nav button.active {
  color: var(--red);
  font-weight: 800;
}

@media (max-width: 480px) {
  body {
    display: block;
    background: #fff;
    overflow: hidden;
  }

  .phone-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .app-screen {
    padding: 10px 14px calc(66px + env(safe-area-inset-bottom));
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small {
    font-size: 8px;
  }

  .current-trip h2,
  .detail-card h2,
  .compact-card h2 {
    margin: 11px 0 7px;
  }

  .progress-line {
    margin: 10px 0 13px;
  }
}
