/* Lab map — plein viewport, panneau gauche en overlay (style AFM, panneau à gauche) */

body.page-lab-map {
  overflow: hidden;
}

body.page-lab-map main.container {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
}

body.page-lab-map .site-footer {
  display: none;
}

.page-lab-map .admin-page.lab-map-page {
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100dvh - var(--lab-map-header-h, 64px));
  min-height: 480px;
}

.lab-badge {
  display: inline-block;
  margin-left: .3rem;
  padding: .12rem .45rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  vertical-align: middle;
  color: #fbbf24;
  background: rgba(251, 191, 36, .12);
  border: 1px solid rgba(251, 191, 36, .35);
}

.lab-map-layout {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #071018;
}

.lab-map-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.lab-map-cluster-stage {
  position: absolute;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  background: rgba(7, 16, 24, 0.97);
  padding: .75rem .85rem .85rem;
  gap: .45rem;
}

/* Laisse la place au panneau gauche pour éviter le titre sous / en double */
.lab-map-layout.is-cluster-expanded:not(.is-sidebar-collapsed) .lab-map-cluster-stage {
  padding-left: calc(min(340px, calc(100vw - 1.5rem)) + 1.6rem);
}

.lab-map-cluster-stage[hidden] {
  display: none !important;
}

.lab-map-cluster-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.lab-map-cluster-stage-text {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}

.lab-map-cluster-stage-kicker {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, .42);
}

.lab-map-cluster-stage-text strong {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(248, 250, 252, .94);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-map-cluster-stage-close {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: rgba(248, 250, 252, .9);
  border-radius: 8px;
  padding: .4rem .7rem;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
}

.lab-map-cluster-stage-close:hover {
  background: rgba(255, 255, 255, .1);
}

.lab-map-cluster-stage-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lab-map-cluster-stage-body .lab-map-cluster {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.lab-map-cluster-stage-body .lab-map-cluster-canvas {
  flex: 1 1 auto;
  height: auto;
  min-height: 240px;
}

.lab-map-cluster-stage-body .lab-map-cluster-hint {
  display: none;
}

/* Évite le double « CARTE CLUSTER » (déjà dans la barre stage) */
.lab-map-cluster-stage-body .lab-map-cluster-label {
  display: none;
}

.lab-map-cluster-stage-body .lab-map-cluster-toolbar {
  justify-content: flex-end;
  margin-bottom: .2rem;
}

.lab-map-layout.is-cluster-expanded .lab-map-legend,
.lab-map-layout.is-cluster-expanded .lab-map-hint {
  display: none !important;
}

.lab-map-layout.is-cluster-expanded .leaflet-control-zoom {
  display: none !important;
}

.lab-map-layout.is-cluster-expanded .lab-map-tab[data-panel="route"] {
  display: none;
}

.lab-map-layout:not(.is-cluster-expanded) .lab-map-tab-cluster {
  display: none !important;
}

.lab-map-layout.is-cluster-expanded .lab-map-cluster-filters {
  display: none;
}

.lab-map-cluster-panel-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .35rem;
}

.lab-map-cluster-panel-filters .lab-map-cluster-chip {
  padding: .28rem .55rem;
  font-size: .74rem;
}

.lab-map-cluster-tip {
  margin: 0 0 .65rem;
  font-size: .65rem;
}

.lab-map-cluster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .55rem;
}

.lab-map-canvas,
.lab-map-canvas.leaflet-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #071018;
}

/* Panneau gauche flottant */
.lab-map-sidebar {
  position: absolute;
  z-index: 800;
  top: .75rem;
  left: .75rem;
  bottom: .75rem;
  width: min(340px, calc(100vw - 1.5rem));
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: .8rem .75rem .8rem .85rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(10, 14, 20, .82);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
  overflow: hidden;
  transition: transform .22s ease, opacity .22s ease;
  color-scheme: dark;
}

.lab-map-sidebar *,
.lab-map-sidebar-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.lab-map-sidebar *::-webkit-scrollbar,
.lab-map-sidebar-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.lab-map-sidebar *::-webkit-scrollbar-track,
.lab-map-sidebar-body::-webkit-scrollbar-track {
  background: transparent;
}

.lab-map-sidebar *::-webkit-scrollbar-thumb,
.lab-map-sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
  border-radius: 999px;
}

.lab-map-sidebar *::-webkit-scrollbar-thumb:hover,
.lab-map-sidebar-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .3);
}

