/**
 * RL247 Original Design — 1:1 enligt referens (Trosa Kommun / Inventering 2.0)
 */
:root {
  --rl247-bg-page: #f4f8fa;
  --rl247-bg-card: #000000;
  --rl247-bg-btn: #121926;
  --rl247-bg-btn-hover: #1c2433;
  --rl247-text-primary: #121926;
  --rl247-text-secondary: #6b7280;
  --rl247-text-muted: #9ca3af;
  --rl247-border-light: #e2e8f0;
  --rl247-segment-bg: #e8edf2;
  --rl247-radius-ui: 6px;
  --rl247-radius-menu: 8px;
  --rl247-radius-card: 14px;
  --rl247-badge-blue-bg: #3b82f6;
  --rl247-badge-blue-text: #ffffff;
  --rl247-badge-green-bg: #bbf7d0;
  --rl247-badge-green-text: #15803d;
  --rl247-green-action: #4ade80;
  --rl247-edit-yellow: #eab308;
  --rl247-arrow: rgba(255, 255, 255, 0.55);
  --rl247-orange: #fb923c;
  --rl247-sidebar-active: #262626;
}

html,
body:not(.rl247-login) {
  background-color: var(--rl247-bg-page) !important;
}

#root .rl247-page-bg,
#root .min-h-screen.bg-slate-50,
#root .min-h-screen.bg-gradient-to-br,
#root .min-h-screen {
  background-color: var(--rl247-bg-page) !important;
  background-image: none !important;
}

#root input,
#root textarea,
#root select,
#root [role="dialog"] .bg-background {
  background-color: #fff;
}

/* ── Startsida: luft mot toppen ── */
html.rl247-page-home .max-w-6xl.mx-auto {
  padding-top: max(1.25rem, calc(env(safe-area-inset-top) + 0.75rem)) !important;
}

/* ── Header: titel vänster, logga höger (hamburgare på raden under) ── */
[data-rl247-tour="home-header"] {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  grid-template-rows: auto !important;
  align-items: center !important;
  column-gap: 0.75rem !important;
  row-gap: 0 !important;
  margin-bottom: 0.75rem !important;
  padding-top: 0 !important;
}

[data-rl247-tour="home-header"] > div:has(> h1),
[data-rl247-tour="home-header"] > div:first-child {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: center !important;
  min-width: 0 !important;
}

[data-rl247-tour="home-header"] img {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  align-self: center !important;
  margin: 0 !important;
  width: 4.25rem !important;
  height: 4.25rem !important;
}

[data-rl247-tour="home-header"] > div[aria-hidden="true"],
[data-rl247-tour="home-header"] > div.hidden {
  display: none !important;
}

[data-rl247-tour="home-header"] h1 {
  color: var(--rl247-text-primary) !important;
  font-weight: 800 !important;
  font-size: 1.625rem !important;
  letter-spacing: -0.02em !important;
  line-height: 1.1 !important;
  margin: 0 !important;
}

[data-rl247-tour="home-header"] p {
  color: var(--rl247-text-secondary) !important;
  font-size: 0.9375rem !important;
  margin: 0.2rem 0 0 !important;
}

/* Meny under titeln — endast ikon, ingen "Meny"-text */
html.rl247-page-home .mb-6:has([data-rl247-tour="menu-btn"]) {
  display: block !important;
  margin: 0 0 0.75rem !important;
  padding: 0 !important;
  height: auto !important;
}

