:root {
  --milk-ink: #09272b;
  --milk-muted: #61767a;
  --milk-line: #d4e2e2;
  --milk-canvas: #f3f8f8;
  --milk-soft: #eaf8f6;
  --milk-soft-2: #f7fbfb;
  --milk-teal: #109b8d;
  --milk-teal-dark: #07545a;
  --milk-teal-deep: #063f45;
  --milk-blue: #2878c8;
  --milk-amber: #b97813;
  --milk-danger: #b44a58;
  --milk-radius: 16px;
  --milk-shadow: 0 18px 48px rgba(11, 52, 57, .12);
}

html { background: var(--milk-canvas); }
body {
  margin: 0;
  color: var(--milk-ink);
  background:
    radial-gradient(circle at 0 0, rgba(16, 155, 141, .08), transparent 24rem),
    var(--milk-canvas);
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Shared action language */
.primary-btn, .btn-green, .wizard-editor-primary, .gps-btn {
  border: 1px solid var(--milk-teal) !important;
  background: linear-gradient(135deg, #13ad9c, #07877d) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(8, 135, 125, .18);
}
.soft-btn, .ghost-btn, .btn-secondary, .wizard-editor-secondary,
.route-map-step-btn, .route-map-full-btn, .route-map-optimize-btn {
  border: 1px solid #c8dada !important;
  background: #fff !important;
  color: var(--milk-ink) !important;
  box-shadow: none !important;
}
.primary-btn, .soft-btn, .ghost-btn, .btn, .wizard-editor-primary,
.wizard-editor-secondary, .danger-btn, .icon-btn {
  min-height: 42px;
  border-radius: 10px !important;
  font-weight: 800;
}

/* Dispatch workspace */
#milkDashboardApp .app-shell { max-width: 1600px; margin: 0 auto; padding: 18px 22px 36px; }
#milkDashboardApp .topbar { display: none; }
#milkDashboardApp .dashboard { display: grid; gap: 14px; }
#milkDashboardApp .command-panel {
  min-height: 130px;
  padding: 25px 28px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 93% -40%, rgba(132, 236, 221, .28), transparent 18rem),
    linear-gradient(115deg, var(--milk-teal-deep), #0d686c 68%, #178f87) !important;
  box-shadow: var(--milk-shadow);
}
#milkDashboardApp .command-panel .eyebrow,
#milkDashboardApp .command-panel p { color: #c9f5ef; }
#milkDashboardApp .command-panel h1 { margin: 4px 0 2px; font-size: clamp(2rem, 4vw, 3.3rem); letter-spacing: -.045em; }
#milkDashboardApp .command-panel h1 { color: #fff !important; }
#milkDashboardApp .date-tools { align-items: center; gap: 8px; }
#milkDashboardApp .date-tools .icon-btn,
#milkDashboardApp .date-tools .soft-btn { background: rgba(255,255,255,.92) !important; }
#milkDashboardApp .date-input-wrap input { min-height: 42px; border-radius: 10px; border: 1px solid rgba(255,255,255,.45); }

#milkDashboardApp .dispatch-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--milk-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(19, 63, 67, .06);
}
#milkDashboardApp .metric-card {
  min-height: 82px;
  border: 0 !important;
  border-right: 1px solid var(--milk-line) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}
#milkDashboardApp .metric-card:last-child { border-right: 0 !important; }
#milkDashboardApp .metric-card strong { font-size: 1.65rem; color: var(--milk-teal-dark); }
#milkDashboardApp .metric-card small { color: var(--milk-muted); }

#milkDashboardApp .board-card {
  border: 1px solid var(--milk-line);
  border-top: 4px solid var(--milk-teal);
  border-radius: var(--milk-radius);
  background: #fff;
  box-shadow: var(--milk-shadow);
  overflow: hidden;
}
#milkDashboardApp .board-header {
  padding: 18px 20px;
  background: linear-gradient(100deg, #e9faf7, #f4f9ff);
  border-bottom: 1px solid var(--milk-line);
}
#milkDashboardApp .board-header h2 { font-size: 1.65rem; letter-spacing: -.03em; }
#milkDashboardApp .dispatch-search { display: grid; grid-template-columns: minmax(260px, 1fr) 190px; gap: 8px; }
#milkDashboardApp .dispatch-search input,
#milkDashboardApp .dispatch-search select { min-height: 44px; border: 1px solid #c9d9da; border-radius: 10px; background: #fff; }

#milkDashboardApp .dispatch-lanes { display: block; padding: 0; }
#milkDashboardApp .route-table-head,
#milkDashboardApp .dispatch-route-card {
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) minmax(250px, 1.6fr) minmax(230px, 1fr) minmax(135px, .7fr) 22px;
  gap: 16px;
  align-items: center;
}
body[data-dashboard-ready="true"] #milkDashboardApp .dispatch-route-card {
  min-height: 86px !important;
  border-left-width: 4px !important;
  border-left-color: transparent !important;
  opacity: 1 !important;
}
body[data-dashboard-ready="true"] #milkDashboardApp .dispatch-route-card:hover { border-left-color: var(--milk-teal) !important; }
body[data-dashboard-ready="true"] #milkDashboardApp .dispatch-route-card.state-issues { border-left-color: var(--milk-danger) !important; }
#milkDashboardApp .route-table-head {
  min-height: 42px;
  padding: 0 18px;
  color: #3c6265;
  background: #edf7f6;
  border-bottom: 1px solid var(--milk-line);
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#milkDashboardApp .dispatch-route-card {
  width: 100%;
  min-height: 86px;
  padding: 12px 18px;
  border: 0;
  border-bottom: 1px solid #e2ebeb;
  border-left: 4px solid transparent;
  border-radius: 0;
  background: #fff;
  color: inherit;
  text-align: left;
  box-shadow: none;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
