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

:root {
  --accent:       #F5B731;
  --accent-dim:   #c8922a;
  --bg:           #0d1117;
  --sidebar:      #131923;
  --card:         #1a2233;
  --card-hover:   #1f2a40;
  --border:       #242f42;
  --border-light: #2e3d57;
  --input-bg:     #1a2233;
  --text-primary: #e8eaf0;
  --text-muted:   #6b7a99;
  --text-dim:     #3d4f6b;
  --green:        #4ade80;
  --orange:       #fb923c;
  --red:          #f87171;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

#layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#sidebar {
  width: 390px;
  min-width: 390px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

#sidebar header {
  padding: 20px 20px 16px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

#sidebar header h1 {
  display: flex;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
}

#map {
  flex: 1;
  height: 100%;
  position: relative;
}

section {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

section h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

.field {
  position: relative;
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  padding: 9px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
}

.field input::placeholder {
  color: var(--text-dim);
}

.field-row {
  display: flex;
  gap: 10px;
}

.field-row .field {
  flex: 1;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 6px 6px;
  list-style: none;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.suggestions li {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.suggestions li:hover {
  background: var(--card-hover);
}

.suggestions li:last-child {
  border-bottom: none;
}

.summary-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.summary-actions .btn-primary,
.summary-actions .btn-secondary {
  width: auto;
  flex: 1;
  margin-top: 0;
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  letter-spacing: 0.3px;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
  background: #e8a820;
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-secondary {
  width: 100%;
  padding: 8px;
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-light);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all 0.15s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  border-style: solid;
}

.rp-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: flex-end;
  transition: box-shadow 0.1s;
}

.rp-row.dragging { opacity: 0.3; }
.rp-row.drag-over-top    { box-shadow: 0 -2px 0 0 var(--accent); }
.rp-row.drag-over-bottom { box-shadow: 0 2px 0 0 var(--accent); }

.rp-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: -3px;
  line-height: 1;
  padding-bottom: 9px;
  align-self: flex-end;
  user-select: none;
  flex-shrink: 0;
  transition: color 0.15s;
}

.rp-handle:hover  { color: var(--text-muted); }
.rp-handle:active { cursor: grabbing; }

.rp-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 13px;
}

.rp-indicator.origin      { background: var(--green); }
.rp-indicator.destination { background: var(--accent); }
.rp-indicator.waypoint    { background: var(--orange); }

.rp-row .field { flex: 1; margin-bottom: 0; }

.rp-remove {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 8px;
  font-size: 16px;
  align-self: flex-end;
  height: 36px;
  transition: all 0.15s;
}

.rp-remove:hover {
  border-color: var(--red);
  color: var(--red);
}

.waypoint-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: flex-end;
  transition: box-shadow 0.1s;
}

.waypoint-row.dragging { opacity: 0.3; }
.waypoint-row.drag-over-top    { box-shadow: 0 -2px 0 0 var(--accent); }
.waypoint-row.drag-over-bottom { box-shadow: 0 2px 0 0 var(--accent); }

.waypoint-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: -3px;
  line-height: 1;
  padding-bottom: 9px;
  align-self: flex-end;
  user-select: none;
  flex-shrink: 0;
  transition: color 0.15s;
}

.waypoint-handle:hover  { color: var(--text-muted); }
.waypoint-handle:active { cursor: grabbing; }

.waypoint-row .field { flex: 1; margin-bottom: 0; }

.waypoint-remove {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 8px;
  font-size: 16px;
  align-self: flex-end;
  height: 36px;
  transition: all 0.15s;
}

.waypoint-remove:hover {
  border-color: var(--red);
  color: var(--red);
}

#route-summary {
  font-size: 13px;
  line-height: 2;
}

#route-summary strong {
  color: var(--accent);
}

.risk-item {
  background: var(--card);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
}

.toll-info {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.9;
}

.toll-info strong {
  color: var(--accent);
}

.fuel-stop-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
}

.fuel-stop-card.critical {
  border-color: var(--red);
}

.fuel-stop-card h3 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.fuel-stop-card.critical h3 {
  color: var(--red);
}