[data-rl247-tour="menu-btn"] {
  background: #ffffff !important;
  border: 1px solid var(--rl247-border-light) !important;
  border-radius: var(--rl247-radius-menu) !important;
  box-shadow: none !important;
  height: 2.5rem !important;
  min-height: 2.5rem !important;
  width: 2.5rem !important;
  min-width: 2.5rem !important;
  padding: 0 !important;
  gap: 0 !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  z-index: 20 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

[data-rl247-tour="menu-btn"] > span {
  display: none !important;
}

/* ── Verktygsrad ── */
.rl247-home-layout-stack,
[data-rl247-tour="home-toolbar"] {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  width: 100% !important;
}

[data-rl247-tour="home-toolbar"] > * {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
}

[data-rl247-tour="home-toolbar"] > [data-rl247-tour="home-search"] { order: 1; }
[data-rl247-tour="home-toolbar"] > div:has([data-rl247-tour="home-filters"]) { order: 2; }
#rl247-home-admin-grid,
[data-rl247-tour="home-admin-grid"] { order: 3; }
[data-rl247-tour="home-new-area"] { order: 4; width: 100% !important; }

[data-rl247-tour="home-search"] {
  position: relative;
}

[data-rl247-tour="home-search"] input {
  background: #fff !important;
  border: 1px solid var(--rl247-border-light) !important;
  border-radius: var(--rl247-radius-menu) !important;
  height: 2.75rem !important;
  width: 100% !important;
  box-shadow: none !important;
  padding-left: 2.75rem !important;
}

[data-rl247-tour="home-search"] svg {
  left: 0.875rem !important;
}

[data-rl247-tour="home-filters"],
[data-rl247-tour="home-filters"] > div {
  width: 100% !important;
}

[data-rl247-tour="home-filters"] [role="tablist"] {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  width: 100% !important;
  background: var(--rl247-segment-bg) !important;
  border: 1px solid var(--rl247-border-light) !important;
  border-radius: var(--rl247-radius-menu) !important;
  padding: 3px !important;
  height: 2.5rem !important;
  min-height: 2.5rem !important;
  max-height: 2.5rem !important;
  gap: 2px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

[data-rl247-tour="home-filters"] [role="tab"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: stretch !important;
  border-radius: calc(var(--rl247-radius-ui) - 1px) !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  width: 100% !important;
  min-width: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--rl247-text-secondary) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
  padding: 0 0.375rem !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 100% !important;
  line-height: 1.1 !important;
  box-sizing: border-box !important;
  transform: none !important;
}

[data-rl247-tour="home-filters"] [role="tab"][data-state="active"] {
  background: #ffffff !important;
  color: var(--rl247-text-primary) !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
  margin: 0 !important;
  transform: none !important;
}

.rl247-home-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
}

.rl247-home-admin-grid a,
.rl247-home-admin-grid button {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  padding: 0 0.625rem !important;
  text-align: center !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.rl247-home-admin-grid a svg {
  flex-shrink: 0 !important;
  width: 0.875rem !important;
  height: 0.875rem !important;
}

.rl247-home-admin-grid a,
.rl247-home-admin-grid button,
[data-rl247-tour="home-new-area"],
#root .bg-slate-900:not([data-rl247-tour="menu-btn"]) {
  background: var(--rl247-bg-btn) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--rl247-radius-ui) !important;
  min-height: 2.75rem !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

/* Kartfilter med bg-slate-900 ska INTE få home-knappens min-height */
#root [data-rl247-tour="map-status-filters"] > button.bg-slate-900 {
  min-height: 2rem !important;
  height: 2rem !important;
  max-height: 2rem !important;
  padding: 0 0.75rem !important;
  border: 1px solid var(--rl247-bg-btn) !important;
  border-radius: 8px !important;
  font-size: 0.75rem !important;
}

/* ── Kortlista — mellanrum mellan kort + samma luft mot footer ── */
html.rl247-page-home .space-y-4:has([data-rl247-tour="home-session-card"]) {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
  margin-bottom: 1rem !important;
  padding-bottom: 0 !important;
}

/* Samma avstånd till footer som mellan korten (1rem) */
html.rl247-page-home .max-w-6xl.mx-auto {
  padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
}

html.rl247-page-home footer.bg-black {
  margin-top: 0 !important;
}

/* ══════════════════════════════════════════
   OMRÅDESKORT — som Trosa Kommun (bild 2)
   ══════════════════════════════════════════ */
[data-rl247-tour="home-session-card"] {
  background: var(--rl247-bg-card) !important;
  border: none !important;
  border-radius: var(--rl247-radius-card) !important;
  box-shadow: none !important;
  overflow: hidden;
}

[data-rl247-tour="home-session-card"] > div {
  padding: 1rem 1rem 2.5rem !important;
}

