body {
  margin: 0;
  font-family: Arial, sans-serif;
}

.app {
  display: flex;
  height: 100vh;
}

 .sidebar {
  width: 380px;
  background: #f4f4f4;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.stop-list-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 15px 15px 15px;
}

.stop-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stop-list-header h2 {
  margin: 10px 0 6px 0;
  font-size: 18px;
}

#showSkippedBtn {
  width: auto;
  min-width: 78px;
  background: white;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  padding: 6px 8px;
}

#showSkippedBtn.active-filter {
  background: #f59e0b;
  color: #111827;
  border-color: #f59e0b;
}
#map {
  flex: 1;
  height: 100vh;
}

#currentStop {
  background: white;
  padding: 10px;
  margin: 8px 0;
  border-radius: 10px;
  border: 2px solid #333;
}

#geocodeBtn {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: #222;
  color: white;
  border: none;
  border-radius: 8px;
}

.stop-card {
  background: white;
  padding: 8px 10px;
  margin: 6px 0;
  border-radius: 8px;
  cursor: pointer;
}

.stop-card-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: baseline;
}

.stop-card-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-card small {
  display: block;
  margin-top: 2px;
  color: #4b5563;
}

.empty-list {
  background: white;
  padding: 10px;
  margin: 6px 0;
  border-radius: 8px;
  color: #4b5563;
  font-size: 14px;
}

.active {
  border: 3px solid green;
}
.number-marker {
  width: 32px;
  height: 32px;
  background: #2563eb;
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.active-marker {
  background: #16a34a;
  width: 42px;
  height: 42px;
  font-size: 18px;
  border: 3px solid white;
}

.fixed-controls {
  flex-shrink: 0;
  padding: 10px;
  border-bottom: 2px solid #ccc;
}

.fixed-controls h1 {
  margin: 0 0 6px 0;
  font-size: 22px;
}

#progressBox,
#gpsStatus,
#appStatus {
  padding: 6px;
  margin: 5px 0;
  font-size: 13px;
}

#appStatus {
  min-height: 18px;
  color: #166534;
  font-weight: bold;
}

#currentStop h2 {
  margin: 0 0 6px 0;
  font-size: 20px;
}

#currentStop p {
  margin: 4px 0;
  font-size: 14px;
}

button {
  font-size: 14px;
  padding: 8px 10px;
  margin: 3px 2px;
  cursor: pointer;
}

#navigateBtn {
  display: block;
  width: 100%;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
}

#completeBtn {
  display: block;
  width: 100%;
  background: #16a34a;
  color: white;
  border: none;
  border-radius: 8px;
}

#progressBox {
  background: white;
  padding: 10px;
  margin: 10px 0;
  border-radius: 8px;
  font-weight: bold;
}

.completed-stop {
  opacity: 0.55;
  text-decoration: line-through;
}

.skipped-stop {
  border-left: 6px solid #f59e0b;
}
#startGpsBtn {
  display: block;
  width: 100%;
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 8px;
}

#loadSavedBtn {
  display: block;
  width: 100%;
  background: #4b5563;
  color: white;
  border: none;
  border-radius: 8px;
}

#skipBtn {
  display: block;
  width: 100%;
  background: #f59e0b;
  color: #111827;
  border: none;
  border-radius: 8px;
  font-weight: bold;
}

#undoBtn {
  display: block;
  width: 100%;
  background: #475569;
  color: white;
  border: none;
  border-radius: 8px;
}

.notes-label {
  display: block;
  margin: 8px 0 4px 0;
  font-size: 14px;
  font-weight: bold;
}

#stopNotes {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 48px 36px 48px;
}

.notes-box {
  position: relative;
}

.notes-icon {
  position: absolute;
  bottom: 8px;
  margin: 0;
  padding: 0;
  border: none;
  font-weight: bold;
}

.notes-delete {
  left: 8px;
  width: 24px;
  height: 24px;
  background: transparent;
  color: #991b1b;
  font-size: 18px;
  line-height: 24px;
}

.notes-mic {
  right: 8px;
  width: 34px;
  height: 34px;
  background: #be123c;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notes-mic.recording {
  background: #111827;
  width: 46px;
  border-radius: 999px;
  font-size: 12px;
}

.notes-mic svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notes-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.voice-note {
  margin-top: 6px;
}

.voice-note p {
  margin: 2px 0;
  font-size: 12px;
  color: #4b5563;
}

.voice-note audio {
  width: 100%;
  height: 32px;
  margin: 2px 0;
}

.tools-panel {
  background: white;
  padding: 8px;
  margin: 8px 0;
  border-radius: 8px;
}

.tools-panel summary {
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
}

.tools-panel button,
.tools-panel input {
  margin-top: 6px;
}

@media (max-width: 800px) {
  .app {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    height: auto;
    max-height: none;
  }

  .fixed-controls {
    padding: 10px;
  }

  .stop-list-area {
    max-height: 240px;
    overflow-y: auto;
    padding: 0 10px 10px 10px;
  }

  #map {
    width: 100%;
    height: 55vh;
    order: 2;
  }

  .sidebar {
    order: 1;
  }

  button {
    width: 100%;
    font-size: 17px;
    padding: 12px;
    margin: 4px 0;
  }

  #prevBtn,
  #nextBtn {
    width: 49%;
    display: inline-block;
  }

  #currentStop {
    padding: 10px;
    margin: 8px 0;
  }

  #currentStop p {
    font-size: 14px;
    margin: 3px 0;
  }

  .stop-card {
    font-size: 14px;
    padding: 8px;
  }
}

.completed-marker {
  background: #6b7280;
  opacity: 0.75;
}

.skipped-marker {
  background: #f59e0b;
  color: #111827;
}

.route-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.35);
  padding: 16px;
}

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

.route-popup-content {
  position: relative;
  width: min(320px, 100%);
  background: white;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.route-popup-content h2 {
  margin: 0 28px 8px 0;
  font-size: 20px;
}

.route-popup-content p {
  margin: 0;
  font-size: 14px;
}

#closeRoutePopupBtn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  color: #111827;
  font-size: 18px;
  font-weight: bold;
}
