body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

button {
    color: black;
  } 

#toggleDrag {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 10px 14px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 5; /* Ensure it is above the map */
    top: 80px;
    left: 5px;
    height: 44px;
}

#satnavButton {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 5; /* Ensure it is above the map */
    bottom: 10px;
    left: 10px;
    height: 44px;
}

#find-me {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 5; /* Ensure it is above the map */
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    height: 44px;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
}

/* Small modal for current street (above Find Me button) */
.street-modal {
  position: fixed;           /* we’ll anchor it via JS */
  display: none;             /* hidden by default */
  z-index: 9999;
  pointer-events: none;      /* so clicks go through to the map/buttons */
}

.street-modal-inner {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.3;
  color: #111;
  pointer-events: auto;      /* you *can* click inside if needed later */
}

#streetLabel {
  font-weight: 600;
  margin-right: 4px;
  color: #666;
}

#streetName {
  font-weight: 500;
}

#streetViewButton {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 5; /* Ensure it is above the map */
    bottom: 10px;
    right: 10px;
    height: 44px;
}

/*#openRunTextBtn {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    z-index: 5;
    top: 80px;
    right: 10px;
    height: 44px;
    display: none;
}*/

/* Removes Google default label styling */
.gm-style .gm-style-iw {
    display: none !important;
}

/* CSS for the blue dot */
.blue-dot {
    width: 16px; /* Adjust the size of the dot */
    height: 16px;
    background-color: blue;
    border-radius: 50%;
    border: 2px solid white; /* Optional: Add a white border for contrast */
}

.modal {
    display: none;
    position: fixed;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 110px);
    background: white;
    border-radius: 5px;
    padding: 5px 5px 5px 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 8000;
    /*min-height: 50px;*/
}

.modal-content {
    position: relative;
    padding: 2px 0px 2px 0px;
}

.modal-content button {
    background-color: white;
    border: none;
}

.modal-run {
    display: none;
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 110px);
    background: white;
    border-radius: 5px;
    padding: 5px 5px 5px 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 7000;
    /*min-height: 50px;*/
}

.modal-run-content {
    position: relative;
    padding: 2px 0px 2px 0px;
    display:flex;
    align-items:center; 
    justify-content:space-between;
}

.modal-run-content button {
    background-color: white;
    border: none;
}

/* -------------------------Save Run Modal-------------------------------- */
#saveRunModal {
  display: none;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 110px);
  background-color: transparent;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Modal Content */
#saveRunModalContent {
  background-color: #fff;
  padding: 20px 30px;
  border-radius: 5px;
  width: 90%;
  max-width: 680px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-family: Arial, sans-serif;
}

#saveRunModalContent h3 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.5em;
  color: #333;
}

@media (orientation: portrait) {
  #saveRunModal {
    top: 6px;
    left: 0;
    right: 0;
    transform: none;
    width: 100vw;
    padding: 0 6px;
    box-sizing: border-box;
  }

  #saveRunModalContent {
    width: 100%;
    max-width: none;
    padding: 20px 18px;
    box-sizing: border-box;
  }
}

.save-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.save-type-btn {
  background-color: #f3f4f6;
  border: 1px solid #d2d6dc;
  border-radius: 6px;
  color: #333;
  cursor: pointer;
  font-size: 16px;
  padding: 10px 12px;
}

.save-type-btn.active {
  background-color: #007bff;
  border-color: #007bff;
  color: #fff;
}

/* Form Elements */
#saveRunModalContent label {
  display: block;
  margin-bottom: 5px;
  color: #555;
  font-weight: 500;
}

.save-folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

#saveRunModalContent .save-folder-row label {
  margin-bottom: 0;
}

#createNewFolderLink {
  color: #111;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

#saveRunModalContent input,
#saveRunModalContent select {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.custom-folder-row {
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

#saveRunModalContent .custom-folder-row input {
  flex: 1 1 0;
  margin-bottom: 0;
  min-width: 0;
  width: auto;
}

#addNewFolderBtn,
#cancelNewFolderBtn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 14px;
  padding: 8px 12px;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .custom-folder-row {
    gap: 6px;
  }

  #addNewFolderBtn,
  #cancelNewFolderBtn {
    padding: 8px 10px;
  }
}

#addNewFolderBtn {
  background-color: #007bff;
  color: #fff;
}