[data-rl247-tour="home-session-card"] .flex.flex-col.gap-3.sm\:flex-row {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  align-items: start !important;
  column-gap: 0.5rem !important;
  row-gap: 0 !important;
}

[data-rl247-tour="home-session-card"] .flex-1.min-w-0.w-full {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: block !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  overflow: hidden !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Rad 1: titel + markörprickar på samma rad */
[data-rl247-tour="home-session-card"] .flex.flex-wrap.items-center.gap-2.mb-2 {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.5rem 0.625rem !important;
  margin: 0 !important;
}

[data-rl247-tour="home-session-card"] h3 {
  color: #fff !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  display: inline !important;
  width: auto !important;
  max-width: 100% !important;
}

/* Markörprickar bredvid titel — vita antalssiffror */
[data-rl247-tour="home-session-card"] .flex.flex-wrap.items-center.gap-2.mb-2 > .flex.items-center.gap-1 {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  flex-shrink: 0 !important;
}

[data-rl247-tour="home-session-card"] .flex.flex-wrap.items-center.gap-2.mb-2 > .flex.items-center.gap-1 span,
[data-rl247-tour="home-session-card"] .flex.items-center.gap-1 span.text-slate-600,
[data-rl247-tour="home-session-card"] .flex.items-center.gap-1 > span {
  color: #fff !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
}

[data-rl247-tour="home-session-card"] .flex.flex-wrap.items-center.gap-2.mb-2 .rounded-full.bg-green-500,
[data-rl247-tour="home-session-card"] .flex.flex-wrap.items-center.gap-2.mb-2 .rounded-full.bg-red-500,
[data-rl247-tour="home-session-card"] .flex.flex-wrap.items-center.gap-2.mb-2 .rounded-full.bg-amber-500 {
  width: 0.5rem !important;
  height: 0.5rem !important;
  flex-shrink: 0 !important;
}

/* Rad 2: status-badge */
.rl247-card-status-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.625rem !important;
  margin: 0.5rem 0 0.625rem !important;
}

/* Pågående — blå pill */
[data-rl247-tour="home-session-card"] .bg-blue-100,
.rl247-card-status-row .bg-blue-100 {
  background: var(--rl247-badge-blue-bg) !important;
  color: var(--rl247-badge-blue-text) !important;
  border: none !important;
  border-radius: var(--rl247-radius-ui) !important;
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  padding: 0.2rem 0.5rem !important;
  line-height: 1.2 !important;
}

/* Slutförd — grön fylld pill, ingen ram */
[data-rl247-tour="home-session-card"] .bg-green-100,
.rl247-card-status-row .bg-green-100 {
  background: var(--rl247-badge-green-bg) !important;
  color: var(--rl247-badge-green-text) !important;
  border: none !important;
  border-radius: var(--rl247-radius-ui) !important;
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  padding: 0.2rem 0.5rem !important;
  line-height: 1.2 !important;
}