.fuel-stop-card .distance {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.fuel-stop-card .stations {
  font-size: 11px;
  color: var(--text-muted);
}

.fuel-stop-card .station-item {
  padding-top: 5px;
  margin-top: 5px;
  border-top: 1px solid var(--border);
}

.weather-badge {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.weather-badge .weather-icon {
  font-size: 16px;
}

.weather-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.weather-origin-card,
.weather-dest-card {
  border-color: #38bdf8;
}

#chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  max-height: 280px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
  max-width: 88%;
}

.chat-msg.user {
  background: var(--card-hover);
  align-self: flex-end;
  border-radius: 10px 10px 2px 10px;
  border: 1px solid var(--border-light);
}

.chat-msg.assistant {
  background: var(--card);
  align-self: flex-start;
  border-radius: 10px 10px 10px 2px;
  border: 1px solid var(--border);
}

.chat-msg.loading {
  color: var(--text-muted);
  font-style: italic;
}

#chat-input-row {
  display: flex;
  gap: 8px;
}

#chat-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}

#chat-input:focus {
  border-color: var(--accent);
}

#chat-input::placeholder {
  color: var(--text-dim);
}

#chat-send-btn {
  padding: 9px 14px;
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

#chat-send-btn:hover {
  background: #e8a820;
}

.user-location-marker {
  width: 14px;
  height: 14px;
  background: #3b9edd;
  border: 2px solid #fff;
  border-radius: 50%;
  position: relative;
}

.user-location-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(59, 158, 221, 0.35);
  animation: location-pulse 1.8s ease-out infinite;
}

@keyframes location-pulse {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; }
}

.loading-spinner {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}

#ai-route-description {
  width: 100%;
  min-height: 84px;
  padding: 9px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

#ai-route-description:focus {
  border-color: var(--accent);
}

#ai-route-description::placeholder {
  color: var(--text-dim);
}

#ai-parse-status {
  font-size: 11px;
  margin-top: 6px;
  min-height: 14px;
  color: var(--text-muted);
}

.wp-popup .leaflet-popup-content-wrapper {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 0;
}

.wp-popup .leaflet-popup-tip {
  background: var(--card);
}

.wp-popup .leaflet-popup-content {
  margin: 0;
}

.wp-popup-inner {
  padding: 12px 16px;
  text-align: center;
}

.wp-popup-coords {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-family: monospace;
}

.wp-popup-inner button {
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.wp-popup-inner button:hover {
  background: #e8a820;
}

/* Header e tabs */

#header-top {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.moto-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
  margin-right: 8px;
}

#user-widget {
  margin-bottom: 14px;
}

#tabs {
  display: flex;
  gap: 6px;
}

.tab-btn {
  flex: 1;
  padding: 7px 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}

.tab-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d1117;
}

/* User widget */

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  cursor: default;
}

a.user-role {
  cursor: pointer;
}

.role-root        { background: var(--accent);        color: #0d1117; }
.role-colaborador { background: var(--orange);        color: #0d1117; }
.role-assinante   { background: #7c3aed;              color: #fff;    }
.role-default     { background: var(--border-light);  color: var(--text-muted); }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 7px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn-google-login {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-google-login:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Cards de rotas */

.route-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin: 0 16px 10px;
  transition: border-color 0.15s;
}

.route-card:hover {
  border-color: var(--border-light);
}

.route-card-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}

.route-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.route-period-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.btn-route-rename {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 3px;
}

.btn-route-rename:hover { color: var(--accent); }
.btn-route-rename svg   { width: 11px; height: 11px; }

.route-rename-input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 1px 6px;
  outline: none;
  min-width: 0;
  width: 100%;
}

.route-times {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.route-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-planned { background: rgba(74,222,128,0.12); color: var(--green); }
.badge-gpx     { background: rgba(251,146,60,0.12);  color: var(--orange); }
.badge-iconic  { background: rgba(249,115,22,0.15);  color: #f97316; }

.routes-section { display: flex; flex-direction: column; }
.routes-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 8px 20px 4px;
}

.route-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.route-card-actions {
  display: flex;
  gap: 6px;
}

.route-card-actions button {
  flex: 1;
  padding: 6px 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-route-view:hover   { border-color: var(--green);  color: var(--green); }
.btn-route-gpx:hover    { border-color: var(--accent); color: var(--accent); }
.btn-route-delete:hover { border-color: var(--red);    color: var(--red); }

.routes-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

#routes-header-section,
#garage-header-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#routes-header-section h2,
#garage-header-section h2 {
  margin-bottom: 0;
}

/* Cards de motos */

.moto-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin: 0 16px 10px;
  transition: border-color 0.15s;
}

.moto-card:hover {
  border-color: var(--border-light);
}

.moto-card-header {
  margin-bottom: 6px;
}

.moto-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.moto-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.moto-card-actions {
  display: flex;
  gap: 6px;
}

.moto-card-actions button {
  flex: 1;
  padding: 6px 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-moto-edit:hover   { border-color: var(--green); color: var(--green); }
.btn-moto-delete:hover { border-color: var(--red);   color: var(--red); }

#garage-select-row select {
  width: 100%;
  padding: 9px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  margin-top: 6px;
  transition: border-color 0.15s;
}

#garage-select-row select:focus {
  border-color: var(--accent);
}