#milkDashboardApp .dispatch-route-card:hover { z-index: 1; border-left-color: var(--milk-teal); background: #f2fbfa; transform: translateX(2px); }
#milkDashboardApp .dispatch-route-card.state-issues { border-left-color: var(--milk-danger); }
#milkDashboardApp .route-list-identity { display: flex; align-items: center; gap: 11px; }
#milkDashboardApp .route-list-mark {
  display: grid; place-items: center; flex: 0 0 42px; height: 42px;
  border-radius: 12px; color: #06756c; background: #e3f8f4; font-size: .8rem; font-weight: 900;
}
#milkDashboardApp .route-list-identity h3 { margin: 0; font-size: 1rem; }
#milkDashboardApp .route-list-identity p { margin: 3px 0 0; color: var(--milk-muted); font-size: .85rem; }
#milkDashboardApp .route-list-next { display: block; min-width: 0; }
#milkDashboardApp .route-list-next span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#milkDashboardApp .route-list-next small { display: block; margin-bottom: 3px; color: var(--milk-muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
#milkDashboardApp .route-list-counts { display: flex; gap: 18px; }
#milkDashboardApp .route-list-counts > span { display: grid; gap: 1px; }
#milkDashboardApp .route-list-counts strong { font-size: 1rem; }
#milkDashboardApp .route-list-counts small { color: var(--milk-muted); font-size: .68rem; }
#milkDashboardApp .route-list-state { display: grid; justify-items: start; gap: 6px; }
#milkDashboardApp .route-list-state small { color: var(--milk-muted); font-size: .7rem; }
#milkDashboardApp .route-list-state .route-alert-text { color: #a33d4c; font-weight: 900; }
#milkDashboardApp .route-list-open { color: var(--milk-teal); font-size: 1.7rem; }
#milkDashboardApp .dispatch-lane-empty { padding: 46px; margin: 0; color: var(--milk-muted); text-align: center; }

/* Route editor: one operational workspace */
#milkDashboardApp .modal-backdrop { padding: 22px; background: rgba(4, 31, 34, .68); backdrop-filter: blur(8px); }
#milkDashboardApp .route-modal {
  width: min(1450px, calc(100vw - 44px));
  max-height: calc(100dvh - 44px);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.55);
  background: var(--milk-canvas);
  box-shadow: 0 28px 90px rgba(0, 20, 22, .34);
}
#milkDashboardApp #routeModal > .route-modal {
  width: min(1450px, calc(100vw - 44px));
  height: auto;
  max-height: calc(100dvh - 44px);
  border-radius: 20px;
}
#milkDashboardApp .route-modal-header {
  padding: 20px 24px;
  color: #fff;
  background: linear-gradient(115deg, var(--milk-teal-deep), #117d78);
}
#milkDashboardApp .route-modal-header h2 { color: #fff !important; }
#milkDashboardApp .route-modal-header .eyebrow,
#milkDashboardApp .route-modal-header p { color: #c9f5ef; }
#milkDashboardApp .modal-body { grid-template-columns: minmax(0, 1.65fr) minmax(340px, .75fr); gap: 12px; padding: 12px; }
#milkDashboardApp .editor-panel, #milkDashboardApp .map-panel { border: 1px solid var(--milk-line); border-radius: 14px; background: #fff; }
#milkDashboardApp .route-history-panel { margin: 12px; border: 1px solid var(--milk-line); border-radius: 12px; overflow: hidden; background: #fff; }
#milkDashboardApp .route-history-head { display: grid; gap: 2px; padding: 12px 14px; background: #ecf8f6; border-bottom: 1px solid var(--milk-line); }
#milkDashboardApp .route-history-list { display: grid; max-height: 220px; overflow: auto; }
#milkDashboardApp .route-history-item { display: grid; gap: 2px; padding: 11px 14px; border-bottom: 1px solid #e4eded; }
#milkDashboardApp .route-history-item:last-child { border-bottom: 0; }
#milkDashboardApp .route-history-item span, #milkDashboardApp .route-history-item small { color: var(--milk-muted); font-size: .72rem; }
#milkDashboardApp .route-setup-card { background: linear-gradient(105deg, #eafaf7, #f6fbff); border: 0; border-bottom: 1px solid var(--milk-line); border-radius: 13px 13px 0 0; }
#milkDashboardApp .stop-exception-field { padding: 10px; border: 1px solid #efc776; border-radius: 11px; background: #fff8e7; color: #69420b; }
#milkDashboardApp .editor-panel.is-readonly .stops-editor,
#milkDashboardApp .editor-panel.is-readonly .stops-toolbar-actions { pointer-events: none; opacity: .78; }