/* Markörprickar — synliga med vita siffror */
.rl247-card-status-row .flex.items-center.gap-1 {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

.rl247-card-status-row .flex.items-center.gap-1 span {
  color: #fff !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
}

.rl247-card-status-row .rounded-full.bg-green-500 {
  width: 0.5rem !important;
  height: 0.5rem !important;
  background: #22c55e !important;
}

.rl247-card-status-row .rounded-full.bg-red-500 {
  width: 0.5rem !important;
  height: 0.5rem !important;
  background: #ef4444 !important;
}

.rl247-card-status-row .rounded-full.bg-amber-500 {
  width: 0.5rem !important;
  height: 0.5rem !important;
  background: #f59e0b !important;
}

/* Beskrivning */
[data-rl247-tour="home-session-card"] p.text-slate-600 {
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.8125rem !important;
  margin: 0 0 0.5rem !important;
  line-height: 1.4 !important;
}

/* Datum + markörer */
[data-rl247-tour="home-session-card"] .flex.flex-wrap.items-center.gap-x-4.gap-y-2 {
  gap: 0.75rem 1rem !important;
  margin: 0 !important;
}

[data-rl247-tour="home-session-card"] .flex.flex-wrap.items-center.gap-x-4 .text-slate-700,
[data-rl247-tour="home-session-card"] .flex.flex-wrap.items-center.gap-x-4 .text-slate-500 {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.75rem !important;
}

[data-rl247-tour="home-session-card"] svg.text-slate-400 {
  color: rgba(255, 255, 255, 0.5) !important;
  width: 0.875rem !important;
  height: 0.875rem !important;
}

/* Senast inventerad — grå */
[data-rl247-tour="home-session-card"] .mt-2.text-sm.text-slate-500 {
  color: rgba(255, 255, 255, 0.45) !important;
  font-size: 0.75rem !important;
  margin: 0.375rem 0 0 !important;
}

/* Nästa besiktning */
[data-rl247-tour="home-session-card"] .mt-3.pt-3.border-t {
  border-color: rgba(255, 255, 255, 0.1) !important;
  margin-top: 0.625rem !important;
  padding-top: 0.625rem !important;
}

[data-rl247-tour="home-session-card"] .mt-3.pt-3 .text-slate-600,
[data-rl247-tour="home-session-card"] .mt-3.pt-3 .text-slate-900 {
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.75rem !important;
}

[data-rl247-tour="home-session-card"] .text-amber-500,
[data-rl247-tour="home-session-card"] .text-amber-600 {
  color: var(--rl247-orange) !important;
}

[data-rl247-tour="home-session-card"] .mt-3.pt-3 .text-red-600 {
  color: #f87171 !important;
}

/* Åtgärder absolut uppe till höger — alltid klickbara ovanpå kortinnehåll */
[data-rl247-tour="home-session-card"] > div.relative,
[data-rl247-tour="home-session-card"] > div {
  position: relative !important;
}

[data-rl247-tour="home-session-card"] .flex.flex-wrap.items-center.gap-2.shrink-0 {
  position: absolute !important;
  top: 0.85rem !important;
  right: 0.75rem !important;
  grid-column: auto !important;
  grid-row: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.375rem !important;
  margin: 0 !important;
  width: auto !important;
  max-width: none !important;
  flex-shrink: 0 !important;
  z-index: 100 !important;
  pointer-events: auto !important;
  isolation: isolate !important;
}

/* Ge titelraden plats så texten inte går under knapparna */
[data-rl247-tour="home-session-card"] .flex-1.min-w-0.w-full {
  padding-right: 7.5rem !important;
}

/* Slutför-handling (pågående) — grön text, klickbar knapp */
[data-rl247-tour="home-session-card"] button.border-green-200,
[data-rl247-tour="home-session-card"] button[data-rl247-slutfor],
[data-rl247-tour="home-session-card"] button.rl247-slutfor-btn,
[data-rl247-tour="home-session-card"] button.text-green-700 {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--rl247-green-action) !important;
  padding: 0.375rem 0.5rem !important;
  min-height: 2.25rem !important;
  min-width: 4.5rem !important;
  height: auto !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
  position: relative !important;
  z-index: 101 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  touch-action: manipulation !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

[data-rl247-tour="home-session-card"] button.border-green-200 svg,
[data-rl247-tour="home-session-card"] button[data-rl247-slutfor] svg,
[data-rl247-tour="home-session-card"] button.rl247-slutfor-btn svg,
[data-rl247-tour="home-session-card"] button.text-green-700 svg {
  color: var(--rl247-green-action) !important;
  pointer-events: none !important;
}

[data-rl247-tour="home-session-card"] button.border-green-200:hover,
[data-rl247-tour="home-session-card"] button[data-rl247-slutfor]:hover,
[data-rl247-tour="home-session-card"] button.rl247-slutfor-btn:hover,
[data-rl247-tour="home-session-card"] button.text-green-700:hover,
[data-rl247-tour="home-session-card"] .hover\:bg-green-50:hover {
  background: transparent !important;
  color: var(--rl247-green-action) !important;
}

/* Pil — ingen ram, ljus på svart */
[data-rl247-tour="home-session-card"] .bg-slate-100,
[data-rl247-tour="home-session-card"] .hover\:bg-slate-200:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--rl247-arrow) !important;
  height: 1.5rem !important;
  width: 1.5rem !important;
  min-height: 1.5rem !important;
  padding: 0 !important;
}

