/* ===== RoutePlanner — expedition brand: teal + sunset accent ===== */
:root {
  --teal: #1b5e57;
  --teal-deep: #0e3b36;
  --bg: #f7f7f5;
  --gold: #b8860b;
  --sunset: #ff6a2b;
  --amber: #ffb347;
  --blue: #2471a3;
  --line: #e3e3e0;
  --text: #333;
  --muted: #777;
  --display: 'Bricolage Grotesque', 'Hanken Grotesk', -apple-system, sans-serif;
  --body: 'Hanken Grotesk', -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--body);
  color: var(--text); background: var(--bg);
}
.brand { font-family: var(--display); }

/* ---- Top bar ---- */
#topbar {
  height: calc(54px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top, 0px) 18px 0; color: #fff;
  background: linear-gradient(115deg, var(--teal) 0%, var(--teal-deep) 100%);
  border-bottom: 2px solid var(--sunset);
  position: relative; z-index: 500;
}
#topbar.hidden { display: none; }
#topbar .brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }
#topbar .brand-word span { color: var(--amber); }
#topbar .bm-pin { width: 16px; height: 16px; box-shadow: 0 2px 8px rgba(255,106,43,0.45); }
#topbar .bm-pin::after { inset: 5px; background: var(--teal-deep); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-email { font-size: 13px; opacity: 0.9; }
.topbar-logout {
  background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.35);
  border-radius: 7px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.topbar-logout:hover { background: rgba(255,255,255,0.25); }