/* Driver Wizard */
#wizardApp { min-height: 100dvh; padding-bottom: 88px; }
#wizardApp .top-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 340px) minmax(170px, 220px);
  gap: 22px;
  align-items: center;
  max-width: 1440px;
  margin: 18px auto 0;
  padding: 22px 25px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(115deg, var(--milk-teal-deep), #0b676a 70%, #15958b);
  box-shadow: var(--milk-shadow);
}
#wizardApp .top-bar h1 { margin: 2px 0; font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -.04em; }
#wizardApp .top-bar .eyebrow, #wizardApp .top-bar .muted { color: #c9f5ef; }
#wizardApp .sync-indicator { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.13); color: #fff; }
#wizardApp .stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
#wizardApp .stat-chip {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 11px;
  color: #dcefed;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  font-size: .63rem;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}
#wizardApp .stat-chip strong {
  color: #fff;
  font-size: 1.28rem;
  line-height: 1;
}
#wizardApp .stat-chip.is-pending strong { color: #ffd166; }
#wizardApp .stat-chip.is-in-route {
  border-color: rgba(255, 128, 119, .55);
  background: rgba(176, 26, 26, .22);
}
#wizardApp .stat-chip.is-in-route strong { color: #ffaaa2; }
#wizardApp .stat-chip.is-in-route.has-active {
  animation: milk-in-route-chip-pulse 1.05s ease-in-out infinite alternate;
}
#wizardApp .stat-chip.is-complete strong { color: #6de0b5; }
#wizardApp .stat-chip.is-rts strong { color: #ff9e96; }
#wizardApp .top-actions { display: grid; }
#wizardApp .map-view-primary {
  width: 100%;
  min-height: 54px;
  color: #073e3b;
  background: linear-gradient(135deg, #ffffff, #d9f7f1);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: 0 9px 24px rgba(2, 28, 34, .2);
}
#wizardApp .add-stop-primary {
  width: 100%;
  min-height: 54px;
  color: #fff;
  background: linear-gradient(135deg, #13b59f, #079082);
  border: 1px solid rgba(126, 244, 226, .62);
  box-shadow: 0 9px 24px rgba(2, 28, 34, .24);
}
#wizardApp .add-stop-primary:hover {
  background: linear-gradient(135deg, #19c3ab, #07877b);
}
.route-state-banner {
  max-width: 1440px; margin: 10px auto 0; padding: 16px 20px;
  border: 1px solid #b7dcd6; border-radius: 14px; background: #e8f7f2; color: #174e49;
}
.route-state-banner div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.route-state-banner p { margin: 0; }
.route-state-banner span { color: #54726f; }
#wizardMain { max-width: 1440px; margin: 12px auto 0; padding: 0; }
#wizardApp .route-workspace { display: block; }
#wizardApp .active-stop-panel {
  border: 1px solid var(--milk-line);
  border-top: 4px solid var(--stop-color, var(--milk-teal));
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--milk-shadow);
  overflow: hidden;
}
#wizardApp .selected-stop-head {
  padding: 20px 22px;
  color: var(--stop-ink, var(--milk-ink));
  background: linear-gradient(105deg, var(--stop-soft, var(--milk-soft)), #f7fbff);
  border-bottom: 1px solid var(--milk-line);
}
#wizardApp .selected-stop-head > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: start;
  column-gap: 10px;
}
#wizardApp .selected-stop-head > div > .eyebrow {
  grid-column: 1 / -1;
}
body #wizardApp .selected-stop-head .eyebrow {
  color: var(--stop-ink, var(--milk-teal)) !important;
}
body #wizardApp .selected-stop-head h2 {
  color: var(--milk-ink) !important;
}
body #wizardApp .selected-stop-guide {
  color: var(--milk-muted) !important;
}
body #wizardApp .next-stop-hint {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  margin: 2px 0 0;
  padding: 0 10px;
  color: var(--stop-ink, var(--milk-teal)) !important;
  background: #fff;
  border: 1px solid #c7e1dd;
  border-radius: 999px;
}
body #wizardApp .next-stop-hint.is-in-route {
  color: #aa211e !important;
  background: #ffe2df;
  border-color: #eeaaa4;
  animation: milk-in-route-chip-pulse 1.05s ease-in-out infinite alternate;
}
#wizardApp .selected-stop-nav {
  background: rgba(255, 255, 255, .72);
  border-color: color-mix(in srgb, var(--stop-color, var(--milk-teal)) 28%, white);
  box-shadow: 0 8px 20px rgba(11, 61, 66, .08);
}
body #wizardApp .selected-stop-nav strong {
  color: var(--milk-ink) !important;
}
#wizardApp .stops-container { padding: 18px; }
body #wizardApp .stop-exception-field {
  display: grid; gap: 5px; flex: 1 1 250px; padding: 10px; border: 1px solid #efc776;
  border-radius: 12px; background: #fff8e7; color: #69420b; font-size: .75rem; font-weight: 900;
}
body #wizardApp .stop-exception-select { min-height: 40px; border: 1px solid #dfbd79; border-radius: 9px; background: #fff; }
body #wizardApp .stop-evidence-bar {
  display: flex; align-items: center; flex: 1 1 100%; gap: 8px; flex-wrap: wrap; padding: 10px 0 0;
  border-top: 1px solid var(--milk-line); color: var(--milk-muted); font-size: .75rem;
}
body #wizardApp .stop-evidence-upload, body #wizardApp .stop-evidence-link {
  min-height: 36px; padding: 0 11px; border: 1px solid #bcd8d5; border-radius: 9px; background: #fff;
  color: #075e58; font-weight: 900;
}
body #wizardApp .stop-evidence-upload { margin-left: auto; background: #e8f8f5; }
body #wizardApp .bottom-bar {
  position: fixed !important; left: 50vw !important; right: auto !important; bottom: 16px !important; z-index: 30; transform: translateX(-50%) !important;
  width: min(760px, calc(100% - 32px)); padding: 10px 12px; border: 1px solid var(--milk-line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-radius: 15px; background: rgba(255,255,255,.96); box-shadow: 0 16px 42px rgba(5,45,49,.2); backdrop-filter: blur(12px);
}
#wizardApp .route-finish-status {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: var(--milk-ink);
}
#wizardApp .route-finish-status strong {
  font-size: .82rem;
}
#wizardApp .route-finish-status span {
  color: var(--milk-muted);
  font-size: .72rem;
  font-weight: 750;
}
#wizardApp #finishRouteBtn {
  min-width: 190px;
  min-height: 48px;
  padding-inline: 22px;
}
#wizardApp #finishRouteBtn:disabled {
  opacity: 1;
  color: #60777a;
  background: #dce9e7;
  border: 1px solid #c3d8d5;
  box-shadow: none;
}
#wizardApp .route-list-panel, #wizardApp .wizard-route-editor, #wizardApp .wizard-stop-editor, #wizardApp .route-map-shell {
  border-radius: 20px; border: 1px solid rgba(255,255,255,.55); box-shadow: 0 26px 80px rgba(0,30,33,.3);
}
#wizardApp .wizard-editor-head, #wizardApp .route-map-head { color: #fff; background: linear-gradient(115deg, var(--milk-teal-deep), #117d78); }
#wizardApp .wizard-editor-head h2,
#wizardApp .route-map-head h2 { color: #fff !important; }
#wizardApp .wizard-editor-head .eyebrow, #wizardApp .wizard-editor-head p,
#wizardApp .route-map-head .eyebrow, #wizardApp .route-map-head p { color: #c9f5ef; }
#wizardApp .wizard-editor-head p:last-child,
#wizardApp .route-map-head p:last-child { color: #c9f5ef !important; }
.milk-route-locked select, .milk-route-locked textarea, .milk-route-locked input { pointer-events: none; }

