/* Zestia Delivery: action-first, light operational workspace. */
.zestia-ops-shell--rider {
  --rider-mint: #0f766e;
  --rider-mint-soft: #ecfdf8;
  --rider-blue-soft: #eef4ff;
  --rider-amber-soft: #fff8e7;
}

.zestia-ops-shell--rider .rider-command-bar {
  grid-template-columns: minmax(260px, 0.72fr) minmax(420px, 1.28fr);
  padding: 16px;
}

.zestia-ops-shell--rider .rider-command-bar h1 {
  font-size: clamp(28px, 3vw, 42px);
}

.zestia-ops-shell--rider .rider-next-action {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label action"
    "title action"
    "meta action";
  min-height: 106px;
  padding: 14px 16px;
  border-color: #b7e4d9;
  background: linear-gradient(135deg, #effcf8 0%, #f7fffd 100%);
}

.zestia-ops-shell--rider .rider-next-action > span {
  grid-area: label;
}

.zestia-ops-shell--rider .rider-next-action > strong {
  grid-area: title;
  font-size: clamp(17px, 1.5vw, 22px);
}

.zestia-ops-shell--rider .rider-next-action > small {
  grid-area: meta;
  color: #176c61;
  font-weight: 750;
}

.zestia-ops-shell--rider .rider-next-action__button {
  grid-area: action;
  align-self: center;
  border-color: var(--rider-mint);
  background: var(--rider-mint);
  color: #fff;
  white-space: nowrap;
}

.zestia-ops-shell--rider .rider-layout {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 320px);
  align-items: start;
}

.zestia-ops-shell--rider .rider-layout > .stack:first-child {
  order: 2;
  position: sticky;
  top: calc(var(--zops-header-height) + 12px);
}

.zestia-ops-shell--rider .rider-layout > .stack:nth-child(2) {
  order: 1;
}

.rider-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-left: 5px solid #5b75d6;
  background: linear-gradient(135deg, var(--rider-blue-soft), #fff);
}

.rider-feedback--success {
  border-left-color: var(--rider-mint);
  background: linear-gradient(135deg, var(--rider-mint-soft), #fff);
}

.rider-feedback--support {
  border-left-color: #d89b25;
  background: linear-gradient(135deg, var(--rider-amber-soft), #fff);
}

.rider-feedback__eyebrow {
  color: var(--zops-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.rider-feedback h2 {
  margin: 3px 0 2px;
  font-size: 18px;
}

.rider-feedback p {
  margin: 0;
  color: var(--zops-text);
  line-height: 1.42;
}

.rider-feedback__metric {
  flex: 0 0 auto;
  color: var(--rider-mint);
  font-family: var(--zops-font-data);
  font-size: 19px;
  white-space: nowrap;
}

.zestia-ops-shell--rider .rider-deliveries-panel {
  padding: 0;
  overflow: hidden;
}

.zestia-ops-shell--rider .rider-deliveries-panel > .panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--zops-line);
}

.zestia-ops-shell--rider .route-workspace {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.route-workspace__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--zops-line);
  background: #fbfcfe;
}

.route-workspace__header h3 {
  margin: 3px 0 8px;
  font-size: clamp(20px, 2vw, 28px);
}

.route-workspace__metrics,
.route-workspace__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.route-workspace__metrics span {
  padding: 5px 9px;
  border: 1px solid var(--zops-line);
  border-radius: 999px;
  background: #fff;
  color: var(--zops-muted);
  font-size: 12px;
  font-weight: 750;
}

.route-workspace__metrics strong {
  color: var(--zops-ink);
}

.route-workspace__actions {
  justify-content: flex-end;
}

.route-workspace__body {
  display: grid;
  grid-template-columns: minmax(380px, 1.28fr) minmax(340px, .72fr);
  min-height: 390px;
  max-height: min(620px, calc(100dvh - 230px));
}

.route-map-panel,
.route-itinerary {
  display: grid;
  min-width: 0;
  min-height: 0;
  margin: 0;
  background: #fff;
}

.route-map-panel {
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--zops-line);
}

.route-map-panel__bar,
.route-itinerary__header {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--zops-line);
  background: #f8fafc;
}

.route-map-panel__bar strong,
.route-itinerary__header strong {
  color: var(--zops-ink);
  font-size: 13px;
}

.route-map-panel__bar span,
.route-itinerary__header span {
  overflow: hidden;
  color: var(--zops-muted);
  font-family: var(--zops-font-data);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-itinerary {
  grid-template-rows: auto minmax(0, 1fr);
}

.route-stop-list {
  display: grid;
  align-content: start;
  gap: 0;
  margin: 0;
  padding: 8px 14px;
  list-style: none;
  background: #fff;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.route-stop {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--zops-line);
}

.route-stop:last-child {
  border-bottom: 0;
}

.route-stop.is-next {
  color: #0c5f52;
}

.route-stop__index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--zops-ink);
  color: #fff;
  font-family: var(--zops-font-data);
  font-weight: 900;
}

.route-stop.is-next .route-stop__index {
  background: var(--rider-mint);
  box-shadow: 0 0 0 5px #dff8f1;
}

.route-stop__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.route-stop__copy strong,
.route-stop__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-stop__copy small {
  color: var(--zops-muted);
}