#garage-form-section {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

#elevation-chart {
  position: absolute;
  bottom: 30px;
  left: 20px;
  right: auto;
  z-index: 1000;
  background: rgba(13, 17, 23, 0.9);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 10px;
  width: 560px;
  pointer-events: auto;
}

#elevation-chart-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

#elevation-chart-header span:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

#elevation-chart-minmax {
  flex: 1;
  text-align: right;
}

#elevation-chart-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  line-height: 1;
}

#elevation-chart-close:hover {
  color: var(--text-primary);
}

#elevation-svg {
  width: 100%;
  height: 130px;
  display: block;
}

.route-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 14px;
}

.route-card-stats span {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 4px;
  padding: 2px 6px;
}

.map-north-indicator {
  background: rgba(13, 17, 23, 0.88);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  user-select: none;
}

.north-arrow {
  width: 16px;
  height: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.north-needle {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.north-needle-up {
  border-bottom: 12px solid #e94560;
}

.north-needle-down {
  border-top: 12px solid var(--text-dim);
}

.map-north-indicator span {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}

.map-locate-btn a {
  font-size: 18px;
  line-height: 30px !important;
  text-decoration: none;
  color: var(--text-primary) !important;
  background: rgba(13, 17, 23, 0.88) !important;
  border-color: var(--border-light) !important;
}

.map-locate-btn a:hover {
  color: var(--accent) !important;
}

.gpx-stop-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 1px 5px rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gpx-stop-pin svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
  display: block;
}

@keyframes fuel-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(21,101,192,0.5), 0 1px 5px rgba(0,0,0,.55); }
  50%       { box-shadow: 0 0 0 6px rgba(21,101,192,0), 0 1px 5px rgba(0,0,0,.55); }
}

@keyframes fuel-pulse-critical {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233,69,96,0.6), 0 1px 5px rgba(0,0,0,.55); }
  50%       { box-shadow: 0 0 0 8px rgba(233,69,96,0), 0 1px 5px rgba(0,0,0,.55); }
}

.fuel-stop-pin {
  animation: fuel-pulse 2s ease-in-out infinite;
}

.fuel-stop-critical {
  animation: fuel-pulse-critical 1.5s ease-in-out infinite;
}

.poi-pin-glyph {
  font-family: 'Noto Emoji', sans-serif;
  font-size: 11px;
  line-height: 1;
  color: #fff;
  font-style: normal;
  user-select: none;
}

.leaflet-control-layers {
  background: rgba(13, 17, 23, 0.88) !important;
  border-color: var(--border-light) !important;
  color: var(--text-primary) !important;
  font-size: 12px;
}

.leaflet-control-layers label {
  color: var(--text-primary) !important;
}

.leaflet-bar a {
  background: rgba(13, 17, 23, 0.88) !important;
  border-color: var(--border-light) !important;
  color: var(--text-primary) !important;
}

.leaflet-bar a:hover {
  background: var(--card-hover) !important;
}

#app-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: modal-fade-in 0.15s ease;
}

#app-modal-overlay.hidden {
  display: none;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#app-modal {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  width: 420px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: modal-slide-in 0.15s ease;
}

@keyframes modal-slide-in {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

#app-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

#app-modal-title {
  font-weight: 600;
  font-size: 15px;
}

#app-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
}

#app-modal-close:hover {
  color: var(--text-primary);
}

#app-modal-body {
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

#app-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger:hover {
  background: #ef4444;
}

.route-play-dot {
  width: 16px;
  height: 16px;
  background: #e94560;
  border: 2px solid #fff;
  border-radius: 50%;
  position: relative;
}

.route-play-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(233, 69, 96, 0.4);
  animation: route-pulse 1.2s ease-out infinite;
}

@keyframes route-pulse {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(3);   opacity: 0; }
}