/* Milk landing/public pages */
#menuView .hero, .milk-form-shell .form-hero, .public-route-shell .public-route-hero {
  border-radius: 20px !important;
  background: linear-gradient(115deg, var(--milk-teal-deep), #117d78) !important;
  box-shadow: var(--milk-shadow);
}

@media (max-width: 980px) {
  #milkDashboardApp .app-shell { padding: 10px; }
  #milkDashboardApp .command-panel { align-items: stretch; padding: 20px; }
  #milkDashboardApp .date-tools { width: 100%; overflow-x: auto; padding-bottom: 3px; }
  #milkDashboardApp .dispatch-metrics { grid-template-columns: repeat(3, 1fr); }
  #milkDashboardApp .metric-card:nth-child(3) { border-right: 0 !important; }
  #milkDashboardApp .route-table-head { display: none; }
  #milkDashboardApp .dispatch-route-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    padding: 14px;
  }
  #milkDashboardApp .route-list-next { grid-column: 1 / -1; grid-row: 2; }
  #milkDashboardApp .route-list-counts { grid-column: 1; grid-row: 3; }
  #milkDashboardApp .route-list-state { grid-column: 2; grid-row: 1; justify-items: end; }
  #milkDashboardApp .route-list-open { grid-column: 2; grid-row: 3; justify-self: end; }
  #milkDashboardApp .modal-body { grid-template-columns: 1fr; }
  #milkDashboardApp .map-panel { min-height: 380px; }
  #wizardApp .top-bar { margin: 10px; grid-template-columns: 1fr; gap: 12px; }
  #wizardMain, .route-state-banner { margin-left: 10px; margin-right: 10px; }
  #wizardApp .top-actions > * { flex: 1; }
}

@media (max-width: 640px) {
  #milkDashboardApp .command-panel { min-height: 0; border-radius: 16px; }
  #milkDashboardApp .command-panel h1 { font-size: 2rem; }
  #milkDashboardApp .date-tools { display: grid; grid-template-columns: 42px 1fr 42px; }
  #milkDashboardApp .date-tools .soft-btn, #milkDashboardApp .date-tools .primary-btn { grid-column: span 1; }
  #milkDashboardApp .dispatch-metrics { grid-template-columns: repeat(2, 1fr); }
  #milkDashboardApp .metric-card:nth-child(odd) { border-right: 1px solid var(--milk-line) !important; }
  #milkDashboardApp .metric-card:nth-child(even) { border-right: 0 !important; }
  #milkDashboardApp .board-header { align-items: stretch; }
  #milkDashboardApp .dispatch-search { grid-template-columns: 1fr; }
  #milkDashboardApp .route-list-next { font-size: .82rem; }
  #milkDashboardApp .route-list-counts { gap: 12px; }
  #milkDashboardApp .modal-backdrop { padding: 0; }
  #milkDashboardApp .route-modal { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  #milkDashboardApp #routeModal > .route-modal { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  #milkDashboardApp .modal-body { padding: 7px; }
  #milkDashboardApp .map-panel { display: none; }
  #wizardApp { padding-bottom: 76px; }
  #wizardApp .top-bar { padding: 18px; border-radius: 16px; }
  #wizardApp .stats { overflow-x: auto; }
  #wizardApp .selected-stop-head { padding: 16px; }
  #wizardApp .stops-container { padding: 10px; }
  body #wizardApp .bottom-bar {
    bottom: 8px !important;
    width: calc(100% - 16px) !important;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  #wizardApp #finishRouteBtn { width: 100%; min-width: 0; }
  .route-state-banner div { display: grid; gap: 4px; }
}