#cancelNewFolderBtn {
  background-color: #e0e0e0;
  color: #333;
}

/* Button Container */
.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

/* Buttons */
.modal-buttons button {
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#confirmSaveRunBtn {
  background-color: #007bff;
  color: white;
}

#confirmSaveRunBtn:hover {
  background-color: #0056b3;
}

.modal-buttons button:last-child {
  background-color: #e0e0e0;
  color: #333;
}

.modal-buttons button:last-child:hover {
  background-color: #c2c2c2;
}

#folderDropdownWrapper {
    box-sizing: border-box;
    position: relative;
    font-family: Arial, sans-serif;
    margin-bottom: 10px;
    max-width: 100%;
}

#selectedFolderDisplay {
    box-sizing: border-box;
    border: 1px solid #ccc;
    padding: 8px 12px;
    background-color: #f9f9f9;
    cursor: pointer;
    border-radius: 4px;
    /*min-height: 36px;*/
    user-select: none;
    transition: background 0.2s;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#selectedFolderDisplay:hover {
    background-color: #f0f0f0;
}

#selectedFolderDisplay.select-mode {
    background-color: transparent;
    border-color: transparent;
    color: #fff;
    cursor: default;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) 48px;
    padding: 0;
    text-align: center;
    width: 100%;
}

#selectedFolderDisplay.select-mode:hover {
    background-color: transparent;
}

.folder-picker-confirm-btn,
.folder-picker-cancel-btn {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.2;
    min-height: 36px;
    padding: 6px 10px;
}

.folder-picker-confirm-btn {
    background-color: #007bff;
    color: #fff;
}

.folder-picker-confirm-btn:hover {
    background-color: #0069d9;
}

.folder-picker-cancel-btn {
    background-color: #e0e0e0;
    color: #222;
    font-weight: 700;
}

.folder-picker-cancel-btn:hover {
    background-color: #cfcfcf;
}

.folder-dropdown .folder-picker-action-row {
    background: #f3f4f6;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) 48px;
    margin: 0 0 8px 0;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.folder-dropdown .folder-picker-action-row .folder-picker-confirm-btn,
.folder-dropdown .folder-picker-action-row .folder-picker-cancel-btn {
    min-height: 34px;
}

.folder-dropdown .folder-picker-new-folder-row input {
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.folder-picker-inline-add,
.folder-picker-inline-cancel {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex: 0 0 auto;
    padding: 7px 10px;
    white-space: nowrap;
}

.folder-picker-inline-add {
    background: #007bff;
    color: #fff;
}

.folder-picker-inline-cancel {
    background: #e0e0e0;
    color: #222;
}

#folderTreeMenu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #cfd6df;
    border-radius: 6px;
    max-height: min(42dvh, 330px);
    overflow-y: auto;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
    z-index: 9999;
    padding: 6px;
    box-sizing: border-box;
}

#folderTreeMenu .folder-children {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#folderTreeMenu .folder-picker-action-row {
    background: #fff;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) 48px;
    margin: -6px -6px 6px -6px;
    padding: 6px;
    position: sticky;
    top: -6px;
    z-index: 3;
}

#folderTreeMenu .folder-depth-0 {
    --folder-bg: linear-gradient(180deg, #f9fafb 0%, #edf0f3 100%);
    --folder-border: #c5ccd5;
    --folder-accent: #111827;
    --folder-hover-border: #111827;
    --folder-hover-shadow: rgba(17, 24, 39, 0.2);
}