.map-play-control a {
  font-size: 14px;
  line-height: 30px !important;
  text-decoration: none;
  color: var(--text-primary) !important;
  background: rgba(13, 17, 23, 0.88) !important;
  border-color: var(--border-light) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.map-play-control a:hover {
  color: var(--accent) !important;
}

.map-play-control.playing a {
  color: var(--accent) !important;
}

.play-speed-tooltip {
  background: rgba(13, 17, 23, 0.92) !important;
  border: 1px solid #2e3d57 !important;
  border-radius: 5px !important;
  color: #e8eaf0 !important;
  font-size: 11px !important;
  padding: 5px 10px !important;
  min-width: 90px !important;
  text-align: center !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 6px rgba(0,0,0,.5) !important;
  line-height: 1 !important;
}

.play-speed-tooltip::before {
  border-top-color: #2e3d57 !important;
}

.route-dist-tooltip {
  background: rgba(13, 17, 23, 0.88) !important;
  border: 1px solid #2e3d57 !important;
  border-radius: 4px !important;
  color: #e8eaf0 !important;
  font-size: 12px !important;
  padding: 3px 8px !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 5px rgba(0,0,0,.5) !important;
}

.route-dist-tooltip::before { display: none !important; }

.play-label-time {
  font-size: 10px;
  color: #6b7a99;
  margin-bottom: 3px;
  font-weight: 400;
  letter-spacing: 0.3px;
}

.play-label-speed {
  font-size: 13px;
  font-weight: 700;
  color: #e8eaf0;
}

/* ── Profile modal ─────────────────────────────────────── */
#profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#profile-modal-overlay.hidden { display: none; }

#profile-modal {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  width: 420px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  animation: modal-slide-in 0.18s ease;
}

#profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

#profile-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
}
#profile-modal-close:hover { color: var(--text-primary); }

#profile-modal-body {
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#profile-modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
#profile-modal-footer .btn-primary,
#profile-modal-footer .btn-secondary {
  width: auto;
  padding: 8px 18px;
  margin: 0;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.profile-avatar-row img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  object-fit: cover;
}

.profile-google-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-email {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-role-badge {
  display: inline-block;
  margin-top: 5px;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-apoio-profile {
  display: block;
  margin: 12px 0 0;
  padding: 8px 0;
  background: var(--accent, #f97316);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
  text-decoration: none;
}

.btn-apoio-profile:hover {
  opacity: 0.88;
}

.profile-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-top: 6px;
}

.profile-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.profile-label i {
  display: inline-block;
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-right: 3px;
}

.profile-label svg {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-right: 3px;
}

.profile-input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.profile-input:focus { border-color: var(--accent); }

.profile-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 0;
}

.profile-toggle-hint {
  font-size: 10px;
  color: var(--text-dim);
  flex: 1;
}

.profile-hint {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.profile-poi-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.profile-poi-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
}

.profile-poi-filter-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.poi-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-toggle-cb { display: none; }

.profile-toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border-light);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.profile-toggle-cb:checked + .profile-toggle-track {
  background: var(--accent);
}

.profile-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
}

.profile-toggle-cb:checked + .profile-toggle-track .profile-toggle-thumb {
  left: 19px;
}

/* Profile button in sidebar */
.btn-profile {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.btn-profile:hover { color: var(--accent); }
.btn-profile svg { width: 14px; height: 14px; }
.btn-admin-icon { color: #a78bfa; }
.btn-admin-icon:hover { color: #7c3aed; }

/* ── Events ─────────────────────────────────────────────── */
.event-textarea {
  width: 100%;
  min-height: 64px;
  padding: 7px 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.event-textarea:focus { border-color: var(--accent); }

.event-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 14px 10px;
  transition: border-color 0.15s;
}
.event-card:hover { border-color: var(--border-light); }

.event-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.event-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.event-icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
  flex-shrink: 0;
}

.event-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.event-card-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.event-meta-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.event-description {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.event-card-actions {
  display: flex;
  gap: 6px;
}

.event-card-actions button {
  flex: 1;
  padding: 5px 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.event-card-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── GPX Import modal ───────────────────────────────────── */
#gpx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#gpx-modal-overlay.hidden { display: none; }

#gpx-modal {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  width: 400px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  animation: modal-slide-in 0.18s ease;
}

#gpx-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

#gpx-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
}
#gpx-modal-close:hover { color: var(--text-primary); }

#gpx-modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#gpx-modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
#gpx-modal-footer .btn-primary,
#gpx-modal-footer .btn-secondary {
  width: auto;
  padding: 8px 18px;
  margin: 0;
}

.gpx-filename-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
}
.gpx-filename-row svg { width: 14px; height: 14px; flex-shrink: 0; }

.gpx-optional {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* Transport type */
.transport-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.transport-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  transition: all 0.15s;
  font-family: inherit;
}
.transport-btn svg { width: 20px; height: 20px; }
.transport-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.transport-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(245,183,49,0.08);
}