/* Wizard card-list flow */
#wizardApp .selected-stop-head {
  align-items: center;
  padding: 12px 16px;
}

#wizardApp .selected-stop-nav {
  display: none !important;
}

#wizardApp .next-stop-hint {
  margin-top: 2px;
}

#wizardApp .stops-container {
  display: grid;
  gap: 10px;
  overflow: visible;
  padding: 12px;
  background: #f3f9f8;
}

#wizardApp .stop-card {
  min-height: 0;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid color-mix(in srgb, var(--stop-color) 30%, var(--milk-line)) !important;
  border-radius: 14px !important;
  box-shadow: 0 7px 20px color-mix(in srgb, var(--stop-color) 10%, transparent) !important;
  transform: none;
}

body #wizardApp .stop-card {
  transform: none !important;
}

#wizardApp .stop-card-hero {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
}

#wizardApp .stop-sequence-badge {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  font-size: .9rem;
}

#wizardApp .stop-title {
  margin: 1px 0 7px;
  font-size: 1.05rem;
}

#wizardApp .pill {
  padding: 4px 8px;
  font-size: .68rem;
}

#wizardApp .address {
  margin-top: 9px;
  padding: 8px 10px;
  font-size: .76rem;
}

#wizardApp .card-actions {
  gap: 7px;
  padding: 10px;
}

#wizardApp .stop-card.is-active {
  border-color: var(--stop-color) !important;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--stop-color) 17%, transparent) !important;
}

#wizardApp .stops-container {
  display: grid;
  gap: 0;
  padding: 6px;
  overflow: hidden;
  background: #f7fcfb;
  border: 1px solid #aee0d8;
  border-radius: 14px;
}

#wizardApp .stop-card.stop-list-card,
body #wizardApp .stop-card.stop-list-card {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(76px, 110px) minmax(0, 1fr) auto 18px;
  grid-template-areas:
    "btr company position arrow"
    "btr location location arrow";
  align-items: center;
  column-gap: 14px;
  row-gap: 3px;
  margin: 0;
  padding: 10px 12px !important;
  color: #092d31 !important;
  text-align: left;
  background: #ffffff !important;
  border: 0 !important;
  border-bottom: 1px solid #d3e7e3 !important;
  border-left: 4px solid #59c9b7 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: pointer;
  font: inherit;
}

#wizardApp .stop-card.stop-list-card:first-child {
  border-radius: 10px 10px 0 0 !important;
}

#wizardApp .stop-card.stop-list-card:last-child {
  border-bottom: 0 !important;
  border-radius: 0 0 10px 10px !important;
}

#wizardApp .stop-card.stop-list-card:only-child {
  border-radius: 10px !important;
}

#wizardApp .stop-card.stop-list-card[data-dsp="DWDL"] {
  --dsp-card-accent: #2878d4;
  --dsp-card-soft: #eaf3ff;
  --dsp-card-ink: #174e91;
  border-left-color: var(--dsp-card-accent) !important;
}

#wizardApp .stop-card.stop-list-card[data-dsp="WGAT"] {
  --dsp-card-accent: #e54892;
  --dsp-card-soft: #fff0f7;
  --dsp-card-ink: #9e235c;
  border-left-color: var(--dsp-card-accent) !important;
}

#wizardApp .stop-card.stop-list-card[data-dsp="INZL"] {
  --dsp-card-accent: #76502f;
  --dsp-card-soft: #f7eee6;
  --dsp-card-ink: #4f321c;
  border-left-color: var(--dsp-card-accent) !important;
}

#wizardApp .stop-card.stop-list-card[data-dsp="AMZL"] { --dsp-card-accent: #f59e0b; --dsp-card-soft: #fff5dc; --dsp-card-ink: #8a5300; border-left-color: var(--dsp-card-accent) !important; }
#wizardApp .stop-card.stop-list-card[data-dsp="AMXL"] { --dsp-card-accent: #1683a8; --dsp-card-soft: #e8f7fb; --dsp-card-ink: #0b5d78; border-left-color: var(--dsp-card-accent) !important; }
#wizardApp .stop-card.stop-list-card[data-dsp="APLX"] { --dsp-card-accent: #7c3aed; --dsp-card-soft: #f1ebff; --dsp-card-ink: #5422a7; border-left-color: var(--dsp-card-accent) !important; }
#wizardApp .stop-card.stop-list-card[data-dsp="LBAL"] { --dsp-card-accent: #0f9f8f; --dsp-card-soft: #e7f8f5; --dsp-card-ink: #076b60; border-left-color: var(--dsp-card-accent) !important; }
#wizardApp .stop-card.stop-list-card[data-dsp="FLSH"] { --dsp-card-accent: #e15845; --dsp-card-soft: #fff0ed; --dsp-card-ink: #9e3326; border-left-color: var(--dsp-card-accent) !important; }
#wizardApp .stop-card.stop-list-card[data-dsp="LBA"] { --dsp-card-accent: #748522; --dsp-card-soft: #f2f6df; --dsp-card-ink: #4c5a13; border-left-color: var(--dsp-card-accent) !important; }
#wizardApp .stop-card.stop-list-card[data-dsp="D2D"] { --dsp-card-accent: #5369b5; --dsp-card-soft: #eef1ff; --dsp-card-ink: #34468d; border-left-color: var(--dsp-card-accent) !important; }