.folder-dropdown .folder-depth-0 {
    --folder-bg: linear-gradient(180deg, #f9fafb 0%, #edf0f3 100%);
    --folder-border: #c5ccd5;
    --folder-accent: #111827;
    --folder-hover-border: #111827;
    --folder-hover-shadow: rgba(17, 24, 39, 0.2);
}

.folder-dropdown .folder-depth-1 {
    --folder-bg: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
    --folder-border: #bdd7f4;
    --folder-accent: #2f80ed;
    --folder-hover-border: #2f80ed;
    --folder-hover-shadow: rgba(47, 128, 237, 0.22);
}

.folder-dropdown .folder-depth-2 {
    --folder-bg: linear-gradient(180deg, #f2fffd 0%, #dcf7f3 100%);
    --folder-border: #9fd8d1;
    --folder-accent: #00a895;
    --folder-hover-border: #00a895;
    --folder-hover-shadow: rgba(0, 168, 149, 0.24);
}

.folder-dropdown .folder-depth-3 {
    --folder-bg: linear-gradient(180deg, #fbfff4 0%, #f0f9df 100%);
    --folder-border: #c9e7a4;
    --folder-accent: #7dbb38;
    --folder-hover-border: #7dbb38;
    --folder-hover-shadow: rgba(125, 187, 56, 0.22);
}

.folder-dropdown .folder-depth-4 {
    --folder-bg: linear-gradient(180deg, #f4f8ff 0%, #e3ebf8 100%);
    --folder-border: #aebfda;
    --folder-accent: #1d3f72;
    --folder-hover-border: #1d3f72;
    --folder-hover-shadow: rgba(29, 63, 114, 0.22);
}

.folder-dropdown .folder-depth-5 {
    --folder-bg: linear-gradient(180deg, #f8f7ff 0%, #eeebff 100%);
    --folder-border: #c9c1f2;
    --folder-accent: #6f5bd6;
    --folder-hover-border: #6f5bd6;
    --folder-hover-shadow: rgba(111, 91, 214, 0.22);
}

#folderTreeMenu .folder-depth-1 {
    --folder-bg: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
    --folder-border: #bdd7f4;
    --folder-accent: #2f80ed;
    --folder-hover-border: #2f80ed;
    --folder-hover-shadow: rgba(47, 128, 237, 0.22);
}

#folderTreeMenu .folder-depth-2 {
    --folder-bg: linear-gradient(180deg, #f2fffd 0%, #dcf7f3 100%);
    --folder-border: #9fd8d1;
    --folder-accent: #00a895;
    --folder-hover-border: #00a895;
    --folder-hover-shadow: rgba(0, 168, 149, 0.24);
}

#folderTreeMenu .folder-depth-3 {
    --folder-bg: linear-gradient(180deg, #fbfff4 0%, #f0f9df 100%);
    --folder-border: #c9e7a4;
    --folder-accent: #7dbb38;
    --folder-hover-border: #7dbb38;
    --folder-hover-shadow: rgba(125, 187, 56, 0.22);
}

#folderTreeMenu .folder-depth-4 {
    --folder-bg: linear-gradient(180deg, #f4f8ff 0%, #e3ebf8 100%);
    --folder-border: #aebfda;
    --folder-accent: #1d3f72;
    --folder-hover-border: #1d3f72;
    --folder-hover-shadow: rgba(29, 63, 114, 0.22);
}

#folderTreeMenu .folder-depth-5 {
    --folder-bg: linear-gradient(180deg, #f8f7ff 0%, #eeebff 100%);
    --folder-border: #c9c1f2;
    --folder-accent: #6f5bd6;
    --folder-hover-border: #6f5bd6;
    --folder-hover-shadow: rgba(111, 91, 214, 0.22);
}

#folderTreeMenu .folder-item {
    --folder-depth: 0;
    --folder-indent: 0px;
    --folder-guide-left: 16px;
    position: relative;
    display: grid;
    grid-template-columns: 16px 22px minmax(0, 1fr);
    align-items: center;
    column-gap: 6px;
    min-height: 34px;
    padding: 5px 8px 5px calc(8px + var(--folder-indent));
    border-radius: 5px;
    color: #111827;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.folder-dropdown .folder-picker-row.resource-folder-tile {
    min-height: 42px;
    margin: 3px 0;
    border: 1px solid var(--folder-border, #d7dde5);
    border-left: 5px solid var(--folder-accent, #9dc4f8);
    border-radius: 7px;
    background: var(--folder-bg, linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 7px 10px !important;
    box-sizing: border-box;
    color: #111827;
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.folder-dropdown .folder-picker-row.resource-folder-tile:hover {
    border-color: var(--folder-hover-border, var(--folder-accent, #9dc4f8));
    border-left-color: var(--folder-accent, #9dc4f8);
    box-shadow: 0 3px 8px var(--folder-hover-shadow, rgba(0, 0, 0, 0.1));
    transform: translateY(-1px);
}

.folder-dropdown .folder-picker-row.resource-folder-tile.selected {
    color: #0f4f95;
    font-weight: bold;
    border-width: 2px;
    border-left-width: 7px;
    border-color: var(--folder-hover-border, var(--folder-accent, #2f80ed));
    border-left-color: var(--folder-accent, #2f80ed);
    box-shadow: 0 0 0 2px rgba(47, 128, 237, 0.16), 0 3px 8px var(--folder-hover-shadow, rgba(47, 128, 237, 0.18));
}

.folder-dropdown .folder-picker-row.root-folder-tile.selected {
    color: #111827;
}

.folder-dropdown .folder-picker-row.pending-folder-tile {
    --folder-bg: linear-gradient(180deg, #f8fafc 0%, #eef1f5 100%);
    --folder-border: #cfd6df;
    --folder-accent: #8b95a1;
    --folder-hover-border: #8b95a1;
    --folder-hover-shadow: rgba(100, 116, 139, 0.18);
    color: #374151;
}

.folder-dropdown .folder-picker-row.pending-folder-tile.selected {
    color: #374151;
    border-color: #b8c0ca;
    border-left-color: #8b95a1;
    box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.14), 0 3px 8px rgba(100, 116, 139, 0.16);
}

.folder-dropdown .folder-picker-row.resource-folder-tile > span:first-child,
.folder-dropdown .folder-picker-row.resource-folder-tile > span:nth-child(2) {
    display: none;
}

.folder-dropdown .folder-picker-row.resource-folder-tile > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 700;
}

.folder-dropdown .folder-picker-children {
    display: flex;
    flex-direction: column;
}

.folder-dropdown .folder-picker-tree {
    background: #f3f4f6;
}

#folderTreeMenu .resource-folder-tile {
    grid-template-columns: minmax(0, 1fr);
    min-height: 42px;
    margin: 3px 0;
    border: 1px solid var(--folder-border, #d7dde5);
    border-left: 5px solid var(--folder-accent, #9dc4f8);
    border-radius: 7px;
    background: var(--folder-bg, linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 7px 10px;
    box-sizing: border-box;
}

#folderTreeMenu .resource-folder-tile .folder-item-icon {
    display: none;
}

#folderTreeMenu .resource-folder-tile:hover {
    background: var(--folder-bg, linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%));
    border-color: var(--folder-hover-border, var(--folder-accent, #9dc4f8));
    border-left-color: var(--folder-accent, #9dc4f8);
    box-shadow: 0 3px 8px var(--folder-hover-shadow, rgba(0, 0, 0, 0.1));
    transform: translateY(-1px);
}

#folderTreeMenu .folder-item::before {
    content: "";
    position: absolute;
    left: var(--folder-guide-left);
    top: 0;
    bottom: 0;
    width: 1px;
    background: #d9e1ec;
    opacity: 0;
}

#folderTreeMenu .folder-item[data-depth]:not([data-depth="0"])::before {
    opacity: 0;
}

#folderTreeMenu .resource-folder-tile.selected {
    color: #0f4f95;
    font-weight: bold;
    border-width: 2px;
    border-left-width: 7px;
    border-color: var(--folder-hover-border, var(--folder-accent, #2f80ed));
    border-left-color: var(--folder-accent, #2f80ed);
    box-shadow: 0 0 0 2px rgba(47, 128, 237, 0.16), 0 3px 8px var(--folder-hover-shadow, rgba(47, 128, 237, 0.18));
}

#folderTreeMenu .root-folder-tile.selected {
    color: #111827;
}

#folderTreeMenu .pending-folder-tile {
    --folder-bg: linear-gradient(180deg, #f8fafc 0%, #eef1f5 100%);
    --folder-border: #cfd6df;
    --folder-accent: #8b95a1;
    --folder-hover-border: #8b95a1;
    --folder-hover-shadow: rgba(100, 116, 139, 0.18);
    color: #374151;
    font-weight: bold;
}

#folderTreeMenu .resource-folder-tile.pending-folder-tile.selected {
    color: #374151;
    border-width: 2px;
    border-left-width: 7px;
    border-color: #b8c0ca;
    border-left-color: #8b95a1;
    box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.14), 0 3px 8px rgba(100, 116, 139, 0.16);
}

#folderTreeMenu .folder-item.sublevel {
    margin-left: 20px;
}

#folderTreeMenu .folder-item-twisty {
    align-items: center;
    border-radius: 4px;
    color: #64748b;
    display: none;
    font-size: 13px;
    height: 26px;
    justify-content: center;
    text-align: center;
    width: 26px;
}

#folderTreeMenu .folder-item-twisty.has-children {
    cursor: pointer;
}

#folderTreeMenu .folder-item-twisty.has-children:hover {
    background: rgba(15, 23, 42, 0.08);
}

#folderTreeMenu .folder-item-icon {
    width: 22px;
    font-size: 18px;
    line-height: 1;
    filter: saturate(0.95);
}

#folderTreeMenu .folder-item-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 700;
}

#folderTreeMenu .folder-item:focus-visible {
    outline: 2px solid #2f80ed;
    outline-offset: -2px;
}

/*-----------------------------------Markers----------------------------------------------------*/

#markerName {
    font-family: 'Arial', sans-serif; 
    font-size: 24px; 
    font-weight: bold; 
    color: #333; 
    margin-bottom: 0px; 
    text-align: center;
}

#markerAddress {
    font-family: 'Arial', sans-serif;
    font-size: 16px; 
    color: #555; 
    text-align: center; 
}

#runNameDisplay {
    font-family: 'Arial', sans-serif; 
    font-size: 16px; 
    font-weight: bold; 
    color: #333; 
    margin-bottom: 0px; 
    text-align: center;
}

#modalContent h2,
#modalContent p {
    margin-top: 0px;
    margin-bottom: 0px;
}