[data-rl247-tour="home-session-card"] .bg-slate-100 svg {
  color: var(--rl247-arrow) !important;
  width: 1.125rem !important;
  height: 1.125rem !important;
}

/* Redigera — gul penna */
[data-rl247-tour="home-session-card"] .absolute.bottom-3.right-3 {
  bottom: 0.75rem !important;
  right: 0.75rem !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

[data-rl247-tour="home-session-card"] .text-amber-600,
[data-rl247-tour="home-session-card"] .hover\:text-amber-700:hover {
  color: var(--rl247-edit-yellow) !important;
}

[data-rl247-tour="home-session-card"] .hover\:bg-amber-50:hover {
  background: transparent !important;
}

/* ── Sidomeny ── */
.w-72.bg-black { background: #000 !important; }

#rl247-iot-menu-link { display: flex !important; }

body.rl247-login {
  background: var(--rl247-bg-page) !important;
}

/* ── Kartvy: markörfilter — samma storlek aktiv/inaktiv, synliga ikoner ── */
[data-rl247-tour="map-status-filters"] > button {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  min-width: 2.75rem !important;
  width: auto !important;
  height: 2rem !important;
  min-height: 2rem !important;
  max-height: 2rem !important;
  padding: 0 0.75rem !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  transform: none !important;
  flex-shrink: 0 !important;
}

/* Aktiv "alla markörer" — samma höjd som övriga (inte home-knappens 2.75rem) */
#root [data-rl247-tour="map-status-filters"] > button.bg-slate-900 {
  background: var(--rl247-bg-btn) !important;
  color: #fff !important;
  border: 1px solid var(--rl247-bg-btn) !important;
  min-height: 2rem !important;
  height: 2rem !important;
  max-height: 2rem !important;
  padding: 0 0.75rem !important;
  font-size: 0.75rem !important;
}

#root [data-rl247-tour="map-status-filters"] > button.bg-slate-900 svg {
  color: #fff !important;
  stroke: #fff !important;
}

/* Aktiv grå markör — ikon måste bli vit (annars text-slate-400 = bakgrund) */
#root [data-rl247-tour="map-status-filters"] > button.bg-slate-400 {
  background: #94a3b8 !important;
  color: #fff !important;
  border-color: #94a3b8 !important;
  min-height: 2rem !important;
  height: 2rem !important;
  max-height: 2rem !important;
  padding: 0 0.75rem !important;
}

#root [data-rl247-tour="map-status-filters"] > button.bg-slate-400 svg,
#root [data-rl247-tour="map-status-filters"] > button.bg-slate-400 svg.text-slate-400,
#root [data-rl247-tour="map-status-filters"] > button.text-white svg {
  color: #fff !important;
  stroke: #fff !important;
}

/* Övriga aktiva filter — behåll färg, samma storlek, vit ikon */
#root [data-rl247-tour="map-status-filters"] > button.bg-green-600,
#root [data-rl247-tour="map-status-filters"] > button.bg-red-600,
#root [data-rl247-tour="map-status-filters"] > button.bg-amber-600 {
  min-height: 2rem !important;
  height: 2rem !important;
  max-height: 2rem !important;
  padding: 0 0.75rem !important;
  color: #fff !important;
}

#root [data-rl247-tour="map-status-filters"] > button.bg-green-600 {
  border-color: #16a34a !important;
}
#root [data-rl247-tour="map-status-filters"] > button.bg-red-600 {
  border-color: #dc2626 !important;
}
#root [data-rl247-tour="map-status-filters"] > button.bg-amber-600 {
  border-color: #d97706 !important;
}

#root [data-rl247-tour="map-status-filters"] > button.bg-green-600 svg,
#root [data-rl247-tour="map-status-filters"] > button.bg-red-600 svg,
#root [data-rl247-tour="map-status-filters"] > button.bg-amber-600 svg {
  color: #fff !important;
  stroke: #fff !important;
}