#wizardApp .stop-card.stop-list-card[data-dsp="DWDL"] .stop-list-btr,
#wizardApp .stop-card.stop-list-card[data-dsp="WGAT"] .stop-list-btr,
#wizardApp .stop-card.stop-list-card[data-dsp="INZL"] .stop-list-btr,
#wizardApp .stop-card.stop-list-card[data-dsp="AMZL"] .stop-list-btr,
#wizardApp .stop-card.stop-list-card[data-dsp="AMXL"] .stop-list-btr,
#wizardApp .stop-card.stop-list-card[data-dsp="APLX"] .stop-list-btr,
#wizardApp .stop-card.stop-list-card[data-dsp="LBAL"] .stop-list-btr,
#wizardApp .stop-card.stop-list-card[data-dsp="FLSH"] .stop-list-btr,
#wizardApp .stop-card.stop-list-card[data-dsp="LBA"] .stop-list-btr,
#wizardApp .stop-card.stop-list-card[data-dsp="D2D"] .stop-list-btr {
  color: var(--dsp-card-ink);
  border-color: color-mix(in srgb, var(--dsp-card-accent) 35%, white);
  background: var(--dsp-card-soft);
}

#wizardApp .stop-card.stop-list-card[data-dsp] .stop-list-company,
.stop-quick-modal[data-dsp] .stop-quick-head h2,
.stop-quick-modal[data-dsp] .stop-quick-head .eyebrow {
  color: var(--dsp-card-ink, #102b31);
}

.stop-quick-modal[data-dsp] .stop-quick-card {
  border-top: 6px solid var(--dsp-card-accent, #0f9f8f);
}

.stop-quick-modal[data-dsp="DWDL"] { --dsp-card-accent: #2878d4; --dsp-card-ink: #174e91; }
.stop-quick-modal[data-dsp="WGAT"] { --dsp-card-accent: #e54892; --dsp-card-ink: #9e235c; }
.stop-quick-modal[data-dsp="INZL"] { --dsp-card-accent: #76502f; --dsp-card-ink: #4f321c; }
.stop-quick-modal[data-dsp="AMZL"] { --dsp-card-accent: #f59e0b; --dsp-card-ink: #8a5300; }
.stop-quick-modal[data-dsp="AMXL"] { --dsp-card-accent: #1683a8; --dsp-card-ink: #0b5d78; }
.stop-quick-modal[data-dsp="APLX"] { --dsp-card-accent: #7c3aed; --dsp-card-ink: #5422a7; }
.stop-quick-modal[data-dsp="LBAL"] { --dsp-card-accent: #0f9f8f; --dsp-card-ink: #076b60; }
.stop-quick-modal[data-dsp="FLSH"] { --dsp-card-accent: #e15845; --dsp-card-ink: #9e3326; }
.stop-quick-modal[data-dsp="LBA"] { --dsp-card-accent: #748522; --dsp-card-ink: #4c5a13; }
.stop-quick-modal[data-dsp="D2D"] { --dsp-card-accent: #5369b5; --dsp-card-ink: #34468d; }

#wizardApp .stop-card.stop-list-card:hover,
#wizardApp .stop-card.stop-list-card:focus-visible,
#wizardApp .stop-card.stop-list-card.is-active {
  background: #effbf8 !important;
  border-left-color: #079b88 !important;
  box-shadow: none !important;
}

#wizardApp .stop-list-btr {
  grid-area: btr;
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 0 9px;
  color: #087164;
  background: #e8f8f5;
  border: 1px solid #b8e4dc;
  border-radius: 9px;
  font-size: .72rem;
  font-weight: 950;
  white-space: nowrap;
}

#wizardApp .stop-list-company {
  grid-area: company;
  min-width: 0;
  overflow: hidden;
  color: #102b31;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .95rem;
}

#wizardApp .stop-list-location {
  grid-area: location;
  min-width: 0;
  overflow: hidden;
  color: #647b80;
  font-size: .7rem;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#wizardApp .stop-list-position {
  grid-area: position;
  color: #527076;
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}

#wizardApp .stop-card.stop-list-card.is-in_route,
body #wizardApp .stop-card.stop-list-card.is-in_route {
  background: #fff1f0 !important;
  border-left-color: #d93632 !important;
  box-shadow: inset 0 0 0 1px rgba(217, 54, 50, .16) !important;
  animation: milk-in-route-row-pulse 1.05s ease-in-out infinite alternate;
}

#wizardApp .stop-card.stop-list-card.is-in_route .stop-list-btr {
  color: #a9201d;
  background: #ffe2df;
  border-color: #f1aaa4;
}

#wizardApp .stop-card.stop-list-card.is-in_route .stop-list-position,
#wizardApp .stop-card.stop-list-card.is-in_route .stop-list-arrow {
  color: #bd2723;
}

@keyframes milk-in-route-row-pulse {
  from { filter: drop-shadow(0 0 0 rgba(217, 54, 50, 0)); }
  to { filter: drop-shadow(0 0 8px rgba(217, 54, 50, .48)); }
}

@keyframes milk-in-route-chip-pulse {
  from { box-shadow: 0 0 0 rgba(255, 112, 103, 0); }
  to { box-shadow: 0 0 18px rgba(255, 112, 103, .48); }
}

@media (prefers-reduced-motion: reduce) {
  #wizardApp .stat-chip.is-in-route.has-active,
  body #wizardApp .next-stop-hint.is-in-route,
  #wizardApp .stop-card.stop-list-card.is-in_route {
    animation: none;
  }
}

#wizardApp .stop-list-arrow {
  grid-area: arrow;
  color: #08796d;
  font-size: 1.1rem;
  font-weight: 950;
}

#wizardApp .empty {
  display: grid;
  gap: 12px;
  margin: 12px;
  padding: 18px;
  box-shadow: none;
}

#wizardApp .empty p {
  margin: 0;
}

#wizardApp .empty-route-action {
  min-height: 44px;
  color: #fff;
  background: linear-gradient(135deg, #08766b, #11aa96);
  border-radius: 10px;
}

.wizard-address-field {
  position: relative;
}

.wizard-address-status {
  display: block;
  padding: 6px 8px;
  color: #8a4f07;
  background: #fff7df;
  border: 1px solid #efcf88;
  border-radius: 8px;
  font-size: .66rem;
  font-weight: 850;
  line-height: 1.3;
  text-transform: none;
}

.wizard-address-status[data-state="confirmed"] {
  color: #08634f;
  background: #e8faf4;
  border-color: #9edfcf;
}

.wizard-address-status[data-state="error"] {
  color: #9f2737;
  background: #fff0f1;
  border-color: #edb1ba;
}

.wizard-address-field input[aria-invalid="true"] {
  border-color: #d99a2b !important;
  box-shadow: 0 0 0 3px rgba(217, 154, 43, .12) !important;
}

.wizard-address-field input[aria-invalid="false"] {
  border-color: #50bba6 !important;
  box-shadow: 0 0 0 3px rgba(32, 164, 139, .11) !important;
}

#wizardApp .wizard-editor-danger[data-armed="true"] {
  color: #fff !important;
  background: #b42336 !important;
  border-color: #8d1728 !important;
  box-shadow: 0 8px 20px rgba(180, 35, 54, .22);
}