.lab-map-layout.is-sidebar-collapsed .lab-map-sidebar {
  transform: translateX(calc(-100% - 1.2rem));
  opacity: 0;
  pointer-events: none;
}

.lab-map-chrome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  flex-shrink: 0;
}

.lab-map-chrome-text {
  min-width: 0;
}

.lab-map-back {
  display: inline-block;
  margin-bottom: .2rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.lab-map-back:hover {
  color: var(--text);
}

.lab-map-chrome h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.lab-map-fold,
.lab-map-unfold {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .35);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.lab-map-fold:hover,
.lab-map-unfold:hover {
  background: rgba(255, 255, 255, .1);
}

.lab-map-unfold {
  position: absolute;
  z-index: 810;
  top: .85rem;
  left: .85rem;
  display: none;
}

.lab-map-layout.is-sidebar-collapsed .lab-map-unfold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lab-map-unfold[hidden] {
  display: none !important;
}

.lab-map-tabs {
  display: flex;
  gap: .25rem;
  padding: .28rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .28);
  flex-shrink: 0;
}

.lab-map-tab {
  flex: 1;
  padding: .4rem .4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
}

.lab-map-tab.is-active {
  color: #0b1220;
  background: #fbbf24;
}

.lab-map-sidebar-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding-right: .2rem;
  margin-right: -.1rem;
}

.lab-map-panel {
  display: none;
  flex-direction: column;
  gap: .75rem;
}

.lab-map-panel.is-active {
  display: flex;
}

.lab-map-panel[hidden] {
  display: none !important;
}

.lab-map-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 600;
}

.lab-map-field input,
.lab-map-prefs select {
  width: 100%;
  padding: .5rem .65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(0, 0, 0, .4);
  color: var(--text);
  font: inherit;
}

.lab-map-check {
  flex-direction: row;
  align-items: flex-start;
  gap: .55rem;
  font-weight: 500;
  color: var(--muted);
}

.lab-map-check input {
  width: auto;
  margin-top: .15rem;
  accent-color: #fbbf24;
}

.lab-map-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 160px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .35);
}

.lab-map-search-results li button {
  width: 100%;
  text-align: left;
  padding: .45rem .65rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
}

.lab-map-search-results li:last-child button {
  border-bottom: 0;
}

.lab-map-search-results li button:hover {
  background: rgba(255, 255, 255, .06);
}

.lab-map-zone-card {
  padding: .85rem .8rem .9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .22);
}

.lab-map-zone-head {
  margin-bottom: .35rem;
}

.lab-map-zone-card h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
}

.lab-map-zone-sub {
  margin: .2rem 0 0;
  font-size: .72rem;
  color: rgba(226, 232, 240, .5);
  line-height: 1.35;
}

.lab-map-zone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
  margin: .45rem 0 .15rem;
}

.lab-map-section-label {
  margin: 0 0 .4rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, .42);
}

.lab-map-section-label.is-sub {
  margin-top: .55rem;
}

.lab-map-disclosure {
  margin-top: .55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .02);
}

.lab-map-disclosure > summary {
  list-style: none;
  cursor: pointer;
  padding: .45rem .55rem;
  font-size: .74rem;
  font-weight: 600;
  color: rgba(226, 232, 240, .72);
  user-select: none;
}

.lab-map-disclosure > summary::-webkit-details-marker {
  display: none;
}

.lab-map-disclosure > summary::after {
  content: '+';
  float: right;
  color: rgba(226, 232, 240, .35);
  font-weight: 500;
}

.lab-map-disclosure[open] > summary::after {
  content: '−';
}

.lab-map-disclosure > :not(summary) {
  padding: 0 .55rem .55rem;
}

.lab-map-disclosure #lab-map-zone-links {
  margin: 0;
  line-height: 1.4;
}

.lab-map-zone-meta {
  display: none;
}

.lab-map-zone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.lab-map-footer {
  position: absolute;
  z-index: 700;
  left: 50%;
  bottom: .65rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  max-width: min(720px, calc(100vw - 2rem));
  pointer-events: none;
}