.netbadge { display: none; font-size: 12px; font-weight: 700; color: #fff; background: var(--sunset); padding: 4px 10px; border-radius: 999px; }
body.offline .netbadge { display: inline-flex; align-items: center; }

/* ---- View host ---- */
#view { height: calc(100% - 54px - env(safe-area-inset-top, 0px)); overflow: auto; }
#view.fullbleed { overflow: hidden; }

/* ---- Buttons ---- */
button { font-family: inherit; }
.btn {
  display: inline-block; padding: 9px 14px; border: none; border-radius: 9px;
  cursor: pointer; font-size: 13px; font-weight: 700; color: #fff; background: var(--teal);
  transition: filter 0.15s, transform 0.1s, box-shadow 0.2s;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.secondary { background: var(--blue); }
.btn.gold { background: linear-gradient(120deg, var(--amber), var(--sunset)); box-shadow: 0 6px 16px rgba(255,106,43,0.28); }
.btn.ghost { background: #fff; color: var(--teal); border: 1px solid var(--line); }
.btn.danger { background: #c0392b; }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.tiny { padding: 3px 8px; font-size: 11px; font-weight: 600; border-radius: 7px; }

/* stacked export/import buttons next to the undo button */
.io-btns { display: flex; flex-direction: column; gap: 4px; flex: none; }
.io-btns .btn { white-space: nowrap; text-align: center; }

input[type=text], input[type=email], select, textarea {
  font-family: inherit; font-size: 14px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
  width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
label.field { display: block; font-size: 12px; color: var(--muted); margin: 0 0 4px; }

/* ---- Login — expedition hero ---- */
.login-screen {
  position: fixed; inset: 0; overflow: auto; display: flex; align-items: center;
  padding: 40px 30px; color: #eaf3f1;
  background:
    radial-gradient(90% 60% at 82% -8%, rgba(255,122,61,0.28), transparent 60%),
    radial-gradient(70% 50% at 8% 108%, rgba(255,179,71,0.16), transparent 60%),
    linear-gradient(155deg, #14524b 0%, var(--teal-deep) 52%, #0a2a27 100%);
}
.login-screen .login-trail {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.5; pointer-events: none; z-index: 0;
}
.login-trail .trailpath {
  stroke-dasharray: 7 11; animation: trailmarch 24s linear infinite;
}
@keyframes trailmarch { to { stroke-dashoffset: -360; } }
.login-trail .traildot {
  offset-path: path("M40 560 C 120 440 40 360 160 300 C 280 240 200 150 320 90");
  animation: trailride 7s ease-in-out infinite;
}
@keyframes trailride { 0%,100% { offset-distance: 0%; } 50% { offset-distance: 100%; } }
.login-trail .trailhalo { transform-box: fill-box; transform-origin: center; animation: halo 2.6s ease-out infinite; }
@keyframes halo { 0% { transform: scale(1); opacity: 0.55; } 70% { opacity: 0; } 100% { transform: scale(2.6); opacity: 0; } }

.login-inner { position: relative; z-index: 1; width: 100%; max-width: 480px; margin: 0 auto; }
.login-inner > * { animation: rise 0.7s cubic-bezier(0.2,0.7,0.2,1) backwards; }
.login-inner > *:nth-child(1) { animation-delay: 0.05s; }
.login-inner > *:nth-child(2) { animation-delay: 0.13s; }
.login-inner > *:nth-child(3) { animation-delay: 0.21s; }
.login-inner > *:nth-child(4) { animation-delay: 0.29s; }
.login-inner > *:nth-child(5) { animation-delay: 0.37s; }
.login-inner > *:nth-child(6) { animation-delay: 0.45s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.brandmark { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
.bm-pin {
  width: 20px; height: 20px; background: linear-gradient(150deg, var(--amber), var(--sunset));
  border-radius: 52% 52% 52% 6px; transform: rotate(45deg); position: relative;
  box-shadow: 0 4px 14px rgba(255,106,43,0.5);
}
.bm-pin::after { content: ""; position: absolute; inset: 6px; background: #0a2a27; border-radius: 50%; }
.bm-name { font-family: var(--display); font-weight: 800; font-size: 21px; color: #fff; letter-spacing: -0.4px; }
.bm-name span { color: var(--amber); }

.login-title {
  font-family: var(--display); font-weight: 800; font-size: clamp(38px, 9vw, 58px);
  line-height: 0.98; letter-spacing: -1.5px; margin: 0 0 18px; color: #fff;
}
.login-title .accent {
  background: linear-gradient(100deg, var(--amber), var(--sunset));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { font-size: 16px; line-height: 1.6; color: #b9d3ce; margin: 0 0 28px; max-width: 30em; }

.login-form { display: flex; gap: 10px; flex-wrap: wrap; }
#loginEmail {
  flex: 1; min-width: 200px; background: rgba(255,255,255,0.07); color: #fff;
  border: 1.5px solid rgba(255,255,255,0.18); border-radius: 14px; padding: 16px 18px;
  font-family: var(--body); font-size: 16px; transition: border-color 0.2s, background 0.2s;
}
#loginEmail::placeholder { color: #8fb0ab; }
#loginEmail:focus { outline: none; border-color: var(--amber); background: rgba(255,255,255,0.12); }
.login-go {
  border: none; cursor: pointer; border-radius: 14px; padding: 16px 26px;
  font-family: var(--body); font-weight: 800; font-size: 16px; color: #fff; white-space: nowrap;
  background: linear-gradient(120deg, var(--sunset), #ff8f3d);
  box-shadow: 0 10px 26px rgba(255,106,43,0.42);
  transition: transform 0.15s, box-shadow 0.2s;
}
.login-go .arr { display: inline-block; transition: transform 0.2s; }
.login-go:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(255,106,43,0.55); }
.login-go:hover .arr { transform: translateX(4px); }
.login-go:disabled { opacity: 0.6; cursor: default; transform: none; }

.login-msg { margin-top: 18px; font-size: 15px; color: #d7e8e4; line-height: 1.6; }
.login-msg .devlink { display: inline-block; margin-top: 8px; color: var(--amber); font-weight: 700; }
.login-err { margin-top: 18px; font-size: 14px; color: #ffd9c2; font-weight: 600; }
.login-tags { margin-top: 30px; font-size: 13px; color: #7fa39d; letter-spacing: 0.3px; }

/* ---- Dashboard ---- */
.dash-wrap { max-width: 880px; margin: 0 auto; padding: 28px 22px 60px; }
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.dash-head h1 { font-family: var(--display); font-weight: 800; color: var(--teal); font-size: 30px; letter-spacing: -0.8px; margin: 0; }
.dash-tag { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-section { margin-top: 28px; }
.dash-section h2 {
  font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--teal);
  margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line);
  display: inline-block;
}
.route-row {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  transition: box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}
.route-row:hover { border-color: #cbe0db; box-shadow: 0 6px 18px rgba(14,59,54,0.08); transform: translateY(-1px); }
.route-row .mode {
  flex: none; width: 36px; height: 36px; border-radius: 10px; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  background: #eef3f2;
}
.route-row .rtitle { font-weight: 700; font-size: 15px; color: var(--teal); }
.route-row .rmeta { font-size: 12px; color: var(--muted); }
.route-row .grow { flex: 1; min-width: 0; }
.route-row .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { color: var(--muted); font-style: italic; font-size: 13px; padding: 8px 2px; }

.badge {
  display: inline-block; font-size: 11px; font-weight: bold; padding: 2px 8px;
  border-radius: 999px; vertical-align: middle;
}
.badge.read { background: #eef3f2; color: var(--teal); }
.badge.edit { background: #fff3da; color: var(--gold); }
.badge.admin { background: var(--gold); color: #fff; }
.badge.ro { background: #fdecea; color: #c0392b; }
.badge.approx { background: #fff3da; color: var(--gold); margin-left: 6px; }

.account-bar { margin-top: 30px; font-size: 13px; color: var(--muted); }
.account-bar a { color: var(--blue); cursor: pointer; text-decoration: underline; }

/* admin table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border-radius: 10px; overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.admin-table th { background: #eef3f2; color: var(--teal); font-size: 12px; }
.admin-table tr:last-child td { border-bottom: none; }

/* ---- Editor ---- */
#editor-wrap { display: flex; height: 100%; }
#map { flex: 1; height: 100%; }

/* ---- place search overlay on the map ---- */
.map-search {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 1000; width: min(380px, calc(100% - 84px));
  font-family: var(--body);
}
.map-search-input {
  width: 100%; box-sizing: border-box; padding: 10px 14px;
  border: none; border-radius: 999px; font-size: 14px; color: #1d1d1d;
  background: #fff; box-shadow: 0 4px 18px rgba(14,59,54,0.28);
  outline: 2px solid transparent; transition: outline-color .15s;
}
.map-search-input:focus { outline-color: var(--sunset); }
.map-search-results {
  display: none; margin-top: 6px; background: #fff; border-radius: 14px;
  overflow: hidden; box-shadow: 0 8px 26px rgba(14,59,54,0.30);
}
.map-search-results.open { display: block; }
.map-search-results .ms-item {
  display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left;
  padding: 9px 14px; border: none; background: none; cursor: pointer; border-bottom: 1px solid #f0efea;
}
.map-search-results .ms-item:last-child { border-bottom: none; }
.map-search-results .ms-item:hover { background: #fff4ec; }
.map-search-results .ms-name { font-weight: 700; font-size: 14px; color: var(--teal-deep); }
.map-search-results .ms-sub { font-size: 11.5px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-search-results .ms-empty { padding: 11px 14px; font-size: 13px; color: #888; }
/* search result pin (a temporary, not-yet-a-stop marker) */
.search-pin {
  width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: linear-gradient(150deg, var(--amber), var(--sunset));
  border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}
.sp-pop b { font-family: var(--display); font-size: 15px; color: var(--teal-deep); }
.sp-pop .sp-sub { font-size: 11.5px; color: #888; margin: 2px 0 8px; }
.sp-pop .sp-add {
  display: inline-block; border: none; cursor: pointer; padding: 7px 12px; border-radius: 999px;
  font: 600 13px var(--body); color: #fff; background: linear-gradient(120deg, var(--amber), var(--sunset));
  box-shadow: 0 4px 12px rgba(255,106,43,0.32);
}
.sp-pop .sp-ro { font-size: 12px; color: #999; }

@media (max-width: 720px) {
  .map-search { width: calc(100% - 84px); }
}
#panel {
  width: 340px; height: 100%; box-sizing: border-box; overflow-y: auto;
  background: var(--bg); border-left: 1px solid #ddd; padding: 16px;
}
#panel .toolbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
#panel .toolbar .titlerow { display: flex; align-items: center; gap: 8px; }
#panel .toolbar .titlerow input { flex: 1; min-width: 0; font-family: var(--display); font-size: 18px; font-weight: 800; letter-spacing: -0.3px; color: var(--teal); }
.mode-select { display: flex; gap: 8px; }
.mode-select button {
  flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  cursor: pointer; font-size: 13px; color: var(--text);
}
.mode-select button.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.tool-btns { display: flex; flex-wrap: wrap; gap: 6px; }
#total {
  background: linear-gradient(120deg, var(--teal), var(--teal-deep)); color: #fff;
  border-radius: 12px; padding: 13px 15px; font-size: 14px; line-height: 1.5; margin-bottom: 14px;
}
#total b { font-size: 19px; font-family: var(--display); font-weight: 800; }
.help {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; color: #555; line-height: 1.55; margin-bottom: 14px;
}
.help b { color: var(--teal); }
.stop {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 6px; font-size: 13px;
  display: flex; align-items: center; gap: 6px;
}
.stop .num {
  flex: none; width: 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 50%; color: #fff; font-size: 11px; font-weight: bold;
}
.stop .stopname { min-width: 0; }
.stopdel {
  flex: none; width: 28px; height: 28px; border: none; border-radius: 7px;
  background: transparent; color: #bfb0ab; font-size: 13px; line-height: 1; cursor: pointer;
}
.stopdel:hover { background: #fdecea; color: #c0392b; }
.draghandle {
  flex: none; cursor: grab; color: #b0b0ac; font-size: 16px; line-height: 1;
  padding: 2px 4px; user-select: none; touch-action: none;
}
.draghandle:active { cursor: grabbing; }
.stoprow.dragging .stop { box-shadow: 0 4px 14px rgba(0,0,0,0.18); opacity: 0.92; }
.stoprow.dragging { opacity: 0.97; }
.leg { font-size: 11px; color: var(--gold); margin: 2px 0 6px 26px; }
.climb { color: var(--sunset); font-weight: 700; }   /* cumulative climb (bike) */

.export-btns { display: flex; flex-direction: column; gap: 8px; }
.export-btns .btn { width: 100%; text-align: left; }
.export-btns .btn span { font-weight: 400; opacity: 0.8; font-size: 12px; }
.loading { color: #999; font-style: italic; }
.btns { display: flex; gap: 8px; margin-bottom: 14px; }
#undoBtn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--teal); font-size: 19px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); transition: background 0.15s, transform 0.1s;
}
#undoBtn:hover:not(:disabled) { background: #eef3f2; }
#undoBtn:active:not(:disabled) { transform: scale(0.93); }
#undoBtn:disabled { opacity: 0.35; cursor: default; }

/* AI panel */
#aiPanel { display: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
#aiPanel.open { display: block; }
#aiPanel h3 { margin: 0 0 8px; font-size: 14px; color: var(--teal); }
#aiPanel .ai-modes { display: flex; gap: 12px; margin: 8px 0; font-size: 13px; }
#aiPanel label.radio { display: flex; align-items: center; gap: 5px; cursor: pointer; }
#aiMsg { font-size: 12px; margin-top: 8px; color: var(--gold); }
.ai-spin { display: inline-block; animation: aispin 1.4s steps(8) infinite; }
@keyframes aispin { to { transform: rotate(360deg); } }
.ai-sep { height: 1px; background: var(--line); margin: 14px 0 12px; }
.ai-hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; line-height: 1.45; }
#aiHlMsg { font-size: 12px; margin-top: 8px; color: var(--gold); }

/* per-stop highlights + info */
.stop .stopmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.stop-hl { margin: 1px 0 0; padding-left: 15px; font-size: 11px; color: #6c7a76; line-height: 1.4; }
.stop-hl li { margin: 0; }
.stopinfo {
  flex: none; width: 28px; height: 28px; border: none; border-radius: 7px;
  background: #eef3f2; color: var(--teal); font-size: 14px; line-height: 1; cursor: pointer;
}
.stopinfo:hover { background: #dce8e6; }
.hl-list { margin: 4px 0 14px; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--text); }
.hl-list li { margin: 0 0 4px; }
#modalCard .field { font-size: 12px; color: var(--muted); font-weight: 700; margin: 12px 0 0; text-transform: uppercase; letter-spacing: 0.4px; }

/* ---- Info window (ported verbatim) ---- */
#infoOverlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.45); align-items: center; justify-content: center;
}
#infoOverlay.open { display: flex; }
#infoCard {
  background: #fff; width: min(460px, 92vw); max-height: 88vh; overflow-y: auto;
  border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,0.35); position: relative;
}
#infoClose {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
  border: none; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 18px; line-height: 30px; cursor: pointer; z-index: 2;
}
#infoGallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px;
  background: #eceae6; border-radius: 14px 14px 0 0; overflow: hidden; min-height: 96px;
}
#infoGallery a { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #e2e0db; }
#infoGallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
#infoGallery a:hover img { transform: scale(1.06); }
#infoGallery .galmsg {
  grid-column: 1 / -1; padding: 28px 12px; text-align: center;
  color: #999; font-style: italic; font-size: 13px;
}
#infoBody { padding: 16px 18px 18px; }
#infoTitle { margin: 0 0 8px; font-size: 19px; color: var(--teal); }
#infoText { font-size: 14px; line-height: 1.6; color: #333; margin: 0 0 14px; }
#infoText.muted { color: #999; font-style: italic; }
#infoLink {
  display: inline-block; font-size: 13px; font-weight: bold; text-decoration: none;
  color: #fff; background: var(--teal); padding: 8px 14px; border-radius: 8px;
}
#infoLink.secondary { background: var(--blue); margin-left: 8px; }

/* ---- Generic modal ---- */
#modalOverlay {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.45); align-items: center; justify-content: center;
}
#modalOverlay.open { display: flex; }
#modalCard {
  background: #fff; width: min(440px, 92vw); max-height: 88vh; overflow-y: auto;
  border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,0.35); position: relative;
  padding: 22px 22px 20px;
}
#modalClose {
  position: absolute; top: 10px; right: 12px; width: 28px; height: 28px;
  border: none; border-radius: 50%; background: #eee; color: #555;
  font-size: 17px; line-height: 28px; cursor: pointer;
}
#modalCard h2 { color: var(--teal); font-size: 18px; margin: 0 0 14px; }
#modalCard .modal-row { margin-bottom: 12px; }
.share-list { margin-top: 8px; }
.share-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; margin-bottom: 6px; font-size: 13px;
}

/* ---- Toast ---- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--teal); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: bold; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 2000;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Photo lightbox ---- */
#rpLightbox {
  display: none; position: fixed; inset: 0; z-index: 1300;
  background: rgba(0,0,0,0.85); align-items: center; justify-content: center;
}
#rpLightbox.open { display: flex; }
#rpLightbox .lb-img {
  max-width: 92vw; max-height: 84vh; border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0,0,0,0.6); background: #222;
}
#rpLightbox .lb-close {
  position: absolute; top: 16px; right: 18px; width: 38px; height: 38px;
  border: none; border-radius: 50%; background: rgba(255,255,255,0.15); color: #fff;
  font-size: 22px; line-height: 38px; cursor: pointer;
}
#rpLightbox .lb-close:hover { background: rgba(255,255,255,0.3); }
#rpLightbox .lb-link {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; text-decoration: none;
  background: rgba(0,0,0,0.5); padding: 7px 14px; border-radius: 999px;
}
#rpLightbox .lb-link:hover { background: rgba(0,0,0,0.75); }
#rpLightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 66px; border: none; border-radius: 8px;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 34px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#rpLightbox .lb-nav:hover { background: rgba(255,255,255,0.28); }
#rpLightbox .lb-prev { left: 14px; }
#rpLightbox .lb-next { right: 14px; }
#rpLightbox .lb-count {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; background: rgba(0,0,0,0.45); padding: 4px 10px; border-radius: 999px;
}
@media (max-width: 720px) { #rpLightbox .lb-nav { width: 40px; height: 56px; font-size: 28px; } }

/* editable stop name (manual rename) */
.stop.editable .stopname { cursor: text; border-bottom: 1px dashed transparent; }
.stop.editable .stopname:hover { border-bottom-color: var(--line); }
.snaprow { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #555; cursor: pointer; user-select: none; }

/* ---- Mobile: stack the editor (full-width map on top, route list below) ---- */
@media (max-width: 720px) {
  #view.fullbleed { overflow: auto; -webkit-overflow-scrolling: touch; }
  #editor-wrap { flex-direction: column; height: auto; min-height: 100%; }
  #map { flex: none; width: 100%; height: 68vh; min-height: 360px; }
  #panel { width: 100%; height: auto; border-left: none; border-top: 1px solid #ddd; }
  /* topbar: let the email shrink/truncate so the layout doesn't overflow */
  .topbar-email { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* dashboard route cards: stack actions below the title instead of overlapping */
  .route-row { flex-wrap: wrap; align-items: flex-start; }
  .route-row .grow { flex: 1 1 calc(100% - 48px); }
  .route-row .row-actions { flex-basis: 100%; margin-top: 10px; }
  .route-row .row-actions .btn { flex: 1 1 auto; text-align: center; }
  .dash-actions { width: 100%; }
  .dash-actions .btn { flex: 1 1 auto; text-align: center; }
}
