.route-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
.route-status { color: #566d65; font-size: .85rem; }
.tool-btn, .mini-btn {
  appearance: none;
  border: 1px solid rgba(9,37,31,.2);
  border-radius: 999px;
  background: white;
  color: #09251f;
  cursor: pointer;
  font: 800 .82rem/1.2 inherit;
  padding: 9px 13px;
}
.tool-btn:hover, .tool-btn:focus-visible, .mini-btn:hover, .mini-btn:focus-visible {
  border-color: #15614b;
  outline: 3px solid rgba(21,97,75,.14);
}
.map-wrap { min-width: 0; }
.route-map.real-map {
  min-height: 520px;
  background: #dfe7d8;
  color: #09251f;
  z-index: 1;
}
.route-map.real-map .leaflet-control-zoom a { color: #09251f; }
.route-map.real-map .leaflet-control-attribution { font-size: 10px; }
.map-legend {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 10px 4px 0;
  color: #63766f;
  font-size: .77rem;
  line-height: 1.45;
}
.map-number-marker {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50% 50% 50% 9px;
  background: #ffbf35;
  color: #09251f;
  font: 950 14px/1 system-ui, sans-serif;
  box-shadow: 0 6px 14px rgba(9,37,31,.28);
  transform: rotate(-45deg);
}
.map-number-marker span { transform: rotate(45deg); }
.map-food-marker {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50% 50% 50% 8px;
  background: #bf4d36;
  color: white;
  font: 900 13px/1 "PingFang SC", "Microsoft YaHei", sans-serif;
  box-shadow: 0 6px 14px rgba(86,28,20,.28);
  transform: rotate(-45deg);
}
.map-food-marker span { transform: rotate(45deg); }
.map-food-marker.tentative { background: #a86a3d; border-style: dashed; }
.leaflet-tooltip.route-label {
  border: 0;
  border-radius: 7px;
  background: rgba(9,37,31,.88);
  color: white;
  box-shadow: none;
  font: 700 12px/1.25 "PingFang SC", "Microsoft YaHei", sans-serif;
  padding: 5px 7px;
}
.leaflet-tooltip.route-label::before { display: none; }
.leaflet-tooltip.food-label {
  border: 0;
  border-radius: 7px;
  background: rgba(100,39,29,.92);
  color: white;
  box-shadow: none;
  font: 700 12px/1.25 "PingFang SC", "Microsoft YaHei", sans-serif;
  padding: 5px 7px;
}
.leaflet-tooltip.food-label::before { display: none; }
.food-group-panel {
  margin: 18px 0 0;
  border: 1px solid rgba(154,72,46,.22);
  border-radius: 20px;
  background: #fff8ef;
  padding: 18px;
}
.food-group-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.food-group-head span { color: #a24832; font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.food-group-head h3 { margin: 3px 0 0; font-size: 1.08rem; }
.food-group-head p { margin: 4px 0 0; color: #765e55; font-size: .8rem; }
.food-toggle {
  flex: 0 0 auto;
  border: 1px solid rgba(154,72,46,.28);
  border-radius: 999px;
  background: #a24832;
  color: white;
  cursor: pointer;
  font: 800 .82rem/1.2 inherit;
  padding: 10px 14px;
}
.food-toggle:hover, .food-toggle:focus-visible { outline: 3px solid rgba(162,72,50,.2); }
.food-note { margin: 15px 0 10px; color: #765e55; font-size: .8rem; line-height: 1.55; }
.food-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.food-place {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(154,72,46,.16);
  border-radius: 14px;
  background: white;
  padding: 11px;
}
.food-index { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #a24832; color: white; font-weight: 900; }
.food-place h4 { margin: 0; font-size: .88rem; }
.food-place h4 em { display: inline-block; margin-left: 4px; border-radius: 999px; background: #f3dfc2; color: #7d4b28; font: 800 .66rem/1.2 inherit; padding: 3px 7px; vertical-align: 1px; }
.food-place p { margin: 3px 0 0; color: #745f57; font-size: .76rem; line-height: 1.4; }
.food-place p span { display: block; color: #938077; }
.food-search { color: #963f2b; font-size: .75rem; font-weight: 850; white-space: nowrap; }
.stop .pending { border: 0; cursor: pointer; font: inherit; }
.stop a.pending { text-decoration: none; }
.stop-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.stop .pending:hover, .stop .pending:focus-visible { outline: 3px solid rgba(255,191,53,.3); }
.stop-address { display: block; margin-top: 3px; color: #788a83; }
.route-editor {
  margin-top: 18px;
  border: 1px solid rgba(9,37,31,.18);
  border-radius: 20px;
  background: #eef1e1;
  padding: 18px;
}
.route-editor[hidden] { display: none; }
.editor-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.editor-head h3 { margin: 0; font-size: 1.05rem; }
.editor-head p { margin: 3px 0 0; color: #5e746c; font-size: .82rem; }
.editor-list { display: grid; gap: 10px; }
.editor-row {
  display: grid;
  grid-template-columns: 34px minmax(150px,1fr) minmax(180px,1.2fr) 125px 125px auto;
  gap: 8px;
  align-items: center;
  background: white;
  border: 1px solid rgba(9,37,31,.13);
  border-radius: 14px;
  padding: 10px;
}
.editor-index { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #15614b; color: white; font-weight: 900; }
.editor-row label { display: grid; gap: 3px; color: #63766f; font-size: .69rem; font-weight: 800; }
.editor-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(9,37,31,.18);
  border-radius: 8px;
  background: #fffef9;
  color: #09251f;
  font: 500 .82rem/1.3 inherit;
  padding: 8px;
}
.editor-row input:focus { border-color: #15614b; outline: 3px solid rgba(21,97,75,.12); }
.editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 220px; }
.mini-btn { padding: 6px 8px; border-radius: 8px; font-size: .72rem; }
.mini-btn.danger { color: #ad3b28; }
.editor-foot { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 13px; }
.editor-hint { color: #63766f; font-size: .78rem; margin-left: auto; }

@media (max-width: 1050px) {
  .editor-row { grid-template-columns: 34px 1fr 1.2fr 105px 105px; }
  .editor-actions { grid-column: 2 / -1; max-width: none; justify-content: flex-start; }
}
@media (max-width: 860px) {
  .route-map.real-map { min-height: 460px; }
  .food-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .route-tools { align-items: flex-start; }
  .route-status { flex-basis: 100%; }
  .stop-actions { grid-column: 2; justify-content: flex-start; }
  .route-map.real-map { min-height: 390px; }
  .editor-head { display: block; }
  .editor-row { grid-template-columns: 30px 1fr 1fr; }
  .editor-row label:nth-of-type(1), .editor-row label:nth-of-type(2) { grid-column: 2 / -1; }
  .editor-row label:nth-of-type(3) { grid-column: 2; }
  .editor-row label:nth-of-type(4) { grid-column: 3; }
  .editor-actions { grid-column: 2 / -1; }
  .editor-hint { flex-basis: 100%; margin: 0; }
  .food-group-head { align-items: flex-start; }
  .food-place { grid-template-columns: 30px minmax(0,1fr); }
  .food-search { grid-column: 2; justify-self: start; }
}