.lab-map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem .85rem;
  padding: .4rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(8, 12, 18, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: .74rem;
  font-weight: 600;
  color: rgba(226, 232, 240, .78);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

.lab-map-poi-filters {
  margin: 0;
  padding: .55rem .6rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.lab-map-poi-filters legend {
  padding: 0 .2rem;
  font-size: .74rem;
  font-weight: 700;
  color: rgba(226, 232, 240, .65);
}

.lab-map-poi-filters .lab-map-check {
  font-size: .76rem;
}

.lab-map-resource-filters .lab-map-res-hint {
  margin: 0 0 .35rem;
  line-height: 1.35;
}

.lab-map-res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .3rem .45rem;
  margin-bottom: .35rem;
}

.lab-map-res-chip {
  position: relative;
  padding: .28rem .4rem .28rem .35rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}

.lab-map-res-chip:has(input:checked) {
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
}

.lab-map-res-chip.is-wood:has(input:checked) { box-shadow: inset 3px 0 0 #4ade80; }
.lab-map-res-chip.is-hide:has(input:checked) { box-shadow: inset 3px 0 0 #d97706; }
.lab-map-res-chip.is-ore:has(input:checked) { box-shadow: inset 3px 0 0 #38bdf8; }
.lab-map-res-chip.is-fiber:has(input:checked) { box-shadow: inset 3px 0 0 #2dd4bf; }
.lab-map-res-chip.is-stone:has(input:checked) { box-shadow: inset 3px 0 0 #94a3b8; }

.lab-map-res-rank-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .7rem;
  margin-top: .4rem;
  font-size: .68rem;
  color: rgba(226, 232, 240, .55);
}

.lab-res-swatch {
  display: inline-block;
  width: .7rem;
  height: .55rem;
  margin-right: .2rem;
  border-radius: 2px;
  vertical-align: middle;
  background: #4ade80;
}

.lab-res-swatch.is-primary { opacity: 1; }
.lab-res-swatch.is-secondary { opacity: .55; }
.lab-res-swatch.is-tertiary { opacity: .28; }

.lab-map-zone-res-row dd {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

.lab-res-pill {
  display: inline-flex;
  align-items: center;
  padding: .14rem .42rem;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  color: rgba(226, 232, 240, .78);
}

.lab-res-pill.is-primary {
  border-color: rgba(255, 255, 255, .22);
  color: rgba(248, 250, 252, .92);
}

.lab-map-gather-panel {
  margin-top: .7rem;
  padding-top: .65rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.lab-map-gather-totals {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

.lab-map-cluster {
  margin-top: .55rem;
}

.lab-map-cluster-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .3rem;
}

.lab-map-cluster-expand {
  appearance: none;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
  color: rgba(226, 232, 240, .75);
  border-radius: 6px;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.lab-map-cluster-expand:hover {
  color: rgba(248, 250, 252, .95);
  background: rgba(255, 255, 255, .1);
}

.lab-map-layout.is-cluster-expanded .lab-map-cluster-expand {
  display: none;
}

.lab-map-cluster-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, .42);
}

.lab-map-cluster-count {
  font-size: .68rem;
  color: rgba(226, 232, 240, .45);
  font-variant-numeric: tabular-nums;
}

.lab-map-cluster-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-bottom: .35rem;
}

.lab-map-cluster-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .03);
  color: rgba(226, 232, 240, .45);
  border-radius: 6px;
  padding: .12rem .4rem;
  font-size: .66rem;
  font-weight: 600;
  cursor: pointer;
}

.lab-map-cluster-chip.is-on {
  color: rgba(248, 250, 252, .9);
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
}

.lab-map-cluster-chip.is-wood.is-on { color: #4ade80; }
.lab-map-cluster-chip.is-hide.is-on { color: #fb923c; }
.lab-map-cluster-chip.is-ore.is-on { color: #60a5fa; }
.lab-map-cluster-chip.is-fiber.is-on { color: #c084fc; }
.lab-map-cluster-chip.is-rock.is-on { color: #facc15; }

.lab-map-cluster-canvas {
  display: block;
  width: 100%;
  height: 220px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .35);
  cursor: grab;
  touch-action: none;
}

.lab-map-cluster-canvas:active {
  cursor: grabbing;
}

.lab-map-cluster-hint {
  margin: .3rem 0 0;
  font-size: .65rem;
  line-height: 1.35;
}

.lab-gather-total {
  display: inline-flex;
  align-items: baseline;
  gap: .28rem;
  padding: .22rem .5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  font-size: .72rem;
  color: rgba(226, 232, 240, .65);
}

.lab-gather-total strong {
  font-size: .82rem;
  font-weight: 700;
  color: rgba(248, 250, 252, .92);
  font-variant-numeric: tabular-nums;
}

.lab-map-gather-table-wrap {
  overflow-x: auto;
  margin-top: .15rem;
}

.lab-map-gather-table,
.lab-map-enchant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
}

.lab-map-gather-table th,
.lab-map-gather-table td,
.lab-map-enchant-table th,
.lab-map-enchant-table td {
  padding: .28rem .3rem;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  color: rgba(226, 232, 240, .7);
}

.lab-map-gather-table th:first-child,
.lab-map-gather-table td:first-child,
.lab-map-gather-table th[scope='row'],
.lab-map-enchant-table th:first-child,
.lab-map-enchant-table td:first-child {
  text-align: left;
  color: rgba(226, 232, 240, .88);
  font-weight: 600;
}

.lab-map-gather-table thead th,
.lab-map-enchant-table thead th {
  color: rgba(226, 232, 240, .4);
  font-weight: 600;
}

.lab-map-gather-enchant {
  margin-top: .55rem;
}

.lab-map-gather-profit {
  margin: .65rem 0 .35rem;
  padding: .55rem .6rem;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.18);
}

.lab-map-gather-profit-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .55rem;
  margin-bottom: .4rem;
}

.lab-map-gather-profit-silv {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: -0.02em;
}

.lab-map-gather-profit-unit {
  font-size: .78rem;
  color: rgba(253, 230, 138, 0.75);
}

.lab-map-gather-profit-risk {
  font-size: .72rem;
  font-weight: 600;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.lab-map-gather-profit-risk.is-blue { color: #93c5fd; }
.lab-map-gather-profit-risk.is-yellow { color: #fde047; }
.lab-map-gather-profit-risk.is-red { color: #fca5a5; }
.lab-map-gather-profit-risk.is-black { color: #d4d4d8; }

.lab-map-gather-profit-breakdown {
  list-style: none;
  margin: 0 0 .45rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .55rem;
}

.lab-map-gather-profit-breakdown li {
  display: inline-flex;
  gap: .3rem;
  align-items: center;
  font-size: .75rem;
  color: rgba(255, 255, 255, 0.72);
}

.lab-map-gather-profit-breakdown li strong {
  color: #f8fafc;
}

.lab-map-gather-profit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .25rem;
}

.lab-map-gather-profit-hint {
  margin: .25rem 0 0;
}

.lab-res-poly {
  pointer-events: none;
}

.lab-dot {
  display: inline-block;
  width: .6rem;
  height: .6rem;
  margin-right: .28rem;
  border-radius: 50%;
  vertical-align: middle;
}

.lab-dot-blue { background: #3b82f6; }
.lab-dot-yellow { background: #eab308; }
.lab-dot-red { background: #ef4444; }
.lab-dot-black { background: #a1a1aa; box-shadow: inset 0 0 0 1px #52525b; }

.lab-map-prefs {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.lab-map-prefs legend {
  margin-bottom: .3rem;
  font-weight: 700;
  font-size: .82rem;
}

.lab-map-prefs label {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
}

.lab-map-hint {
  margin: 0;
  max-width: 100%;
  padding: .32rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(8, 12, 18, .55);
  backdrop-filter: blur(8px);
  font-size: .7rem;
  text-align: center;
  pointer-events: none;
}

.lab-map-basemap {
  image-rendering: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.leaflet-basemap-pane {
  z-index: 200;
}

/* Zoom Leaflet : haut droite (panneau à gauche) */
.page-lab-map .leaflet-top.leaflet-right {
  top: .75rem;
  right: .75rem;
}

.lab-map-city-panel {
  margin-top: .7rem;
  padding-top: .65rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.lab-map-calc-links .btn {
  font-size: .72rem;
  padding: .35rem .55rem;
  border-radius: 8px;
}

.lab-map-city-specialty {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.lab-map-spec-row {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  font-size: .74rem;
  color: rgba(226, 232, 240, .62);
  line-height: 1.4;
}

.lab-map-spec-tag {
  display: inline-block;
  align-self: flex-start;
  padding: .1rem .38rem;
  border-radius: 6px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(248, 250, 252, .88);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
}

.lab-map-spec-tag.is-craft,
.lab-map-spec-tag.is-refine {
  background: rgba(255, 255, 255, .08);
  color: rgba(248, 250, 252, .88);
}

.lab-map-portal-note {
  margin: 0;
}

.lab-map-calc-links {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.lab-map-top-crafts-block h3 {
  display: none;
}

.lab-map-top-crafts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.lab-map-top-crafts li a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .45rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .28);
  color: inherit;
  text-decoration: none;
  transition: background .12s, border-color .12s;
}

.lab-map-top-crafts li a:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(251, 191, 36, .35);
}

.lab-map-top-crafts img {
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, .35);
}

.lab-map-tc-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.lab-map-tc-name {
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-map-tc-meta {
  font-size: .7rem;
  color: #86efac;
  font-weight: 600;
}

.lab-map-spec-dot {
  color: #fbbf24;
  margin-right: .2rem;
}

.lab-map-route-modes {
  display: flex;
  gap: .25rem;
  padding: .22rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .28);
}

.lab-map-mode-pill {
  flex: 1;
  padding: .42rem .3rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(226, 232, 240, .55);
  font-size: .74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.lab-map-mode-pill:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .05);
}

.lab-map-mode-pill.is-active {
  color: #0b1220;
  background: #fbbf24;
  box-shadow: 0 2px 10px rgba(251, 191, 36, .25);
}

.lab-map-route-slots {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.lab-map-slot {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .55rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  transition: border-color .12s, background .12s;
}

.lab-map-slot:hover {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
}

.lab-map-slot-badge {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  color: #0b1220;
  background: #94a3b8;
}

.lab-map-slot-badge.is-a { background: #38bdf8; }
.lab-map-slot-badge.is-b { background: #fbbf24; }
.lab-map-slot-badge.is-via { background: #a78bfa; color: #fff; }

.lab-map-slot-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .05rem;
}

.lab-map-slot-label {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(226, 232, 240, .45);
}

.lab-map-slot-value {
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-map-slot-value.is-empty {
  font-weight: 500;
  color: rgba(226, 232, 240, .4);
}

.lab-map-slot-pick,
.lab-map-slot-clear {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .25);
  color: rgba(226, 232, 240, .8);
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  transition: background .12s, color .12s, border-color .12s;
}

.lab-map-slot-pick:hover,
.lab-map-slot-clear:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.lab-map-slot-pick.is-active {
  background: #fbbf24;
  color: #0b1220;
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .2);
}

.lab-map-slot-vias {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.lab-map-via-add {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin: .05rem 0;
  padding: .28rem .7rem;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, .2);
  background: transparent;
  color: rgba(226, 232, 240, .55);
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}

.lab-map-via-add span {
  font-size: .95rem;
  line-height: 1;
}

.lab-map-via-add:hover,
.lab-map-via-add.is-active {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, .45);
  background: rgba(251, 191, 36, .08);
}

.lab-map-route-assign {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .45rem .55rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(0, 0, 0, .22);
}

.lab-map-route-assign.is-ready {
  border-color: rgba(251, 191, 36, .28);
  background: rgba(251, 191, 36, .06);
}

.lab-map-route-selected {
  min-width: 0;
  flex: 1;
  font-size: .75rem;
  color: rgba(226, 232, 240, .45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-map-route-selected.has-zone {
  color: var(--text);
  font-weight: 600;
}

.lab-map-assign-btns {
  display: flex;
  gap: .25rem;
  flex-shrink: 0;
}

.lab-map-assign-btn {
  padding: .28rem .45rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
}

.lab-map-assign-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.lab-map-assign-btn:not(:disabled):hover {
  border-color: rgba(251, 191, 36, .45);
  background: rgba(251, 191, 36, .12);
}

.lab-map-route-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
}

.lab-map-text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: rgba(226, 232, 240, .5);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
}

.lab-map-text-btn:hover {
  color: var(--text);
}

.lab-map-text-btn.is-danger:hover {
  color: #f87171;
}

.lab-map-route-stats {
  margin: 0;
  padding: .5rem .65rem;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, .2);
  background: rgba(251, 191, 36, .08);
  font-size: .74rem;
  font-weight: 600;
  line-height: 1.35;
  color: #fde68a;
}

.lab-map-route-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: min(240px, 32vh);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .06);
  background: rgba(0, 0, 0, .2);
  padding: .35rem;
}

.lab-map-route-empty {
  padding: .7rem .55rem;
  text-align: center;
  color: rgba(226, 232, 240, .4);
  font-size: .78rem;
}

.lab-map-step {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .45rem;
  text-align: left;
  padding: .4rem .45rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.lab-map-step:hover {
  background: rgba(255, 255, 255, .06);
}

.lab-map-step em {
  color: rgba(226, 232, 240, .4);
  font-style: normal;
  font-size: .7rem;
  margin-left: auto;
}

.lab-map-step-n {
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(251, 191, 36, .15);
  color: #fbbf24;
  font-size: .65rem;
  font-weight: 700;
}

.lab-map-layout.is-picking-route .lab-map-canvas {
  cursor: crosshair;
}

.lab-map-layout.is-picking-route .lab-map-hint {
  border-color: rgba(251, 191, 36, .35);
  background: rgba(251, 191, 36, .12);
  color: #fde68a;
}

.lab-wp-wrap {
  background: transparent !important;
  border: 0 !important;
}

.lab-wp {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  color: #0b1220;
}

.lab-wp.is-a { background: #38bdf8; }
.lab-wp.is-b { background: #fbbf24; }
.lab-wp.is-via { background: #a78bfa; color: #fff; }

.lab-poi-wrap {
  background: transparent !important;
  border: 0 !important;
}

.lab-poi {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, .85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  font-size: 11px;
  font-weight: 800;
  color: #0b1220;
  cursor: pointer;
}

.lab-poi-glyph {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.lab-poi-img {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  object-fit: contain;
  opacity: .92;
  border-radius: 5px;
}

.lab-poi--marketplace { background: #38bdf8; }
.lab-poi--craft { background: #fbbf24; }
.lab-poi--refine { background: #a3e635; }
.lab-poi--portal { background: #c084fc; color: #1e1030; }
.lab-poi--blackmarket { background: #111827; color: #f8fafc; border-color: #fbbf24; font-size: 9px; }

.lab-poi--refine .lab-poi-glyph {
  display: none;
}

.lab-poi-popup .leaflet-popup-content-wrapper {
  background: rgba(12, 16, 22, .92);
  color: var(--text);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}

.lab-poi-popup .leaflet-popup-tip {
  background: rgba(12, 16, 22, .92);
}

.lab-poi-popup .leaflet-popup-content {
  margin: .7rem .8rem;
  font-size: .82rem;
  line-height: 1.4;
}

.lab-poi-pop-meta,
.lab-poi-pop-specs {
  margin-top: .35rem;
  color: var(--muted);
  font-size: .75rem;
}

.lab-poi-pop-links {
  margin-top: .5rem;
}

.lab-poi-pop-links a {
  color: #fbbf24;
  font-weight: 600;
  text-decoration: none;
}

.lab-poi-pop-links a:hover {
  text-decoration: underline;
}

.lab-zone-poly {
  cursor: pointer;
  transition: fill-opacity .12s ease, stroke-width .12s ease;
}

.lab-zone-poly.is-hover,
.lab-zone-poly.is-selected {
  cursor: pointer;
}


.lab-zone-marker.is-zone,
.lab-zone-marker.is-outland {
  width: 9px !important;
  height: 9px !important;
  margin-left: -4.5px !important;
  margin-top: -4.5px !important;
  border-width: 1.5px;
}

.lab-zone-marker.is-city {
  width: 16px !important;
  height: 16px !important;
  margin-left: -8px !important;
  margin-top: -8px !important;
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .45), 0 0 10px rgba(251, 191, 36, .25);
}

.lab-zone-marker.is-selected {
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .85);
}

.lab-zone-label {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: rgba(226, 232, 240, .92);
  font-weight: 700;
  font-size: 11px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
  white-space: nowrap;
}

.lab-zone-label::before {
  display: none;
}

.lab-zone-label span {
  display: inline-block;
  padding: .05rem .25rem;
  border-radius: 4px;
  background: rgba(8, 12, 18, .55);
  font-size: 10px;
  font-weight: 600;
  color: rgba(226, 232, 240, .88);
  pointer-events: none;
}

.lab-zone-label.is-city-label span {
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  background: rgba(8, 12, 18, .72);
}

/* Cards Lab index (admin/index tab lab) */
.admin-lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.admin-lab-card {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: 1.1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 20, 25, .65);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}

.admin-lab-card:hover {
  border-color: rgba(251, 191, 36, .45);
  background: rgba(20, 28, 36, .85);
}

.admin-lab-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.admin-lab-card p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}

.admin-lab-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: auto;
}

@media (max-width: 720px) {
  .lab-map-sidebar {
    top: .5rem;
    left: .5rem;
    bottom: auto;
    max-height: min(58vh, calc(100% - 4.5rem));
    width: calc(100vw - 1rem);
  }

  .lab-map-footer {
    left: .5rem;
    right: .5rem;
    transform: none;
    max-width: none;
  }

  .lab-map-legend {
    border-radius: 12px;
  }

  .lab-map-hint {
    border-radius: 10px;
  }
}