[data-rl247-tour="map-status-filters"] > button svg {
  width: 0.75rem !important;
  height: 0.75rem !important;
  flex-shrink: 0 !important;
}

[data-rl247-tour="map-toolbar"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: var(--rl247-bg-page) !important;
  border-color: var(--rl247-border-light) !important;
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 30 !important;
}

/* Visa hela verktygsraden under session (filter, knappar, titel) */
[data-rl247-tour="map-toolbar"] > div {
  display: flex !important;
}

/* Sök på karta — mer luft kring förstoringsglas */
[data-rl247-tour="map-search"] input {
  padding-left: 2.75rem !important;
}

[data-rl247-tour="map-search"] .relative svg,
[data-rl247-tour="map-search"] svg.text-slate-400 {
  left: 0.875rem !important;
}

/* Min position — fixed centrerad längst ner, alltid samma storlek */
[data-rl247-tour="min-pos"],
#rl247-min-pos-overlay {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
  position: fixed !important;
  bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + 1rem)) !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  transform: translateX(-50%) !important;
  z-index: 2147483000 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  height: 2.75rem !important;
  min-height: 2.75rem !important;
  max-height: 2.75rem !important;
  width: max-content !important;
  min-width: 9.5rem !important;
  max-width: calc(100vw - 5.5rem) !important;
  padding: 0 1.125rem !important;
  gap: 0.625rem !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 9999px !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18) !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  line-height: 1 !important;
}

[data-rl247-tour="min-pos"] label,
#rl247-min-pos-overlay label {
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

/* SWEREF — alltid precis ovanför Min position (alla devices) */
[data-rl247-tour="sweref-hud"] {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: calc(max(1.25rem, env(safe-area-inset-bottom) + 1rem) + 2.75rem + 0.5rem) !important;
  transform: translateX(-50%) !important;
  z-index: 2147482990 !important;
  margin: 0 !important;
  max-width: calc(100vw - 1.5rem) !important;
  pointer-events: none !important;
  white-space: nowrap !important;
}

[data-rl247-tour="min-pos"] button,
[data-rl247-tour="min-pos"] [role="switch"],
[data-rl247-tour="min-pos"] label,
#rl247-min-pos-overlay button,
#rl247-min-pos-overlay [role="switch"],
#rl247-min-pos-overlay label {
  pointer-events: auto !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}

/* Dölj Min position i kartans topplist */
#location-toggle,
label[for="location-toggle"],
.rl247-map-hide-desktop-pos {
  display: none !important;
}

/* Google Maps-liknande blå positionsmarkör */
.leaflet-marker-icon.user-location-marker,
.leaflet-marker-icon.rl247-user-loc-icon {
  background: transparent !important;
  border: none !important;
}

.rl247-user-loc {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.rl247-user-loc-pulse {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(66, 133, 244, 0.28);
  animation: rl247-loc-pulse 2s ease-out infinite;
}

.rl247-user-loc-dot {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4285f4;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

@keyframes rl247-loc-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.75;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

/* Utgråad förhandsmarkör (ny markör) */
.leaflet-marker-icon.rl247-ghost-marker {
  background: transparent !important;
  border: none !important;
}

.rl247-ghost-pin {
  width: 22px;
  height: 22px;
  margin: 9px auto 0;
  border-radius: 50% 50% 50% 0;
  background: #94a3b8;
  border: 3px solid rgba(255, 255, 255, 0.9);
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
  opacity: 0.85;
  position: relative;
}

.rl247-ghost-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.leaflet-container.rl247-adding-marker {
  cursor: crosshair !important;
}

/* Zoom — nedre vänster, ovanpå kartan men under sökfält */
.leaflet-container .leaflet-top.leaflet-left {
  top: auto !important;
  bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + 1rem)) !important;
  left: max(0.75rem, env(safe-area-inset-left)) !important;
}

.leaflet-control-zoom {
  border: none !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.15) !important;
  z-index: 800 !important;
}

.leaflet-control-zoom a {
  width: 2rem !important;
  height: 2rem !important;
  line-height: 2rem !important;
  font-size: 1.125rem !important;
}