#modalContent {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#selectMarkerBtn {
    display: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-top: 5px;
    /*font-size: 24px;*/
  }  

#topBar {
    position: absolute;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0;
    background-color: transparent;
    z-index: 10;
}

#searchContainer {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#searchBar {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px; /* For the clear button */
    font-size: 16px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    outline: none;
    transition: all 0.3s ease;
}

#searchBar:focus {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#clearSearch {
    position: absolute;
    right: 65px; /* move it left so it's inside the input */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    display: none;
    color: #888;
    z-index: 2;
}

/* Search Results Container Positioned Below the Search Bar */
#searchResults {
    position: absolute;
    top: calc(100% - 9px); /*gap from search bar*/
    left: 50%;
    transform: translateX(-50%);
    width: 75%;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    /*border: 1px solid #ccc;
    border-top: none;*/
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-family: 'Arial', sans-serif;
  }
  
  /* Individual Result Item */
  .resultItem {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border-bottom: 1px solid #eee;
  }
  
  .resultItem:last-child {
    border-bottom: none;
  }
  
  .resultItem:hover {
    background-color: #007BFF;
    color: #fff;
  }

  .resultItem:hover .resultAddress {
    color: #fff;
}

  .resultAddress {
    color: #777;
}
  
  /* Optional: Message for no results */
  #searchResults.empty {
    padding: 10px;
    text-align: center;
    color: #777;
  }

  /* Street result entries in search — styled differently */