.route-stop__actions {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.route-stop__navigate {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border: 1px solid #9fd9cc;
  border-radius: 9px;
  background: #f0fdfa;
  color: #0c6659;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.route-stop__navigate:hover {
  border-color: var(--rider-mint);
  background: #dff8f1;
}

.route-stop__navigate:focus-visible {
  outline: 3px solid #087a70;
  outline-offset: 2px;
}

.zestia-ops-shell--rider .route-map {
  width: 100%;
  height: 100%;
  min-height: 340px;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  background: #edf2f7;
}

.route-map-fallback {
  display: grid;
  min-height: 340px;
  margin: 0;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .08), transparent 52%),
    #f4f7fb;
  color: var(--zops-muted);
  font-weight: 750;
  text-align: center;
}

.route-map-fallback[hidden] {
  display: none;
}

.route-workspace__notice {
  margin: 0;
  padding: 9px 16px;
  border-top: 1px solid #f3d59a;
  background: var(--rider-amber-soft);
  color: #805313;
  font-size: 12px;
}

.zestia-ops-shell--rider .task-card {
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.zestia-ops-shell--rider .task-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 14px;
}

.rider-mobile-dock {
  display: none;
}

@media (max-width: 1080px) {
  .zestia-ops-shell--rider .rider-command-bar {
    grid-template-columns: 1fr;
  }

  .zestia-ops-shell--rider .rider-layout {
    grid-template-columns: 1fr;
  }

  .zestia-ops-shell--rider .rider-layout > .stack:first-child {
    order: 2;
    position: static;
  }

  .route-workspace__body {
    grid-template-columns: minmax(340px, 1.12fr) minmax(320px, .88fr);
  }
}

@media (max-width: 680px) {
  .zestia-ops-shell--rider .rider-command-bar {
    margin-bottom: 10px;
    padding: 11px;
    border-radius: 14px;
  }

  .zestia-ops-shell--rider .rider-command-bar__title {
    min-height: 30px;
  }

  .zestia-ops-shell--rider .rider-command-bar__title :where(.rider-command-bar__eyebrow, p) {
    display: none;
  }

  .zestia-ops-shell--rider .rider-command-bar__title h1 {
    margin: 0;
    font-size: 21px;
  }

  .zestia-ops-shell--rider .rider-next-action {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title meta"
      "action action";
    gap: 5px 10px;
    padding: 9px;
  }

  .zestia-ops-shell--rider .rider-next-action > span {
    display: none;
  }

  .zestia-ops-shell--rider .rider-next-action > small {
    align-self: center;
    text-align: right;
  }

  .zestia-ops-shell--rider .rider-next-action__button {
    width: 100%;
    min-height: 44px;
    margin-top: 2px;
    text-align: center;
  }

  .zestia-ops-shell--rider .rider-deliveries-panel > .panel-header {
    min-height: 56px;
    padding: 10px 12px;
  }

  .zestia-ops-shell--rider .rider-deliveries-panel > .panel-header .panel-sub {
    display: none;
  }

  .rider-feedback {
    align-items: flex-start;
    flex-direction: column;
  }

  .route-workspace__header {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    padding: 11px 12px;
  }

  .route-workspace__header .rider-feedback__eyebrow {
    display: none;
  }

  .route-workspace__header h3 {
    margin: 0 0 7px;
    font-size: 20px;
  }

  .route-workspace__metrics {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .route-workspace__metrics span {
    flex: 0 0 auto;
  }

  .route-workspace__actions {
    justify-content: flex-start;
  }

  .route-workspace__actions :where(.button, button) {
    width: 100%;
    text-align: center;
  }

  .route-workspace__body {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .route-stop-list {
    overflow: visible;
  }

  .route-map-panel {
    border-right: 0;
    border-bottom: 1px solid var(--zops-line);
  }

  .zestia-ops-shell--rider .route-map,
  .route-map-fallback {
    min-height: 220px;
    max-height: 240px;
  }

  .route-stop {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .route-stop__actions {
    grid-column: 2;
    grid-auto-flow: column;
    align-items: center;
    justify-content: space-between;
    justify-items: start;
  }

  .zestia-ops-shell--rider .task-meta {
    grid-template-columns: 1fr;
  }

  .rider-mobile-dock {
    position: fixed;
    z-index: 140;
    right: calc(10px + env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: calc(10px + env(safe-area-inset-left, 0px));
    display: flex;
    min-height: 60px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 8px 7px 13px;
    border: 1px solid #b7e4d9;
    border-radius: 15px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .2);
    backdrop-filter: blur(12px);
  }

  .rider-mobile-dock[hidden] {
    display: none;
  }

  .zestia-ops-shell--rider.has-rider-mobile-dock .zestia-ops-main {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .rider-mobile-dock span {
    display: grid;
  }

  .rider-mobile-dock small {
    color: var(--zops-muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
  }

  .rider-mobile-dock strong {
    font-family: var(--zops-font-data);
    font-size: 20px;
  }

  .rider-mobile-dock .button {
    min-width: 122px;
    border-color: var(--rider-mint);
    background: var(--rider-mint);
    color: #fff;
    text-align: center;
  }
}
