/* Distinct kitchen stages on the delivery map. The urgency ring never replaces the status color. */
.delivery-house-legend--preparing,
.delivery-map-pin.is-preparing .delivery-house {
  border-color: #aa4010 !important;
  background: #d9571e !important;
  color: #fff !important;
}
.delivery-map-pin.is-urgent .delivery-house {
  outline: 3px solid #d92e43;
  outline-offset: 2px;
}
.delivery-map-pin.is-urgent:not(.is-preparing):not(.is-in-kitchen):not(.is-on-the-way) .delivery-house {
  border-color: #247eb7 !important;
  background: #fff !important;
  color: #247eb7 !important;
}
.delivery-map-pin.is-urgent.is-on-the-way .delivery-house {
  border-color: #fff !important;
  background: #1688db !important;
  color: #fff !important;
}
.delivery-map-pin.trip-pin.is-selected .delivery-house {
  border-color: #8b43bb !important;
  background: #8b43bb !important;
  color: #fff !important;
}

/* The kitchen clock stays visible above the live production totals. */
#kitchenPortal .kitchen-dashboard-header {
  grid-template-areas: "brand clock" "heading stats" "connection stats";
  column-gap: 20px;
  row-gap: 8px;
}
#kitchenPortal .kitchen-dashboard-header > .role-brand { grid-area: brand; }
#kitchenPortal .kitchen-dashboard-header > h1 { grid-area: heading; }
#kitchenPortal .kitchen-dashboard-header > #kitchenConnection { grid-area: connection; }
#kitchenPortal .kitchen-dashboard-header > .kitchen-live-stats { grid-area: stats; }
.kitchen-live-clock {
  grid-area: clock;
  justify-self: end;
  align-self: start;
  padding: 10px 18px;
  border: 1px solid #bbdce9;
  border-radius: 12px;
  background: #eaf7fc;
  color: #124b69;
  font-size: clamp(29px, 3.4vw, 44px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  white-space: nowrap;
}
.kitchen-live-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 0; }
.kitchen-live-stats article { min-width: 0; height: auto; align-content: start; }
.kitchen-live-stats article span,
.kitchen-live-stats article small { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }

/* One aligned row of day controls; only narrow phones stack them. */
#workdayBar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); align-items: center; }
#workdayBar .workday-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; width: 100%; }
#workdayBar .workday-actions button { width: 100%; min-width: 0; min-height: 52px; padding: 9px 11px; line-height: 1.2; white-space: normal; text-align: center; }

/* Slightly denser operational cards, with address, rider and payment kept visible. */
.delivery-board .dispatch-card { margin-top: 9px; padding: 12px 13px; }
.delivery-board .dispatch-top { gap: 6px 8px; }
.delivery-board .dispatch-top > strong { font-size: 18px; }
.delivery-board .dispatch-card h2 { margin: 8px 0 4px; font-size: 16px; line-height: 1.3; }
.delivery-board .dispatch-card > p { margin: 5px 0; line-height: 1.35; }
.delivery-board .dispatch-card > p:empty,
.delivery-board .dispatch-card > ul:empty { display: none; }
.delivery-board .dispatch-card ul { margin: 6px 0; padding-left: 18px; line-height: 1.45; }
.delivery-board .dispatch-card li { margin: 2px 0; }
.delivery-board .dispatch-schedule { gap: 5px; }
.delivery-board .dispatch-schedule-row { padding: 6px 9px; }
.delivery-board .dispatch-schedule-row > strong { font-size: 20px; }
.delivery-board .dispatch-rider-banner { margin: 8px 0; padding: 8px 10px; }
.delivery-board .dispatch-payment-banner { margin: 8px 0; padding: 9px 11px; }
.delivery-board .dispatch-meta { padding: 4px 0; gap: 6px; }
.delivery-board .dispatch-buttons { gap: 7px; margin-top: 6px; }
.delivery-board .dispatch-buttons button { min-height: 40px; padding: 8px 10px; }
.start-work-dialog .start-work-optional { margin: 9px 0 0; font-size: 12px; }

@media (max-width: 1000px) {
  #kitchenPortal .kitchen-dashboard-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand clock" "heading heading" "connection connection" "stats stats";
  }
}
@media (max-width: 1180px) {
  #workdayBar { grid-template-columns: minmax(0, 1fr); }
  .kitchen-live-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .kitchen-live-clock { padding: 7px 9px; font-size: 25px; }
  #workdayBar .workday-actions { grid-template-columns: minmax(0, 1fr); }
}