.pac-container {
  z-index: 10050 !important;
  border: 1px solid #a9d7d0 !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 46px rgba(5, 44, 49, .22) !important;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
}

@media (max-width: 700px) {
  body #wizardApp {
    min-height: 0;
    padding-bottom: 0;
  }

  body #wizardApp .top-bar {
    position: static !important;
    margin-bottom: 14px !important;
  }

  body #wizardApp #wizardMain {
    margin-top: 0 !important;
  }

  #wizardApp .selected-stop-head {
    padding: 13px;
  }

  #wizardApp .stops-container {
    gap: 0;
    padding: 5px;
  }

  #wizardApp .stop-card.stop-list-card,
  body #wizardApp .stop-card.stop-list-card {
    grid-template-columns: minmax(68px, 86px) minmax(0, 1fr) auto 12px;
    column-gap: 9px;
    row-gap: 3px;
    min-height: 66px;
    padding: 8px 9px !important;
  }

  #wizardApp .stop-card-hero {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px;
  }

  #wizardApp .stop-sequence-badge {
    width: 42px;
    height: 42px;
    border-radius: 11px;
  }

  #wizardApp .stop-title {
    font-size: .94rem;
  }

  #wizardApp .card-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 8px;
  }

  #wizardApp .card-action-label,
  #wizardApp .stop-evidence-bar,
  #wizardApp .stop-exception-field {
    grid-column: 1 / -1;
  }

  body #wizardApp .bottom-bar {
    position: sticky !important;
    left: auto !important;
    right: auto !important;
    bottom: 0 !important;
    width: auto !important;
    margin: 10px 8px 8px !important;
    transform: none !important;
  }
}

/* Modern, compact stop editor */
#wizardApp .wizard-stop-editor {
  width: min(720px, calc(100vw - 28px));
  max-height: min(860px, calc(100dvh - 28px));
  background:
    radial-gradient(circle at 100% 0, rgba(37, 190, 169, .12), transparent 260px),
    #f3f9f8;
  border: 1px solid rgba(122, 188, 180, .72);
  border-top: 0;
  border-radius: 22px;
}

#wizardApp .wizard-stop-editor .wizard-editor-head {
  position: relative;
  padding: 18px 20px 17px;
  background:
    radial-gradient(circle at 88% 0, rgba(63, 207, 184, .24), transparent 210px),
    linear-gradient(120deg, #064d4b, #087d73);
  border-bottom: 0;
}

#wizardApp .wizard-stop-editor .wizard-editor-head::after {
  content: "";
  position: absolute;
  right: 76px;
  bottom: -1px;
  width: 92px;
  height: 1px;
  background: rgba(255, 255, 255, .36);
}

#wizardApp .wizard-stop-editor .wizard-editor-head .eyebrow {
  margin-bottom: 5px;
  color: #73ead8 !important;
  font-size: .67rem;
  letter-spacing: .08em;
}

#wizardApp .wizard-stop-editor .wizard-editor-head h2 {
  font-size: clamp(1.35rem, 4vw, 1.7rem) !important;
  letter-spacing: -.02em;
}

#wizardApp .wizard-stop-editor .wizard-editor-head p:last-child {
  max-width: 430px;
  margin-top: 6px;
  color: rgba(232, 255, 251, .82) !important;
  font-size: .76rem;
  line-height: 1.35;
}

