/* =========================================================
   AquaTrack — Global Styles
   ========================================================= */

:root {
  --primary:        #0ea5e9;
  --primary-dark:   #0284c7;
  --primary-light:  #e0f2fe;
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --success:        #22c55e;
  --success-light:  #dcfce7;
  --warning:        #f59e0b;
  --warning-light:  #fef3c7;
  --gray-50:        #f8fafc;
  --gray-100:       #f1f5f9;
  --gray-200:       #e2e8f0;
  --gray-300:       #cbd5e1;
  --gray-400:       #94a3b8;
  --gray-500:       #64748b;
  --gray-600:       #475569;
  --gray-700:       #334155;
  --gray-800:       #1e293b;
  --gray-900:       #0f172a;
  --radius:         10px;
  --shadow:         0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:      0 4px 6px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 15px rgba(0,0,0,.10), 0 4px 6px rgba(0,0,0,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}

/* ---- Utilities ---- */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }

/* ---- Spinner ---- */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
.spinner-dark {
  border-color: rgba(0,0,0,.15);
  border-top-color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem;
  border-radius: 99px;
  font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.badge-blue   { background: var(--primary-light); color: var(--primary-dark); }
.badge-green  { background: var(--success-light); color: #15803d; }
.badge-red    { background: var(--danger-light);  color: #b91c1c; }
.badge-yellow { background: var(--warning-light); color: #b45309; }
.badge-gray   { background: var(--gray-200);      color: var(--gray-600); }

/* ---- Buttons ---- */
.btn, .btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  font-size: .9rem; font-weight: 600;
  transition: all .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: white; }
.btn-primary:hover  { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger   { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success  { background: var(--success); color: white; }
.btn-success:hover { background: #16a34a; }
.btn-ghost    { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-full { width: 100%; }
.btn:disabled, button:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.05rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; margin-bottom: .35rem;
  font-size: .85rem; font-weight: 600; color: var(--gray-700);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: .95rem;
  background: white;
  color: var(--gray-800);
  transition: border-color .15s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .78rem; color: var(--gray-500); margin-top: .25rem; }

/* ---- Cards ---- */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: .75rem;
}
.card-body { padding: 1.25rem; }
.card-footer {
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* ---- Error / Success banners ---- */
.error-banner {
  padding: .75rem 1rem;
  background: var(--danger-light);
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
}
.success-banner {
  padding: .75rem 1rem;
  background: var(--success-light);
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;   /* not inset: iOS < 14.5 ignores it */
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal {
  background: white;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: 1.4rem; line-height: 1;
  padding: .25rem; border-radius: 6px;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-600); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex; justify-content: flex-end; gap: .75rem;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0c4a6e 0%, #0ea5e9 60%, #38bdf8 100%);
}
.login-container {
  background: white;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo { margin-bottom: 1rem; }
.login-title { font-size: 1.75rem; font-weight: 800; color: var(--gray-900); }
.login-subtitle { color: var(--gray-500); margin-bottom: 2rem; font-size: .9rem; }
.login-form { text-align: left; }
.login-footer { color: var(--gray-400); font-size: .78rem; margin-top: 1.5rem; }

/* =============================================
   MANAGER LAYOUT
   ============================================= */
.manager-layout {
  display: flex; height: 100vh; overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--gray-900);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar-brand {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .75rem;
}
.sidebar-brand svg { flex-shrink: 0; }
.sidebar-brand-text { color: white; font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.sidebar-brand-text span { display: block; font-size: .7rem; font-weight: 400; color: var(--gray-400); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem 0; }
.nav-section-label {
  padding: .4rem 1rem;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--gray-500);
  margin-top: .5rem;
}
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem;
  color: var(--gray-400);
  cursor: pointer;
  transition: all .15s;
  font-size: .9rem; font-weight: 500;
  border-left: 3px solid transparent;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: rgba(14,165,233,.15); color: var(--primary); border-left-color: var(--primary); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.user-info {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .75rem;
  border-radius: 8px;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.user-name { color: white; font-size: .85rem; font-weight: 600; }
.user-role { color: var(--gray-500); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.btn-logout {
  margin-top: .5rem; width: 100%;
  background: rgba(255,255,255,.06);
  color: var(--gray-400);
  border: 1px solid rgba(255,255,255,.1);
  padding: .5rem; border-radius: 8px;
  cursor: pointer; font-size: .8rem;
  transition: all .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.12); color: white; }

/* Main content */
.manager-main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; background: var(--gray-50);
}
.manager-topbar {
  padding: 1rem 1.5rem;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 1rem;
  flex-shrink: 0;
}
.manager-topbar h1 { font-size: 1.2rem; font-weight: 700; color: var(--gray-900); }
.manager-content { position: relative; flex: 1; overflow: hidden; padding: 0; }

/* ---- Views (panels): visibility-based switch — layout dimensions always preserved ----
   Using position:absolute + visibility:hidden instead of display:none means every view
   always has correct computed dimensions. This is critical for Leaflet: its internal
   ResizeObserver fires on #mapContainer and must never see 0×0, which display:none
   and height:0 both cause. visibility:hidden hides content without collapsing layout. */
.view {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;   /* not inset: iOS < 14.5 ignores it */
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  padding: 1.5rem;
}
.view.active {
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}
#view-schedule.active { display: flex; }

/* Map view: always flex-column, always rendered at full size.
   #mapContainer fills remaining space via flex:1 — no magic vh math needed. */
#view-map {
  display: flex;
  flex-direction: column;
  padding: .75rem;
  gap: .75rem;
  overflow: hidden;
}


/* =============================================
   POOLS / LOCATIONS LIST
   ============================================= */
.pool-filter-btn {
  padding: .3rem .85rem;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
  background: white;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: all .15s;
}
.pool-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.pool-filter-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

.pools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.pool-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  border-left: 4px solid var(--primary);
  transition: box-shadow .15s;
}
.pool-card:hover { box-shadow: var(--shadow-md); }
/* The header holds a name and up to four buttons. It was a single non-wrapping flex row,
   so on a narrow card the last button (Del) simply ran off the right edge and sat outside
   the card. The row now wraps, and the name block is allowed to shrink — without
   min-width:0 a flex item refuses to go below its content width and forces the overflow
   back regardless of wrapping. */
.pool-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: .5rem; flex-wrap: wrap;
}
.pool-card-header > div:first-child { min-width: 0; flex: 1 1 9rem; }
.pool-card-tools {
  display: flex; flex-wrap: wrap; gap: .4rem;
  justify-content: flex-end; margin-left: auto;
}
.pool-card-name { font-weight: 700; font-size: 1rem; color: var(--gray-900); overflow-wrap: anywhere; }
.pool-card-client { font-size: .82rem; color: var(--gray-500); margin-top: .15rem; }
.pool-card-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.pool-card-actions { display: flex; gap: .5rem; margin-top: .85rem; }

/* Pool size colors */
.pool-card[data-size="small"] { border-left-color: #22c55e; }
.pool-card[data-size="medium"] { border-left-color: #0ea5e9; }
.pool-card[data-size="large"] { border-left-color: #8b5cf6; }
.pool-card[data-size="commercial"] { border-left-color: #f59e0b; }

/* =============================================
   SCHEDULE VIEW
   ============================================= */
.schedule-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1rem;
  min-width: 900px;
}
.schedule-day { min-width: 0; overflow: hidden; }
.schedule-day-header {
  text-align: center;
  padding: .5rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 700; font-size: .82rem;
}
.schedule-day-header .day-date { font-size: .7rem; opacity: .8; font-weight: 400; }
.schedule-day-body {
  border: 1.5px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: white;
  min-height: 300px;
  padding: .5rem;
}
.schedule-stop {
  background: rgba(147, 197, 253, 0.22);
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 6px;
  padding: .4rem .6rem;
  margin-bottom: .4rem;
  font-size: .78rem;
  cursor: grab;
  position: relative;
}
.schedule-stop .stop-time { font-weight: 700; color: #1d4ed8; }
.schedule-stop .stop-name { color: var(--gray-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-stop .stop-mins { color: var(--gray-500); font-size: .72rem; }
.schedule-stop .stop-remove {
  position: absolute; right: 4px; top: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: .85rem; line-height: 1;
  padding: 2px 4px; border-radius: 4px;
}
.schedule-stop .stop-remove:hover { background: var(--danger-light); color: var(--danger); }
.cancel-stop-row {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .5rem .6rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: white;
  cursor: pointer;
}
.cancel-stop-row:hover { background: var(--gray-50); }
.drop-zone-hint {
  text-align: center; color: var(--gray-300);
  font-size: .75rem; padding: 1rem .5rem;
  border: 2px dashed var(--gray-200);
  border-radius: 6px; margin-top: .25rem;
}
.drop-zone-hint.drag-over { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

.schedule-scroll-wrapper { overflow-x: auto; padding-bottom: 1rem; }

.add-stop-row {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 1rem; background: white; padding: .85rem; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.add-stop-row label { font-size: .82rem; font-weight: 600; color: var(--gray-600); }
.add-stop-row select,
.add-stop-row input[type="time"] {
  padding: .4rem .7rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: .85rem;
  background: white;
}

/* =============================================
   MAP VIEW
   ============================================= */
#mapContainer {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.map-legend {
  background: white; border-radius: 8px; box-shadow: var(--shadow);
  padding: .75rem 1rem;
  display: flex; gap: 1.25rem; flex-wrap: wrap;
  flex-shrink: 0;
}
.legend-item { display: flex; align-items: center; gap: .4rem; font-size: .8rem; }
.legend-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}

/* =============================================
   REPORTS VIEW
   ============================================= */
.report-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem;
}
.stat-label { font-size: .78rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--gray-900); line-height: 1.2; margin-top: .25rem; }
.stat-sub { font-size: .78rem; color: var(--gray-500); margin-top: .2rem; }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.success .stat-value { color: var(--success); }

.data-table {
  width: 100%; border-collapse: collapse; background: white;
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.data-table th {
  background: var(--gray-50);
  padding: .65rem 1rem;
  text-align: left; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
}
.data-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: .875rem;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }
.overage-cell { color: var(--danger); font-weight: 600; }
.on-time-cell { color: var(--success); font-weight: 600; }

/* =============================================
   TECH MOBILE VIEW
   ============================================= */
.tech-layout {
  display: flex; flex-direction: column; min-height: 100vh;
  background: var(--gray-50);
}
.tech-header {
  background: linear-gradient(135deg, #0c4a6e, #0ea5e9);
  color: white; padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
}
.tech-header-title { font-size: 1.1rem; font-weight: 800; }
.tech-header-date { font-size: .78rem; opacity: .8; }
.tech-header-gps {
  display: flex; align-items: center; gap: .35rem;
  font-size: .75rem; opacity: .85;
}
.gps-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #4ade80;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(.8); }
}
.gps-dot.off { background: #ef4444; animation: none; }

.tech-tabs {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
}
.tech-tab {
  flex: 1; padding: .75rem .5rem;
  text-align: center; font-size: .82rem; font-weight: 600; color: var(--gray-500);
  border-bottom: 3px solid transparent; cursor: pointer; transition: all .15s;
}
.tech-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tech-content { flex: 1; overflow-y: auto; padding: 1rem; }

/* ---- Today's Route ---- */
.route-list { display: flex; flex-direction: column; gap: .75rem; }
.route-item {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem;
  border-left: 4px solid var(--gray-300);
  cursor: pointer; transition: all .15s;
}
.route-item:hover { box-shadow: var(--shadow-md); }
.route-item.status-pending { border-left-color: var(--gray-300); }
.route-item.status-in_progress { border-left-color: var(--primary); background: var(--primary-light); }
.route-item.status-completed { border-left-color: var(--success); opacity: .75; }
.route-item.status-overdue { border-left-color: var(--danger); }

.route-item-header { display: flex; align-items: center; justify-content: space-between; }
.route-item-time { font-size: .78rem; font-weight: 700; color: var(--gray-500); }
.route-item-name { font-weight: 700; font-size: 1rem; margin-top: .2rem; }
.route-item-address { font-size: .82rem; color: var(--gray-500); margin-top: .1rem; }
.route-item-meta { display: flex; gap: .5rem; margin-top: .6rem; }

/* ---- Active Stop Card ---- */
.active-stop {
  background: white; border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden; margin-bottom: 1rem;
}
.active-stop-header {
  background: linear-gradient(135deg, #0c4a6e, #0ea5e9);
  color: white; padding: 1.25rem;
}
.active-stop-label { font-size: .75rem; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }
.active-stop-name { font-size: 1.3rem; font-weight: 800; margin-top: .25rem; }
.active-stop-address { font-size: .85rem; opacity: .85; margin-top: .25rem; }
.active-stop-body { padding: 1.25rem; }

/* Timer display */
.timer-section {
  display: flex; gap: 1rem; align-items: stretch;
  margin-bottom: 1.25rem;
}
.timer-box {
  flex: 1; background: var(--gray-50); border-radius: 10px;
  padding: .85rem; text-align: center;
}
.timer-box.overtime { background: var(--danger-light); }
.timer-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); }
.timer-box.overtime .timer-label { color: var(--danger); }
.timer-value {
  font-size: 2rem; font-weight: 800; color: var(--gray-900);
  font-variant-numeric: tabular-nums; margin-top: .25rem; line-height: 1;
}
.timer-box.overtime .timer-value { color: var(--danger); }
.timer-progress {
  height: 6px; border-radius: 3px; background: var(--gray-200);
  overflow: hidden; margin-top: .6rem;
}
.timer-progress-fill {
  height: 100%; border-radius: 3px;
  background: var(--success); transition: width .5s ease, background .5s ease;
}
.timer-progress-fill.warning { background: var(--warning); }
.timer-progress-fill.danger  { background: var(--danger); }

.arrive-btn {
  width: 100%; padding: 1.1rem;
  font-size: 1.15rem; font-weight: 800;
  border-radius: 12px; border: none; cursor: pointer;
  transition: all .15s; letter-spacing: .03em;
}
.arrive-btn.arrive { background: #10b981; color: white; }
.arrive-btn.arrive:hover { background: #059669; }
.arrive-btn.complete { background: #ef4444; color: white; }
.arrive-btn.complete:hover { background: #dc2626; }
.arrive-btn.skip { background: var(--gray-200); color: var(--gray-600); margin-top: .5rem; }

.stop-notes {
  margin-top: 1rem; background: var(--gray-50);
  border-radius: 8px; padding: .85rem;
  font-size: .85rem; color: var(--gray-600);
}
.stop-notes strong { color: var(--gray-800); }

/* ---- GPS Status panel ---- */
.gps-panel {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem; margin-bottom: 1rem;
}
.gps-status-row { display: flex; align-items: center; justify-content: space-between; }
.gps-coords { font-family: monospace; font-size: .78rem; color: var(--gray-500); margin-top: .4rem; }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .manager-layout { display: block; }
  .report-stats { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .report-stats { grid-template-columns: 1fr; }
}

/* =============================================
   Leaflet map overrides
   ============================================= */
.leaflet-container { font-family: inherit; }
.map-popup-name { font-weight: 700; font-size: .95rem; }
.map-popup-info { font-size: .8rem; color: #555; margin-top: .2rem; }
.tech-marker {
  background: #0ea5e9; color: white;
  border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .75rem;
  border: 3px solid white; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* =============================================
   Scrollbar
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* =============================================
   Empty states
   ============================================= */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--gray-400);
}
.empty-state svg { margin-bottom: 1rem; opacity: .5; }
.empty-state h3 { font-size: 1.05rem; color: var(--gray-600); margin-bottom: .35rem; }
.empty-state p { font-size: .85rem; }

/* =============================================
   T&M Badge
   ============================================= */
.badge-orange  { background: #fff7ed; color: #c2410c; }
.badge-purple  { background: #f5f3ff; color: #6d28d9; }

/* =============================================
   BILLING VIEW
   ============================================= */
.billing-section { margin-bottom: 1.5rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.billing-section-header { display: flex; justify-content: space-between; align-items: center; padding: .65rem 1rem; font-weight: 700; font-size: .88rem; color: var(--gray-800); }
.billing-table td, .billing-table th { white-space: nowrap; }
.billing-grand-total { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; background: var(--gray-900); color: white; border-radius: var(--radius); font-size: 1.05rem; font-weight: 700; margin-top: .5rem; }
.billing-invoice-summary { margin-top: .5rem; }
.billing-invoice-row { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .9rem; color: var(--gray-600); border-bottom: 1px solid var(--gray-100); }
.billing-invoice-total { display: flex; justify-content: space-between; padding: .7rem 0 .25rem; font-size: 1rem; font-weight: 700; color: var(--gray-900); border-top: 2px solid var(--gray-900); margin-top: .35rem; }

/* =============================================
   Route Search Bar (tech view)
   ============================================= */
.route-search-wrap {
  position: sticky; top: 0; z-index: 20;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: .65rem .85rem;
}
.route-search-box {
  display: flex; align-items: center; gap: .5rem;
  background: var(--gray-100);
  border: 1.5px solid var(--gray-200);
  border-radius: 30px;
  padding: .55rem .9rem;
  transition: border-color .15s;
}
.route-search-box:focus-within {
  border-color: var(--primary);
  background: white;
}
.route-search-box input {
  flex: 1; border: none; background: transparent;
  font-size: .95rem; color: var(--gray-800);
  outline: none; min-width: 0;
}
.route-search-box input::placeholder { color: var(--gray-400); }
.search-clear-btn {
  background: var(--gray-400); color: white;
  border: none; border-radius: 50%; cursor: pointer;
  width: 20px; height: 20px; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 1;
}

/* Search results dropdown */
.search-results {
  margin-top: .5rem;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-height: 55vh;
  overflow-y: auto;
}
.search-result-item {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background .1s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:active { background: var(--primary-light); }
.search-result-info { flex: 1; min-width: 0; }
.search-result-name { font-weight: 700; font-size: .95rem; color: var(--gray-900); }
.search-result-sub  { font-size: .78rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .1rem; }
.search-result-add  {
  background: var(--primary); color: white;
  border: none; border-radius: 10px; cursor: pointer;
  padding: .5rem 1rem; font-size: .85rem; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}
.search-result-added {
  background: var(--success-light); color: #15803d;
  border-radius: 10px; padding: .5rem 1rem;
  font-size: .85rem; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.search-no-results {
  padding: 1.5rem; text-align: center;
  color: var(--gray-400); font-size: .9rem;
}

/* =============================================
   Route Tab Header (tech view) — kept for reference
   ============================================= */
.route-tab-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 10;
}
.route-tab-header h3 { font-size: .95rem; font-weight: 700; color: var(--gray-800); }

/* =============================================
   Suggested Stops Section
   ============================================= */
.suggested-section-header {
  padding: .6rem 1rem .4rem;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: .5rem;
}
.route-item.suggested {
  border-left-color: var(--gray-300);
  background: var(--gray-50);
  opacity: .9;
}
.route-add-stop-footer {
  padding: 1rem;
  text-align: center;
  border-top: 1px solid var(--gray-100);
}

/* =============================================
   Bottom Sheet (pool picker / on-my-way)
   ============================================= */
.sheet-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;   /* not inset: iOS < 14.5 ignores it */
  background: rgba(0,0,0,.45);
  z-index: 900;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: white;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.18);
  z-index: 901;
  max-height: 80vh;
  /* dvh is the screen actually visible — on a phone, vh includes the part under Safari's
     toolbars, so an "80vh" sheet ran off the bottom. Browsers without dvh keep 80vh. */
  max-height: 85dvh;
  display: flex; flex-direction: column;
  animation: slideUp .25s ease;
}
/* A sheet is capped in height, so its body has to scroll inside it. Without this the body
   overflowed out of the bottom of the screen and took the sheet's buttons with it. */
.bottom-sheet > :not(.sheet-handle) { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--gray-300); border-radius: 2px;
  margin: .65rem auto .3rem;
  flex-shrink: 0;
}
.sheet-header {
  padding: .75rem 1.25rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.sheet-header h3 { font-size: 1.05rem; font-weight: 700; }
.sheet-close {
  background: var(--gray-100); border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
}
.sheet-search {
  padding: .75rem 1.25rem;
  flex-shrink: 0;
}
.sheet-search input {
  width: 100%; padding: .55rem .9rem;
  border: 1.5px solid var(--gray-300); border-radius: 30px;
  font-size: .9rem; outline: none;
}
.sheet-search input:focus { border-color: var(--primary); }
.sheet-list {
  overflow-y: auto;
  flex: 1;
  padding: 0 0 1rem;
}
.sheet-section-label {
  padding: .6rem 1.25rem .3rem;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-400);
  position: sticky; top: 0;
  background: white;
  border-bottom: 1px solid var(--gray-100);
}
.pool-picker-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background .1s;
}
.pool-picker-item:hover { background: var(--gray-50); }
.pool-picker-info { flex: 1; min-width: 0; }
.pool-picker-name { font-weight: 600; font-size: .9rem; }
.pool-picker-address { font-size: .78rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool-picker-add {
  background: var(--primary); color: white;
  border: none; border-radius: 8px; cursor: pointer;
  padding: .35rem .75rem; font-size: .8rem; font-weight: 600;
  white-space: nowrap;
}

/* =============================================
   On-My-Way Banner
   ============================================= */
.on-my-way-sheet {
  padding: 1.25rem;
  text-align: center;
}
.on-my-way-emoji { font-size: 2.5rem; margin-bottom: .5rem; }
.on-my-way-title { font-size: 1.2rem; font-weight: 800; color: var(--gray-900); margin-bottom: .25rem; }
.on-my-way-sub { font-size: .88rem; color: var(--gray-500); margin-bottom: 1.25rem; }
.on-my-way-btn {
  width: 100%; padding: .9rem;
  background: #25d366; color: white;
  border: none; border-radius: 12px; cursor: pointer;
  font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  text-decoration: none; margin-bottom: .5rem;
}
.on-my-way-btn:hover { background: #128c7e; }
.on-my-way-dismiss {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: .85rem; padding: .4rem 1rem;
}

/* =============================================
   Toasts
   ============================================= */
#toastContainer {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: .5rem;
  z-index: 9999;
}
/* Read at arm's length, outdoors, on a phone — not on a desk monitor. 14px in a 320px box
   was unreadable in the field, which is why errors came back to the office as "it said
   something". Bigger type, wider box, and room for the message to wrap. */
.toast {
  background: var(--gray-900); color: white;
  padding: .85rem 1.15rem; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 1rem; line-height: 1.4;
  display: flex; align-items: flex-start; gap: .65rem;
  animation: slideIn .25s ease;
  max-width: min(30rem, calc(100vw - 1.5rem));
}
.toast-icon { font-size: 1.15rem; line-height: 1.25; flex-shrink: 0; }
.toast-msg  { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Errors and warnings persist until tapped — see showToast(). */
.toast.sticky { cursor: pointer; padding-bottom: .6rem; flex-wrap: wrap; }
.toast-dismiss {
  width: 100%; font-size: .75rem; opacity: .75; text-align: right;
  margin-top: .3rem; font-weight: 600; letter-spacing: .02em;
}
/* On a phone the toast spans the width and sits above the bottom tab bar. */
@media (max-width: 620px) {
  .toast { font-size: 1.05rem; max-width: none; }
}
/* A bottom sheet puts its action buttons exactly where the toasts sit, so a toast fired
   while one is open covers Save. When a sheet is up, toasts move to the top of the screen
   instead. Browsers without :has() simply ignore this and keep the old placement. */
body:has(.bottom-sheet:not(.hidden)) #toastContainer,
body:has(.modal-overlay:not(.hidden)) #toastContainer {
  bottom: auto;
  top: 1rem;
}
.toast.success { background: #15803d; }
.toast.error   { background: #b91c1c; }
.toast.warning { background: #b45309; }
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ---- Assign Stop: drag-to-reorder ---- */
.drag-handle {
  cursor: grab;
  color: var(--gray-300);
  font-size: 1.05rem;
  padding: .1rem .15rem;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
  transition: color .15s;
}
.drag-handle:hover { color: var(--gray-400); }
.drag-handle:active { cursor: grabbing; }

.stop-drag-row { transition: background .12s, opacity .12s; border-radius: 6px; }
.stop-drag-row.dragging { opacity: .4; }
.stop-drag-row.drag-over { background: #f0f9ff !important; outline: 2px dashed #7dd3fc; outline-offset: -2px; border-radius: 6px; }

/* ---- Desktop: cap tech PWA to phone-width column ---- */
@media (min-width: 720px) {
  body.tech-body { background: #cbd5e1; display: flex; justify-content: center; }
  .tech-layout {
    max-width: 680px;
    width: 100%;
    min-height: 100vh;
    box-shadow: 0 0 60px rgba(0,0,0,.2);
  }
}

/* ---- Route tab: info bar (GPS pill + refresh) ---- */
.route-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem .25rem .1rem;
  gap: .5rem;
}
.route-gps-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  padding: .2rem .6rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: default;
}
.route-gps-pill .gps-dot { width: 7px; height: 7px; }
.route-refresh-btn {
  border: 1.5px solid var(--gray-200);
  background: white;
  border-radius: 8px;
  padding: .22rem .55rem;
  font-size: .8rem;
  cursor: pointer;
  color: var(--gray-500);
  font-family: inherit;
  font-weight: 600;
  transition: all .12s;
  white-space: nowrap;
}
.route-refresh-btn:active { background: var(--gray-50); color: var(--primary); border-color: var(--primary); }

/* ---- Route summary bar ---- */
.route-summary-bar {
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: .55rem .85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  color: var(--gray-600);
  font-weight: 600;
  margin-bottom: .25rem;
}
.route-summary-bar .summary-stat { color: var(--gray-800); }
.route-summary-bar .summary-sep { color: var(--gray-300); }

/* ============================================================
   Apprentice Calendar (manager view)
   ============================================================ */

.appr-cal-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
}
.appr-cal-nav-title {
  font-size: .98rem;
  font-weight: 700;
  color: var(--gray-700);
  flex: 1;
  text-align: center;
}

.appr-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.appr-cal-dow {
  text-align: center;
  font-size: .6rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .25rem 0;
}
.appr-cal-cell {
  border-radius: 8px;
  padding: .35rem .1rem .3rem;
  cursor: pointer;
  text-align: center;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  transition: filter .12s;
  position: relative;
  border-style: solid;
  border-width: 1.5px;
}
.appr-cal-cell:hover { filter: brightness(.93); }
.appr-cal-cell:active { filter: brightness(.86); }
.appr-cal-cell.empty  { background: transparent !important; border: none !important; cursor: default; }
.appr-cal-cell.today  { outline: 2.5px solid #3b82f6; outline-offset: -2px; }
.appr-cal-cell.past   { opacity: .65; }

.appr-cal-cell-day   { font-size: .65rem; font-weight: 600; opacity: .75; }
.appr-cal-cell-name  { font-size: .6rem;  font-weight: 700; line-height: 1.15; }
.appr-cal-cell-check { font-size: .65rem; color: #059669; font-weight: 700; }
.appr-cal-cell-ovr   {
  position: absolute; top: 2px; right: 3px;
  font-size: .45rem; opacity: .65;
}

.appr-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .55rem;
  align-items: center;
}
.appr-legend-item {
  font-size: .65rem;
  font-weight: 700;
  border-radius: 20px;
  padding: .15rem .55rem;
}
.appr-legend-note { font-size: .62rem; color: var(--gray-400); }

/* ---- Rotation settings editor ---- */
.appr-rot-grid {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .35rem 0;
}
.appr-rot-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.appr-rot-day {
  font-size: .83rem;
  font-weight: 600;
  color: var(--gray-600);
  width: 92px;
  flex-shrink: 0;
}
.appr-rot-sel {
  flex: 1;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .38rem .65rem;
  font-size: .85rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.appr-rot-sel:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ---- Apprentice week schedule (apprentice app) ---- */
.appr-week-sched-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: .2rem 0;
}
.appr-week-cell {
  border-radius: 8px;
  padding: .4rem .1rem .35rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-style: solid;
  border-width: 1.5px;
}
.appr-week-dow  { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .7; }
.appr-week-date { font-size: .88rem; font-weight: 700; }
.appr-week-tag  { font-size: .52rem; font-weight: 700; margin-top: 1px; }

/* ============================================================
   MAP SEARCH — floating panel over the Leaflet canvas
   Modelled on Google/Apple Maps: a rounded card top-left, results
   hanging beneath it, and a detail card once a place is chosen.
   Leaflet's own panes run to z-index ~700, so these sit above that.
   ============================================================ */
#mapSearchBox {
  position: absolute; top: .75rem; left: .75rem; z-index: 900;
  width: min(23rem, calc(100% - 1.5rem));
  background: #fff; border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.16), 0 8px 24px rgba(0,0,0,.12);
  overflow: hidden;
}
#mapSearchInputRow { display: flex; align-items: center; gap: .5rem; padding: .1rem .6rem; }
#mapSearchIcon { font-size: .95rem; opacity: .7; flex-shrink: 0; }
#mapSearchInput {
  flex: 1; border: none; outline: none; background: transparent;
  padding: .7rem 0; font-size: .92rem; font-family: inherit; color: var(--gray-800);
}
#mapSearchInput::placeholder { color: var(--gray-400); }
#mapSearchClear {
  display: none; border: none; background: var(--gray-100); color: var(--gray-600);
  width: 1.35rem; height: 1.35rem; border-radius: 50%; cursor: pointer;
  font-size: 1rem; line-height: 1; flex-shrink: 0;
}
#mapSearchClear:hover { background: var(--gray-200); }
#mapSearchBox.has-text #mapSearchClear { display: block; }

#mapSearchResults { display: none; border-top: 1px solid var(--gray-100); max-height: 21rem; overflow-y: auto; }
#mapSearchBox.open #mapSearchResults { display: block; }
.map-search-item {
  padding: .55rem .75rem; cursor: pointer; border-bottom: 1px solid var(--gray-100);
  display: flex; gap: .55rem; align-items: flex-start;
}
.map-search-item:last-child { border-bottom: none; }
.map-search-item:hover,
.map-search-item.active { background: var(--primary-light, #e0f2fe); }
.map-search-item .pin { font-size: .9rem; opacity: .65; margin-top: .1rem; }
.map-search-item .ttl { font-size: .85rem; font-weight: 600; color: var(--gray-800); }
.map-search-item .sub { font-size: .75rem; color: var(--gray-500); margin-top: .05rem; }
.map-search-note { padding: .6rem .75rem; font-size: .78rem; color: var(--gray-500); }

#mapPlaceCard {
  display: none; position: absolute; bottom: .75rem; left: .75rem; z-index: 900;
  width: min(23rem, calc(100% - 1.5rem));
  background: #fff; border-radius: 12px; padding: .8rem .9rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.16), 0 8px 24px rgba(0,0,0,.12);
}
#mapPlaceCard.open { display: block; }
#mapPlaceClose {
  position: absolute; top: .5rem; right: .5rem; border: none; background: var(--gray-100);
  color: var(--gray-600); width: 1.4rem; height: 1.4rem; border-radius: 50%;
  cursor: pointer; font-size: 1rem; line-height: 1;
}
#mapPlaceName  { font-size: .95rem; font-weight: 700; color: var(--gray-800); padding-right: 1.5rem; }
#mapPlaceAddr  { font-size: .8rem; color: var(--gray-600); margin-top: .15rem; }
#mapPlaceCoords{ font-size: .72rem; color: var(--gray-400); margin-top: .2rem; font-variant-numeric: tabular-nums; }
#mapPlaceNearby{ font-size: .76rem; margin-top: .45rem; }
#mapPlaceActions { display: flex; gap: .45rem; margin-top: .65rem; }
#mapPlaceActions button { flex: 1; }
#mapPlaceHint  { font-size: .72rem; color: var(--gray-400); margin-top: .5rem; text-align: center; }

#mapMovePinRow { display: none; margin-top: .55rem; }
#mapMovePinRow.open { display: block; }
#mapMovePinSearch {
  width: 100%; border: 1.5px solid var(--gray-200); border-radius: 8px;
  padding: .4rem .55rem; font-size: .82rem; font-family: inherit;
}
#mapMovePinResults { max-height: 10rem; overflow-y: auto; margin-top: .3rem; }
