:root {
  color-scheme: light;
  --bg: #dfe7ee;
  --screen: #fff3c2;
  --panel: #fffaf0;
  --paper: #ffffff;
  --ink: #141414;
  --muted: #6f6f6f;
  --line: #eadfbd;
  --field: #fffdf6;
  --yellow: #ffd612;
  --yellow-soft: #fff0a0;
  --green: #19c56b;
  --red: #d92d20;
  --black: #111111;
  --shadow: 0 16px 34px rgba(35, 32, 18, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dispatch-shell {
  width: min(100%, 880px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--screen);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.provider-shell,
.tracking-shell {
  width: min(100%, 440px);
  padding-bottom: 78px;
}

.dispatch-content {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dispatch-header {
  display: grid;
  gap: 8px;
  padding: 26px;
  background: var(--black);
  color: #fff;
}

.dispatch-header a {
  color: var(--yellow);
  font-weight: 900;
  text-decoration: none;
}

.dispatch-header h1,
.dispatch-header p {
  margin: 0;
}

.dispatch-header h1 {
  font-size: clamp(1.55rem, 5vw, 2.4rem);
  line-height: 1.05;
}

.dispatch-header p {
  color: #ddd4aa;
  font-size: 0.9rem;
  font-weight: 750;
}

.provider-topbar,
.tracking-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 18px;
  background: var(--paper);
}

.provider-topbar p,
.provider-topbar h1,
.tracking-topbar p,
.tracking-topbar h1,
.tracking-topbar span {
  display: block;
  margin: 0;
}

.provider-topbar p,
.tracking-topbar p {
  color: #656565;
  font-size: 0.73rem;
  font-weight: 900;
}

.provider-topbar h1,
.tracking-topbar h1 {
  margin-top: 4px;
  font-size: 1.75rem;
  line-height: 1.05;
}

.tracking-topbar span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}

.provider-avatar,
.round-back {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #f4f4f4;
  color: #111;
  text-decoration: none;
}

.provider-avatar svg,
.round-back svg {
  width: 21px;
  height: 21px;
}

.live-pill {
  display: inline-grid;
  min-height: 32px;
  align-content: center;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--yellow);
  color: #111;
  font-size: 0.72rem;
  font-weight: 950;
}

.provider-online-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 22px;
  background: var(--yellow);
  color: #111;
  font-size: 0.86rem;
  font-weight: 900;
}

.provider-online-strip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.provider-online-strip i,
.duty-pill b {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.duty-pill {
  color: #5c5100;
}

.duty-pill b {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  background: #fff;
}

.dispatch-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dispatch-card h2,
.dispatch-card h3,
.dispatch-card p {
  margin-top: 0;
}

.dispatch-card h2 {
  margin-bottom: 0;
  font-size: 1.18rem;
  line-height: 1.08;
}

.dispatch-card p {
  color: var(--muted);
  line-height: 1.42;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title-row p,
.section-title-row h2 {
  margin: 0;
}

.section-title-row p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.mini-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: #f4f4f4;
  color: #111;
}

.mini-icon svg {
  width: 21px;
  height: 21px;
}

.notice {
  border: 1px solid #f0d15a;
  border-radius: 14px;
  padding: 12px;
  background: #fff8dc;
  color: #5d5200;
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.3;
}

.tracking-alert-control {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--panel);
}

.tracking-alert-control .dispatch-button {
  width: 100%;
}

.tracking-alert-control p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.35;
}

.provider-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.provider-settings label {
  display: grid;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 900;
}

.provider-settings input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: var(--field);
  color: var(--ink);
  font-weight: 800;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.dispatch-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 0 15px;
  background: var(--yellow);
  color: #111;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 950;
  text-decoration: none;
}

.dispatch-button.secondary {
  border: 1px solid var(--line);
  background: #fffdf6;
}

.dispatch-button.dark {
  background: #111;
  color: #fff;
}

.dispatch-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.request-list {
  display: grid;
  gap: 14px;
}

.request-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(120, 93, 0, 0.14);
  border-radius: 16px;
  padding: 14px;
  background: #fffdf6;
}

.job-card-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.job-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: #fff1ad;
  color: #111;
}

.job-icon svg {
  width: 22px;
  height: 22px;
}

.job-card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.1;
}

.job-card-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.job-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eafff2;
  color: #129352;
  white-space: nowrap;
  font-size: 0.66rem;
  font-weight: 950;
}