#wizardApp .wizard-stop-editor .wizard-editor-close {
  width: 44px;
  height: 44px;
  color: #fff !important;
  background: rgba(255, 255, 255, .14) !important;
  border-color: rgba(255, 255, 255, .3) !important;
  border-radius: 13px !important;
  backdrop-filter: blur(8px);
}

#wizardApp .wizard-stop-editor .wizard-editor-close:hover {
  background: rgba(255, 255, 255, .23) !important;
}

#wizardApp .wizard-stop-fields {
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: 16px 18px 18px;
  overscroll-behavior: contain;
}

#wizardApp .wizard-stop-fields label {
  position: relative;
  gap: 7px;
  padding: 10px;
  color: #176c65;
  background: rgba(255, 255, 255, .9);
  border: 1px solid #d1e5e2;
  border-radius: 13px;
  box-shadow: 0 5px 18px rgba(18, 78, 75, .045);
}

#wizardApp .wizard-stop-fields label[hidden] {
  display: none !important;
}

#wizardApp .wizard-stop-fields label > span:first-child {
  padding-inline: 2px;
  font-size: .66rem;
  letter-spacing: .055em;
}

#wizardApp .wizard-stop-fields input,
#wizardApp .wizard-stop-fields select,
#wizardApp .wizard-stop-fields textarea,
#wizardApp .wizard-stop-fields .wizard-check-row {
  min-height: 46px;
  color: #102a2d !important;
  background: #f8fbfb !important;
  border: 1px solid #bfd9d6 !important;
  border-radius: 10px !important;
  font-size: .9rem;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

#wizardApp .wizard-stop-fields input:focus,
#wizardApp .wizard-stop-fields select:focus,
#wizardApp .wizard-stop-fields textarea:focus {
  outline: none;
  background: #fff !important;
  border-color: #20aa99 !important;
  box-shadow: 0 0 0 3px rgba(32, 170, 153, .14) !important;
}

#wizardApp .wizard-stop-fields .wizard-field-wide,
#wizardApp .wizard-stop-fields .wizard-field-type,
#wizardApp .wizard-stop-fields .wizard-address-field,
#wizardApp .wizard-stop-fields .wizard-field-notes,
#wizardApp .wizard-stop-fields #wizardStopRecipientField {
  grid-column: 1 / -1;
}

#wizardApp .wizard-stop-fields .wizard-address-field {
  padding: 11px;
  background: linear-gradient(135deg, #effbf8, #fff);
  border-color: #a9dcd4;
}

#wizardApp .wizard-stop-fields .wizard-address-status {
  margin-top: 1px;
  padding: 7px 9px;
  border-radius: 9px;
}

#wizardApp .wizard-stop-fields .wizard-check-row {
  padding: 0 12px;
  background: #f8fbfb !important;
}

#wizardApp .wizard-stop-fields .wizard-check-row input {
  width: 20px;
  min-height: 20px;
  accent-color: #0a9485;
  box-shadow: none !important;
}

#wizardApp .wizard-stop-fields textarea {
  min-height: 74px;
  padding: 11px 12px;
}

#wizardApp .wizard-stop-editor .wizard-stop-actions {
  position: relative;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  border-top-color: #cfe2df;
  box-shadow: 0 -10px 30px rgba(15, 67, 65, .07);
  backdrop-filter: blur(12px);
}

#wizardApp .wizard-stop-editor .wizard-stop-actions button {
  min-height: 46px;
  border-radius: 11px !important;
}

#wizardApp .wizard-stop-editor #wizardDoneStopBtn {
  min-width: 150px;
  box-shadow: 0 8px 20px rgba(8, 129, 116, .2) !important;
}

#wizardApp .wizard-stop-editor #wizardDoneStopBtn:disabled {
  color: #708482 !important;
  background: #dce9e7 !important;
  border-color: #c9dcda !important;
  box-shadow: none !important;
}

@media (max-width: 700px) {
  #wizardApp .wizard-stop-editor {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  #wizardApp .wizard-stop-editor .wizard-editor-head {
    flex: 0 0 auto;
    padding: max(14px, env(safe-area-inset-top)) 15px 14px;
  }

  #wizardApp .wizard-stop-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 12px;
  }

  #wizardApp .wizard-stop-fields label {
    gap: 5px;
    padding: 8px;
    border-radius: 11px;
  }

  #wizardApp .wizard-stop-fields input,
  #wizardApp .wizard-stop-fields select,
  #wizardApp .wizard-stop-fields .wizard-check-row {
    min-height: 44px;
  }

  #wizardApp .wizard-stop-editor .wizard-stop-actions {
    flex: 0 0 auto;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }

  #wizardApp .wizard-stop-editor #wizardDoneStopBtn {
    min-width: min(46vw, 190px);
  }
}

@media (max-width: 370px) {
  #wizardApp .wizard-stop-fields {
    grid-template-columns: 1fr;
  }

  #wizardApp .wizard-stop-fields .wizard-field-wide,
  #wizardApp .wizard-stop-fields .wizard-field-type,
  #wizardApp .wizard-stop-fields .wizard-address-field,
  #wizardApp .wizard-stop-fields .wizard-field-notes,
  #wizardApp .wizard-stop-fields #wizardStopRecipientField {
    grid-column: auto;
  }
}