/* Companion chips */
.companions-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  min-height: 38px;
  cursor: text;
  transition: border-color 0.15s;
}
.companions-box:focus-within { border-color: var(--accent); }

.companions-search {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  flex: 1;
  min-width: 120px;
  font-family: inherit;
}
.companions-search:disabled { cursor: not-allowed; opacity: 0.4; }

.companion-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245,183,49,0.12);
  border: 1px solid rgba(245,183,49,0.3);
  border-radius: 12px;
  padding: 2px 8px 2px 10px;
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
}
.chip-remove:hover { opacity: 1; }

.companions-dropdown {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  max-height: 160px;
  overflow-y: auto;
}

.companions-dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 12px;
}
.companions-dropdown-item strong { color: var(--text-primary); font-weight: 600; }
.companions-dropdown-item span   { color: var(--text-muted); font-size: 11px; }
.companions-dropdown-item:hover  { background: var(--card-hover); }

.companions-role-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}
.companions-role-msg svg { width: 12px; height: 12px; }

/* Route card inline icon */
.route-inline-icon {
  width: 11px;
  height: 11px;
  vertical-align: middle;
  margin-right: 3px;
}

/* Shared route card */
.route-card-shared {
  border-left: 3px solid #7c3aed;
  opacity: 0.92;
}
.route-card-shared-row {
  padding: 2px 0 4px;
}
.route-shared-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #a78bfa;
  font-style: italic;
}
.route-shared-badge svg {
  width: 11px;
  height: 11px;
}