.job-summary {
  display: grid;
  gap: 6px;
}

.job-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.32;
}

.job-summary strong {
  color: #111;
}

.request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.request-meta span {
  border-radius: 999px;
  padding: 6px 9px;
  background: #fff1ad;
  color: #3d3300;
  font-size: 0.7rem;
  font-weight: 900;
}

.request-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.request-detail {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  background: #fffaf0;
}

.request-detail.is-wide {
  grid-column: 1 / -1;
}

.request-detail dt {
  color: #76705f;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.request-detail dd {
  margin: 0;
  color: #161616;
  font-size: 0.82rem;
  font-weight: 820;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.status-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-buttons .dispatch-button {
  min-height: 36px;
  border-radius: 12px;
  font-size: 0.72rem;
}

.provider-bottom-nav {
  position: fixed;
  right: max(0px, calc((100vw - 440px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 440px) / 2));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 66px;
  border-top: 1px solid #eee0ab;
  background: rgba(255, 253, 246, 0.96);
  backdrop-filter: blur(14px);
}

.provider-bottom-nav a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #6f6f6f;
  font-size: 0.68rem;
  font-weight: 900;
  text-decoration: none;
}

.provider-bottom-nav a.is-active {
  color: #111;
}

.provider-bottom-nav svg {
  width: 19px;
  height: 19px;
}

.tracking-map-card {
  padding: 10px;
}

.tracking-map-card h2 {
  padding: 6px 6px 10px;
}

.dispatch-map {
  position: relative;
  min-height: 310px;
  border-radius: 16px;
  background:
    linear-gradient(140deg, transparent 0 46%, rgba(255, 255, 255, 0.24) 46% 51%, transparent 51%),
    #bfbfbf;
  overflow: hidden;
}

.dispatch-map .map-canvas {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 180ms ease;
}

.dispatch-map .map-canvas.is-ready {
  opacity: 1;
}

.map-message {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  border: 1px solid #f0d15a;
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 253, 246, 0.94);
  color: #181818;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.3;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.status-chip {
  display: grid;
  gap: 4px;
  border-radius: 14px;
  padding: 12px 9px;
  background: #111;
  color: #fff;
}

.status-chip span {
  color: #ddd4aa;
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
}

.status-chip strong {
  font-size: 0.86rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.status-timeline {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.status-timeline > div {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 11px;
  padding-bottom: 18px;
}

.status-timeline > div::after {
  position: absolute;
  top: 23px;
  bottom: 0;
  left: 9px;
  width: 2px;
  background: #e2dbc3;
  content: "";
}

.status-timeline > div:last-child {
  padding-bottom: 0;
}

.status-timeline > div:last-child::after {
  content: none;
}

.status-timeline span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #d8d0b5;
  border-radius: 50%;
  background: #fffdf6;
}

.status-timeline .is-complete span,
.status-timeline .is-current span {
  border-color: var(--yellow);
  background: var(--yellow);
}

.status-timeline .is-canceled span {
  border-color: var(--red);
}

.status-timeline p {
  margin: 0;
}

.status-timeline strong,
.status-timeline small {
  display: block;
}

.status-timeline strong {
  font-size: 0.9rem;
}

.status-timeline small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.detail-row {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

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

.detail-row:last-child {
  padding-bottom: 0;
}

.detail-row span {
  color: #76705f;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.detail-row strong {
  font-size: 0.92rem;
  line-height: 1.28;
}

.dispatch-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  padding: 0 22px 26px;
}

.dispatch-footer a {
  color: #4f4700;
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.legal-page {
  max-width: 760px;
}

.legal-page h2 {
  margin: 18px 0 8px;
}

.legal-page ul {
  margin: 0;
  padding-left: 20px;
  color: #666;
  line-height: 1.55;
}

.legal-page li + li {
  margin-top: 6px;
}

.legal-page a {
  color: #111;
  font-weight: 850;
}

@media (min-width: 760px) {
  .dispatch-body {
    padding: 24px 0;
  }

  .dispatch-shell {
    min-height: calc(100vh - 48px);
    border-radius: 26px;
    overflow: hidden;
  }

  .provider-shell,
  .tracking-shell {
    min-height: calc(100vh - 48px);
  }
}

@media (max-width: 560px) {
  .dispatch-content {
    padding: 14px;
  }

  .provider-settings,
  .request-detail-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .dispatch-map {
    min-height: 300px;
  }
}