.resultItem.streetResult {
    font-style: italic;
    color: #777;
}

.resultItem.streetResult:hover {
    background-color: #007BFF;
    color: #fff;
  }

  #toggle-markers, #toggle-toolbars {
    padding: 10px 15px;
    margin: 0 5px;
    border: none;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    height: 44px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

 /*--------------------------------------------------------------------------------------*/
 
 #toolbar-right {
    position: absolute;
    top: 80px;
    right: 0px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px; /* space between buttons */
    background: transparent;
    padding: 8px 5px;
    border-radius: 10px;
}

#toolbar-right button {
    display: flex;              
    align-items: center;          
    justify-content: center;      
    padding: 10px 7px;                
    background: rgba(255,255,255,0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 18px;              
    border-radius: 5px;
    position: relative;
    line-height: 1;               
}

#toolbar-bottom {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    max-width: 100vw;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

#toolbar-bottom button {
    padding: 10px 15px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    position: relative; 
}

@media (max-width: 600px) {
    #toolbar-bottom {
        left: 0;       
        right: 0;  
        transform: none;        
        margin: auto;
        gap: 5px; /* smaller space between buttons */
        padding: 6px 8px; /* smaller toolbar padding */
    }

    #toolbar-bottom button {
        padding: 10px 12px; /* smaller button padding */
        font-size: 18px; /* smaller text size */
    }
}

#clear-button,
#clear-line-ab-button {
    user-select: none;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    pointer-events: auto;
}

#toolbar-lines {
    display: none;
}

#toolbar-lines button.active,
#toolbar-lines button.selected {
    background: navy !important;
    color: white !important;
    border-color: navy !important;
}

