:root {
  --bg: #f5f5f5;
  --sidebar-bg: #ffffff;
  --text: #222;
  --brand: #0b66d6;
  --border: #e5e5e5;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 800;
  font-size: 28px;
  color: var(--brand);
  letter-spacing: 0.2px;
}

nav a {
  color: #222;
  text-decoration: none;
  margin-left: 16px;
  font-weight: 600;
}
nav a.active { color: var(--brand); }

#app {
  height: calc(100vh - 56px);
  display: flex;
  min-height: 0; /* important for flex + Leaflet */
}

#sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow: auto;
}

#mapWrap {
  flex: 1;
  min-width: 0;   /* important for flex + Leaflet */
  min-height: 0;  /* important for flex + Leaflet */
  position: relative;
}

/* The map must have an explicit height, or Leaflet will render blank/white */
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #fff;
}

/* Sidebar bits */
.section-title { font-weight: 800; margin-bottom: 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }

.w100 {
  width: 100%;
  padding: 8px;
  margin: 6px 0;
}

.row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.w50 {
  flex: 1;
  padding: 8px;
}

/* ===== Finn marker =====
   We rotate the *base image* by 180deg (your request) THEN add heading rotation in JS.
*/
.finn-marker {
  width: 36px;
  height: 36px;
  transform: translate(-18px, -18px); /* center on lat/lon */
  pointer-events: none;
}

.finn-marker img {
  width: 36px;
  height: 36px;
  display: block;
  transform-origin: 50% 50%;
  /* base flip + dynamic heading rotation (set by JS using --rot) */
  transform: rotate(calc(180deg + var(--rot, 0deg)));
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}