/* GPX event inline create */
.gpx-event-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.gpx-event-row .profile-input {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}
.btn-new-event {
  flex-shrink: 0;
  background: var(--card-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-new-event:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-new-event svg   { width: 14px; height: 14px; }

.gpx-event-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding: 10px;
  background: var(--card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.gpx-event-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 5px;
  cursor: pointer;
  border: none;
}
.btn-sm.btn-primary   { background: var(--accent); color: #fff; }
.btn-sm.btn-secondary { background: var(--card-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn-sm.btn-primary:hover   { background: #c73352; }
.btn-sm.btn-secondary:hover { background: var(--bg-secondary); }

/* ── Ranking / Leaderboard ──────────────────────────── */
.panel-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin: -4px 0 8px;
  line-height: 1.4;
}

.ranking-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: background 0.15s;
}
.ranking-card:hover { background: var(--card-hover); }

.ranking-position {
  min-width: 32px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ranking-position svg {
  width: 22px;
  height: 22px;
}

.ranking-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.ranking-avatar-placeholder {
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ranking-info {
  flex: 1;
  min-width: 0;
}
.ranking-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ranking-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.ranking-trophy,
.ranking-milestone {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--card-hover);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: default;
}
.ranking-trophy svg,
.ranking-milestone svg { width: 22px; height: 22px; }

.trophy-count { font-size: 13px; font-weight: 700; }

.badge-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-primary);
  min-width: 160px;
  max-width: 260px;
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  line-height: 1.6;
  white-space: normal;
  text-align: left;
}
.badge-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-light);
}
.ranking-trophy:hover .badge-tooltip,
.ranking-milestone:hover .badge-tooltip { opacity: 1; }

.ranking-points {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.ranking-pts-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.ranking-pts-label {
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Admin / POI ────────────────────────────────────── */
.poi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.poi-card-inactive { opacity: 0.55; }
.poi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.poi-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.poi-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.poi-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.poi-inactive-badge {
  background: #333;
  color: #888;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
}
.poi-description {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.4;
}
.poi-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.poi-card-actions button {
  flex: 1;
  padding: 5px;
  font-size: 11px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--card-hover);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.poi-card-actions button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.admin-active-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  cursor: pointer;
}
.admin-map-pick-col { justify-content: flex-end; }
.admin-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.admin-pick-btn.picking {
  border-color: var(--accent);
  color: var(--accent);
}
.admin-pick-btn svg { width: 13px; height: 13px; }


/* POI map popup e tooltip */
.poi-tooltip {
  background: #1a1f2e;
  border: 1px solid #2d3348;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.poi-tooltip::before { display: none; }

.poi-popup {
  font-family: inherit;
  min-width: 160px;
}
.poi-popup-name {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 3px;
  line-height: 1.3;
}
.poi-popup-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.poi-popup-pts {
  font-size: 13px;
  font-weight: 700;
  color: #f5b731;
}
.poi-popup-creator {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.poi-creator-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.leaflet-popup-content-wrapper {
  background: #1a1f2e;
  border: 1px solid #2d3348;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  color: #e2e8f0;
}
.leaflet-popup-tip { background: #1a1f2e; }
.leaflet-popup-close-button { color: #6b7a99 !important; }

/* ── Event map markers ──────────────────────────────────── */
.event-pin {
  width: 26px;
  height: 26px;
  background: #06b6d4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  border: 2px solid rgba(255,255,255,0.3);
}
.event-pin i { width: 14px; height: 14px; color: #fff; }
.event-pin-past {
  filter: grayscale(1);
  opacity: 0.55;
}

.event-popup { font-size: 13px; min-width: 200px; }
.event-popup-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: #e8eaf0;
}
.event-popup-meta {
  font-size: 11px;
  color: #6b7a99;
  margin-bottom: 6px;
}
.event-popup-desc {
  font-size: 12px;
  color: #a0aec0;
  margin-bottom: 8px;
  line-height: 1.4;
}
.event-popup-reporters {
  font-size: 11px;
  color: #f5b731;
  margin-bottom: 8px;
}
.event-popup-trace {
  width: 100%;
  padding: 7px 10px;
  background: #06b6d4;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: background 0.15s;
}
.event-popup-trace:hover { background: #0891b2; }

/* ── Create overlays (event + poi) ──────────────────────── */
#event-create-overlay,
#poi-create-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.15s ease;
}
#event-create-overlay.hidden,
#poi-create-overlay.hidden { display: none; }

#event-create-modal,
#poi-create-modal {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  width: 480px;
  max-width: calc(100vw - 40px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-slide-in 0.15s ease;
}

#event-create-modal-header,
.create-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

#event-create-overlay-close,
#poi-create-overlay-close,
#user-profile-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
#event-create-overlay-close:hover,
#poi-create-overlay-close:hover,
#user-profile-close:hover { color: var(--text-primary); }

#event-create-modal-body,
.create-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
#event-create-modal-body::-webkit-scrollbar,
.create-modal-body::-webkit-scrollbar { width: 4px; }
#event-create-modal-body::-webkit-scrollbar-thumb,
.create-modal-body::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

#event-create-modal-footer,
.create-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
#event-create-modal-footer .btn-primary,
#event-create-modal-footer .btn-secondary,
.create-modal-footer .btn-primary,
.create-modal-footer .btn-secondary {
  width: auto;
  padding: 8px 18px;
}

#poi-pick-hint {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  z-index: 2100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
#poi-pick-hint.hidden { display: none; }

/* ── FAB ────────────────────────────────────────────────── */
#fab-container {
  position: absolute;
  bottom: 24px;
  right: 16px;
  z-index: 1100;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 8px;
}

#fab-main {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  border: 2px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
#fab-main:hover {
  background: var(--card);
  box-shadow: 0 4px 16px rgba(245,183,49,0.3);
  transform: scale(1.05);
}

#fab-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
#fab-menu.hidden { display: none; }

.fab-action {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: border-color 0.15s, color 0.15s;
}
.fab-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.event-modal-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.event-modal-card:hover { background: var(--card-hover); }
.event-modal-card:last-child { border-bottom: none; }

.event-modal-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.event-modal-card-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.event-modal-card-desc {
  font-size: 12px;
  color: #8b9ab5;
  line-height: 1.5;
  margin-bottom: 10px;
}
.event-modal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.event-modal-card-creator {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.event-creator-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
.event-modal-reporters {
  font-size: 11px;
  color: #f5b731;
}
.event-modal-actions {
  display: flex;
  gap: 8px;
}
.btn-event-trace {
  padding: 6px 12px;
  background: #06b6d4;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-event-trace:hover { background: #0891b2; }

.btn-event-report-modal {
  padding: 5px 10px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-event-report-modal:hover {
  border-color: #f5b731;
  color: #f5b731;
}

.btn-event-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-event-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-event-icon svg { width: 14px; height: 14px; }
.btn-event-icon-danger:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ── Event panel sidebar additions ─────────────────────── */
.event-reporters {
  font-size: 11px;
  color: #f5b731;
  margin-bottom: 6px;
}

.event-card-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin: 3px 0 5px;
}

.event-location-row {
  display: flex;
  gap: 6px;
}
.event-location-row input {
  flex: 1;
}
.btn-event-locate {
  flex-shrink: 0;
  padding: 0 12px;
  height: 36px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-event-locate:hover {
  border-color: #06b6d4;
  color: #06b6d4;
}

.event-location-status {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  color: var(--text-muted);
  min-height: 16px;
}
.event-location-status.geo-ok  { color: var(--green); }
.event-location-status.geo-err { color: var(--red); }

.btn-event-show-map {
  padding: 5px 10px;
  background: transparent;
  color: #06b6d4;
  border: 1px solid #06b6d4;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-event-show-map:hover {
  background: #06b6d4;
  color: #fff;
}

.btn-event-map {
  padding: 5px 10px;
  background: transparent;
  color: #06b6d4;
  border: 1px solid #06b6d4;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-event-map:hover {
  background: #06b6d4;
  color: #fff;
}

.event-popup-date {
  font-size: 12px;
  font-weight: 700;
  color: #f5b731;
  margin-bottom: 3px;
}

.event-popup-divider {
  border-top: 1px solid #2d3348;
  margin: 10px 0;
}

.event-popup-item { padding: 2px 0; }

.event-modal-card-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.leaflet-popup-close-button:hover { color: #e2e8f0 !important; }

#map-search-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 360px;
  max-width: calc(100vw - 450px);
}

#map-search-input-row {
  display: flex;
  background: #131923;
  border: 1px solid #2e3d57;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.6);
  overflow: hidden;
}

#map-search-input {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: #e8eaf0;
  font-size: 13px;
  outline: none;
}

#map-search-input::placeholder { color: #4a5568; }

#map-search-btn {
  padding: 0 13px;
  border: none;
  border-left: 1px solid #2e3d57;
  background: transparent;
  color: #6b7a99;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color .15s;
}

#map-search-btn:hover { color: var(--accent); }

#map-search-btn svg { width: 16px; height: 16px; }

#map-search-suggestions {
  background: #131923;
  border: 1px solid #2e3d57;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
}

.map-search-item {
  padding: 9px 14px;
  font-size: 12px;
  color: #c8d0e0;
  cursor: pointer;
  border-bottom: 1px solid #1e2a3a;
  transition: background .1s;
}

.map-search-item:last-child { border-bottom: none; }

.map-search-item:hover { background: #1a2535; color: #e8eaf0; }

.search-result-pin {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

/* ── Admin accordion ────────────────────────────────────── */

.admin-accordion {
  border-bottom: 1px solid var(--border);
}

.admin-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.admin-accordion-header:hover { background: var(--card-hover); }

.admin-accordion-header span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.admin-acc-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.admin-accordion.open .admin-acc-chevron { transform: rotate(180deg); }

.admin-accordion-body { overflow: hidden; }

/* ── Admin user list ─────────────────────────────────────── */

.admin-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

.admin-user-card:last-child { border-bottom: none; }

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-user-name {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role-select {
  flex-shrink: 0;
  padding: 5px 8px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}

.admin-role-select:disabled { opacity: 0.5; cursor: default; }

/* ── Mobile responsive ──────────────────────────────────── */
#map-logo { display: none; }

@media (max-width: 768px) {

  #map-logo {
    display: block;
    position: fixed;
    bottom: 134px;
    left: 16px;
    width: 44px;
    height: 44px;
    object-fit: contain;
    z-index: 500;
    pointer-events: none;
    opacity: 0.85;
  }

  #layout {
    position: relative;
    overflow: hidden;
    height: 100vh;
  }

  #map {
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  #sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-width: unset;
    height: 78vh;
    max-height: 78vh;
    border-right: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    z-index: 500;
    transform: translateY(calc(100% - 118px));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #sidebar.mobile-open {
    transform: translateY(0);
    overflow-y: auto;
  }

  #panel-plan,
  #panel-routes,
  #panel-events,
  #panel-ranking,
  #panel-feed,
  #panel-admin,
  #panel-profile {
    flex-shrink: 0;
  }

  #sidebar-mobile-handle {
    display: block;
    width: 64px;
    height: 6px;
    background: var(--accent);
    border-radius: 3px;
    margin: 12px auto 6px;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(245, 183, 49, 0.5);
  }

  #sidebar header {
    padding: 4px 14px 10px;
    border-radius: 0;
  }

  #header-top { display: none; }

  #user-widget { margin-bottom: 8px; }

  .leaflet-top.leaflet-right { margin-top: 64px; }
  .leaflet-top.leaflet-left  { margin-top: 64px; }

  #elevation-chart {
    bottom: 134px;
    left: 16px;
    right: 72px;
    width: auto;
    max-width: none;
  }

  #fab-container {
    position: fixed;
    bottom: 134px;
    right: 16px;
    z-index: 1100;
  }

  #tabs {
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  #tabs::-webkit-scrollbar { display: none; }

  .tab-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 6px;
    font-size: 10px;
    white-space: nowrap;
  }

  /* Esconder controle de camadas no mobile */
  .leaflet-control-layers { display: none !important; }

  /* Map search bar */
  #map-search-bar {
    top: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    transform: none;
  }

  /* Modals como bottom sheets */
  #gpx-modal-overlay,
  #save-route-overlay,
  #event-create-overlay,
  #poi-create-overlay,
  #app-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  #gpx-modal,
  #save-route-modal,
  #event-create-modal,
  #poi-create-modal,
  #user-profile-modal,
  #app-modal {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    transform: none;
  }
}