/* Highlight selected button (NAVY BLUE) */
.selected {
    background: navy;
    color: white;
    border-color: navy;
}

#distance-display {
    color: red;
    font-size: 13px !important;
}

#distance-display-2 {
    color: purple;
    font-size: 13px !important;
}

/* ------------------------------------------------------------------------------------ */

/* Make checkbox rows use the same "button face" font */
#pin-filter-menu {
  font-family: Arial, sans-serif;
  font-size: 14px; 
}

#pin-filter-menu label,
#pin-filter-menu input[type="checkbox"] {
  font: inherit;   /* inherit the container’s font family & size */
  color: black;    /* matches your global button color */
}

#pin-filter-menu {
  display: none;
  position: absolute;
  z-index: 9000;
  background: white;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  overflow: hidden;
  width: 200px;
}

#pin-filter-menu label {
  display: flex;                 /* lays out checkbox + text on one row */
  align-items: center;
  gap: 10px;                     /* space between checkbox and text */
  width: 100%;
  padding: 10px 16px;
  background: white;
  border: none;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  line-height: 1.2;
  user-select: none;
}

/* hover like buttons */
#pin-filter-menu label:hover {
  background-color: #f0f0f0;
}

/* remove the last divider */
#pin-filter-menu label:last-of-type {
  border-bottom: none;
}

/* checkbox spacing + optional accent color (supported in modern browsers) */
#pin-filter-menu input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;                     /* let gap handle spacing */
  accent-color: #2b7cff;         /* optional: theme color for the tick */
}

/*------------------------------------------------------------------------------------------------------*/

#toolbar-menu {
    display: none;
    position: absolute;
    z-index: 9999;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    overflow: hidden;
    width: 200px;
}

#toolbar-menu button {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    padding: 10px 15px;
    width: 100%;
    background: white;
    border: none;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    text-align: left;
}

#toolbar-menu button[hidden],
#toggleDrag[hidden] {
    display: none !important;
}

#toolbar-menu button:hover {
    background-color: #f0f0f0;
}

#runInfoModal {
  user-select: none; /* Disable text selection */
  -webkit-user-select: none; /* For Safari */
  -ms-user-select: none; /* For IE/Edge */
}

#runTextTitle {
    cursor: pointer;
}

#runTextTitle::-webkit-scrollbar {
            display: none;
        }

#runTextInput {
  overflow: auto;                /* make it the scroller */
  max-height: calc(100% - 56px); /* leave room for your sticky header; tweak 56px */
}

/*------------------------------coach marks tour----------------------------------------------*/

.coach-tour {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: auto;
    font-family: Arial, sans-serif;
}

.coach-tour-spotlight {
    position: fixed;
    top: var(--coach-top, 16px);
    left: var(--coach-left, 16px);
    width: var(--coach-width, 80px);
    height: var(--coach-height, 52px);
    border: 3px solid #0d7cff;
    border-radius: 14px;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.58),
        0 0 22px rgba(13, 124, 255, 0.7);
    pointer-events: none;
    transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
}

.coach-tour-card {
    position: fixed;
    left: 50%;
    top: var(--coach-card-top, 120px);
    transform: translateX(-50%);
    width: min(430px, calc(100vw - 28px));
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(21, 42, 60, 0.12);
    border-radius: 16px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    color: #18324a;
    padding: 16px;
    max-height: calc(100vh - 28px);
    overflow-y: auto;
}

.coach-tour-card h2 {
    font-size: 22px;
    margin: 0 0 8px;
}

.coach-tour-card p {
    color: #51677b;
    font-size: 15px;
    line-height: 1.45;
    margin: 0;
}

.coach-tour-progress {
    color: #6b7f91;
    font-size: 13px;
    font-weight: 700;
    margin-top: 12px;
}

.coach-tour-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
}

.coach-tour-actions button {
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 38px;
    padding: 9px 13px;
}

.coach-tour-button-primary {
    background: #007bff;
    color: white;
}

.coach-tour-button-secondary {
    background: #eef3f8;
    color: #18324a;
}

.coach-tour-button-ghost {
    background: transparent;
    color: #51677b;
}

@media (max-width: 560px) {
    .coach-tour-actions {
        justify-content: stretch;
    }

    .coach-tour-actions button {
        flex: 1 1 auto;
    }
}