/* ── Public user profile modal ───────────────────────────── */
#user-profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}
#user-profile-overlay.hidden { display: none; }

#user-profile-modal {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  width: 440px;
  max-width: 94vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-slide-in 0.18s ease;
}

#user-profile-body {
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#user-profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-profile-avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#user-profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

#user-profile-socials {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
#user-profile-socials a {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}
#user-profile-socials a:hover { color: var(--accent); }
#user-profile-socials i { width: 16px; height: 16px; }

#user-profile-stats {
  display: flex;
  gap: 10px;
}
.user-profile-stat {
  flex: 1;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.user-profile-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.user-profile-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.user-profile-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.user-profile-moto {
  font-size: 13px;
  color: var(--text-primary);
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: 6px;
  margin-bottom: 4px;
}

#user-profile-trophies,
#user-profile-milestones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.btn-route-visibility {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.btn-route-visibility i { width: 14px; height: 14px; }
.btn-route-visibility:hover { color: var(--text-primary); }
.btn-route-public { color: var(--accent); }
.btn-route-public:hover { color: var(--accent-dim); }

.feed-search-row {
  margin-top: 10px;
}
.feed-search-row input {
  width: 100%;
}

.btn-like {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.btn-like i { width: 13px; height: 13px; }
.btn-like:hover { border-color: var(--red); color: var(--red); }
.btn-like-active { border-color: var(--red); color: var(--red); background: rgba(248,113,113,0.1); }
.btn-like:disabled { opacity: 0.4; cursor: default; }

.btn-follow {
  padding: 5px 14px;
  border-radius: 16px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.btn-follow:hover { background: var(--accent); color: #111; }
.btn-follow-active { background: var(--accent); color: #111; }

#feed-bell-btn { position: relative; }
#feed-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--accent);
  color: #111;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.feed-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #111;
  flex-shrink: 0;
}
.feed-item-content {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
}
.feed-item-name { font-weight: 600; color: var(--text-primary); }
.feed-name-link { cursor: pointer; text-decoration: underline; }
.feed-name-link:hover { color: var(--accent); }
.feed-item-action { color: var(--text-muted); display: block; }
.feed-item-action strong { color: var(--text-primary); }
.feed-item-time {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

/* === advanced plan === */
#advanced-plan-section h2 { margin-bottom: 10px; }
.adv-checkbox-row { margin: 6px 0 10px; font-size: 13px; color: var(--text-secondary); }
.adv-checkbox-row input { margin-right: 6px; }

.adv-day-card {
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-left-width: 4px;
  border-left-style: solid;
}
.adv-day-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.adv-day-label {
  font-weight: 700;
  font-size: 14px;
}
.adv-day-km {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.adv-day-times {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.adv-day-driving {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.adv-day-stops { border-top: 1px solid var(--border-light); padding-top: 6px; }
.adv-stop {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.adv-stop-icon { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); }
.adv-stop-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adv-stop-km { font-size: 11px; color: var(--text-dim); }

#layers-control-section { padding: 8px 20px 4px; }
#layers-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.layer-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  background: var(--card);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  opacity: 0.45;
}
.layer-toggle-btn svg { width: 12px; height: 12px; }
.layer-toggle-active {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent);
}
.layer-toggle-btn:hover { opacity: 0.75; }
.layer-toggle-active:hover { opacity: 1; }

#map-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 600;
  pointer-events: none;
}
.map-spinner-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(245,183,49,0.15);
  border-top-color: var(--accent);
  animation: spin 0.75s linear infinite;
  box-shadow: 0 0 24px rgba(245,183,49,0.3);
}
@keyframes spin { to { transform: rotate(360deg); } }
.adv-stop-time { font-size: 11px; color: var(--accent); font-variant-numeric: tabular-nums; }
