/* Plan d'implantation — studio type Scribble / SIG */

.pip-main {
  --pip-tx: #f1f5f9;
  --pip-tx-muted: rgba(241, 245, 249, 0.55);
  --pip-accent: #ec4899;
  --pip-accent-soft: rgba(236, 72, 153, 0.18);
  --pip-accent-glow: rgba(236, 72, 153, 0.5);
  --pip-draw: #f472b6;
  --pip-draw-soft: rgba(244, 114, 182, 0.2);
  --pip-draw-glow: rgba(244, 114, 182, 0.55);
  --pip-surface: linear-gradient(165deg, rgba(18, 21, 32, 0.97) 0%, rgba(10, 12, 20, 0.94) 100%);
  --pip-edge: rgba(255, 255, 255, 0.09);
  
  --pip-inner: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  /* Position du logo PyroMap dans la barre du haut (UI) */
  --pip-top-logo-offset-x: 0px;
  --pip-top-logo-offset-y: 0px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: calc(100vh - var(--app-top-chrome-height, 112px));
  padding: 0 !important;
  margin: 0 !important;
  padding-bottom: 0 !important;
}

/* La barre top-user-actions est fixe au-dessus du contenu global.
   Sans cet offset, le bandeau outils peut rester caché dessous. */
body.has-top-profile-menu .pip-main {
  padding-top: 96px !important;
}

/* Logo Pyromap : barre un peu plus haute + marge contenu */
body.has-top-profile-menu:has(.top-pyromap-brand) .pip-main {
  padding-top: 118px !important;
}

body.has-top-profile-menu .top-user-actions:has(.top-pyromap-brand) {
  height: auto !important;
  min-height: 100px !important;
  max-height: none !important;
}

/* Rail navigation vertical (style.css) : .main a margin-left, .pip-main annule la marge par défaut */
@media (min-width: 1201px) {
  body:not(.nav-mobile) .main.pip-main {
    margin-left: var(--sidebar-width, 280px) !important;
    transition: margin-left 0.22s ease;
  }
}

/* Logo Pyromap en flux normal dans la barre top (déplaçable via variables) */
.top-user-actions .top-pyromap-brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(
    calc(-50% + var(--pip-top-logo-offset-x, 0px)),
    calc(-50% + var(--pip-top-logo-offset-y, 0px))
  );
  margin: 0;
  z-index: 1;
  pointer-events: none;
  flex: 0 0 auto;
}

.top-user-actions .top-pyromap-brand__logo {
  display: block;
  height: 80px;
  width: auto;
  max-width: min(360px, 90vw);
  object-fit: contain;
}

.top-user-actions .top-notif-wrap {
  position: relative;
  z-index: 1;
}

.top-user-actions .top-profile-trigger {
  position: relative;
  z-index: 1;
}

.pip-header-tools {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: visible;
}

.pip-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  flex-shrink: 0;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(18, 21, 32, 0.96), rgba(10, 12, 20, 0.92));
  box-shadow: var(--pip-inner), 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(236, 72, 153, 0.14);
}

.pip-btn {
  border-radius: 8px;
  padding: clamp(6px, 0.35vw + 4px, 8px) clamp(8px, 0.6vw + 6px, 14px);
  font-size: clamp(11px, 0.2vw + 10.5px, 13px);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: inherit;
}

.pip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pip-btn-ghost {
  opacity: 0.85;
}

.pip-btn-accent {
  background: rgba(236, 72, 153, 0.22);
  border-color: rgba(236, 72, 153, 0.45);
}

.pip-btn-compact {
  padding: 6px 10px;
  font-size: 12px;
}

.pip-btn-block {
  width: 100%;
  text-align: center;
}

.pip-btn-danger {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.pip-studio {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1;
  min-height: 0;
  width: 100%;
  margin: 0;
  background: #07080c;
  align-items: stretch;
}

@media (max-width: 767px) {
  .pip-studio {
    grid-template-rows: minmax(480px, 55vh);
  }
}

/* Bord droit carte : inspecteur + style tracé */
.pip-map-edge-tools {
  position: absolute;
  right: 8px;
  top: 42%;
  transform: translateY(-50%);
  z-index: 10060;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.pip-calques-open-btn,
.pip-style-trace-btn,
.pip-style-trace-close {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.pip-style-trace-btn,
.pip-style-trace-close {
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 18, 28, 0.94);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  font-size: 22px;
  line-height: 1;
}

.pip-style-trace-btn:hover,
.pip-style-trace-close:hover {
  color: #f9a8d4;
  border-color: rgba(236, 72, 153, 0.45);
  background: rgba(236, 72, 153, 0.12);
}

.pip-style-trace-btn:focus-visible,
.pip-style-trace-close:focus-visible {
  outline: 2px solid rgba(236, 72, 153, 0.6);
  outline-offset: 2px;
}

.pip-style-trace-btn.pip-tool-active {
  color: #fbcfe8;
  border-color: rgba(236, 72, 153, 0.55);
  background: rgba(236, 72, 153, 0.18);
}

/* Bouton Calques (popup liste) */
.pip-calques-open-btn {
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 18, 28, 0.94);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.2s ease;
}

.pip-calques-open-btn:hover {
  color: #f9a8d4;
  border-color: rgba(236, 72, 153, 0.45);
  background: rgba(236, 72, 153, 0.12);
}

.pip-calques-open-btn:focus-visible {
  outline: 2px solid rgba(236, 72, 153, 0.6);
  outline-offset: 2px;
}

/* Nouvel objet sur la carte : pastille tant que la popup n’a pas été ouverte */
.pip-calques-open-btn--new {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35), 0 6px 24px rgba(0, 0, 0, 0.4);
}

.pip-calques-open-btn__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(145deg, #34d399, #10b981);
  box-shadow: 0 0 0 2px rgba(12, 14, 22, 0.95);
  pointer-events: none;
}

.pip-calques-open-btn__badge.pip-hidden {
  display: none !important;
}

.pip-calques-popup__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  max-height: min(70vh, 560px);
  overflow: hidden;
  padding-top: 4px;
}

.pip-calques-popup__body .pip-layer-list {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(52vh, 480px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pip-map-stage {
  position: relative;
  flex: 1;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  isolation: isolate;
}

/* Carte Leaflet en dessous des overlays (recherche + barre d’outils) */
#pipMap {
  width: 100%;
  flex: 1;
  min-height: 520px;
  background: #0a0c12;
  position: relative;
  z-index: 0;
}

/* Avant init Leaflet : pas de tuiles en dessous du globe Mapbox */
#pipMap.pip-map--leaflet-pending {
  visibility: hidden;
  pointer-events: none;
}

/* Leaflet conservé en mémoire pendant le globe (tracés intacts) — masqué sous le canvas Mapbox */
#pipMap.pip-map--under-globe {
  visibility: hidden;
  pointer-events: none;
}

/* Globe Mapbox GL — seule vue visible pendant l’intro (vrai projection: globe) */
.pip-mapbox-globe {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #02040a;
}

.pip-mapbox-globe.pip-mapbox-globe--active {
  display: block;
}

#pipMapboxGlobe {
  width: 100%;
  height: 100%;
  min-height: 320px;
}

/* Lueurs lointaines ciel globe — grandes taches douces, peu fréquentes (JS) */
.pip-globe-fireworks {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  overflow: visible;
  isolation: isolate;
  -webkit-mask-image: radial-gradient(
    ellipse 72% 68% at 50% 52%,
    transparent 0%,
    transparent 20%,
    rgba(255, 255, 255, 0.4) 30%,
    rgba(255, 255, 255, 0.95) 42%,
    #fff 100%
  );
  mask-image: radial-gradient(
    ellipse 72% 68% at 50% 52%,
    transparent 0%,
    transparent 20%,
    rgba(255, 255, 255, 0.4) 30%,
    rgba(255, 255, 255, 0.95) 42%,
    #fff 100%
  );
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

body.pip-phase-globe .pip-map-stage > .pip-globe-fireworks {
  display: block;
}

.pip-globe-flash {
  position: absolute;
  margin: 0;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  filter: blur(1.5px);
  mix-blend-mode: screen;
  animation: pipGwDistantGlow var(--pip-spark-dur, 3.2s) ease-in-out forwards;
  will-change: opacity, transform;
}

@keyframes pipGwDistantGlow {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.94);
  }
  28% {
    opacity: 0.55;
  }
  52% {
    opacity: 0.42;
    transform: translate(-50%, -50%) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pip-globe-flash {
    animation: none !important;
    opacity: 0 !important;
  }
}

body.pip-phase-globe .pip-scribble-dock {
  z-index: 100600 !important;
}

body.pip-phase-globe .pip-toolbar-fallback {
  z-index: 100620 !important;
}

body.pip-phase-globe .pip-map-edge-tools {
  z-index: 100650 !important;
}

body.pip-phase-globe .pip-map-hud,
body.pip-phase-globe .pip-north {
  opacity: 0;
  pointer-events: none;
}

/* HUD rayon cercle (échelle m) pendant le tracé */
.pip-circle-hud {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10090;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #ecfeff;
  background: linear-gradient(165deg, rgba(18, 21, 32, 0.96), rgba(10, 12, 20, 0.92));
  border: 1px solid rgba(236, 72, 153, 0.45);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 28px rgba(236, 72, 153, 0.18);
  pointer-events: none;
}

/* Dock outils — studio (lisible sur satellite, hi-contrast) */
.pip-scribble-dock {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 10040;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 72, 153, 0.4) rgba(0, 0, 0, 0.2);
  pointer-events: none;
  /* pas de filter: drop-shadow ici — peut masquer tout le bloc au-dessus de Leaflet (GPU / stacking) */
}

/* Quand le dock est déplacé dans le bandeau header */
.pip-header-tools .pip-scribble-dock {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  z-index: auto;
}

.pip-scribble-dock.pip-dock-force-map {
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  right: 10px !important;
  z-index: 10080 !important;
}

.pip-toolbar-fallback {
  position: absolute;
  top: 14px;
  left: 10px;
  right: 10px;
  z-index: 10100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  overflow: visible;
}

/* Centré par défaut ; position pixel si .pip-toolbar-fallback--placed (JS) */
.pip-toolbar-fallback:not(.pip-toolbar-fallback--placed) {
  left: 50%;
  right: auto;
  width: max-content;
  max-width: min(520px, calc(100vw - 24px));
  transform: translateX(-50%);
}

.pip-toolbar-fallback.pip-toolbar-fallback--placed {
  right: auto;
  transform: none;
}

.pip-toolbar-float {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: min(520px, calc(100vw - 24px));
  min-width: 0;
  border-radius: 12px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(16, 18, 30, 0.98) 0%, rgba(8, 10, 18, 0.97) 100%);
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(236, 72, 153, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.pip-toolbar-drag {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 4px 6px 5px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  background: rgba(0, 0, 0, 0.32);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pip-toolbar-drag:active {
  cursor: grabbing;
}

.pip-toolbar-drag__grip {
  width: 12px;
  height: 15px;
  border-radius: 3px;
  opacity: 0.8;
  flex-shrink: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.3) 0px,
    rgba(255, 255, 255, 0.3) 2px,
    transparent 2px,
    transparent 5px
  );
}

.pip-toolbar-drag__label {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.72);
}

.pip-toolbar-panel-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pip-toolbar-panel-toggle {
  display: none;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(236, 72, 153, 0.12);
  color: rgba(248, 250, 252, 0.95);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pip-toolbar-panel-toggle:hover {
  background: rgba(236, 72, 153, 0.22);
  border-color: rgba(236, 72, 153, 0.45);
}

.pip-toolbar-panel-toggle:focus-visible {
  outline: 2px solid rgba(236, 72, 153, 0.55);
  outline-offset: 2px;
}

.pip-toolbar-panel-toggle__ico {
  display: flex;
  line-height: 0;
}

.pip-toolbar-panel-toggle__ico svg {
  transition: transform 0.2s ease;
}

.pip-toolbar-float--panel-open .pip-toolbar-panel-toggle__ico svg {
  transform: rotate(180deg);
}

.pip-toolbar-panel-toggle__txt--open {
  display: none;
}

.pip-toolbar-float--panel-open .pip-toolbar-panel-toggle__txt--open {
  display: inline;
}

.pip-toolbar-float--panel-open .pip-toolbar-panel-toggle__txt--shut {
  display: none;
}

@media (max-width: 960px) {
  .pip-toolbar-panel-toggle {
    display: inline-flex;
  }

  .pip-toolbar-float:not(.pip-toolbar-float--panel-open) .pip-toolbar-panel-body {
    display: none !important;
  }

  .pip-toolbar-float--panel-open .pip-toolbar-panel-body {
    max-height: min(58vh, 480px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .pip-toolbar-drag {
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 6px 10px 7px;
  }

  .pip-toolbar-float {
    max-width: min(100%, calc(100vw - 16px)) !important;
  }

  .pip-toolbar-float .pip-scribble-row--tools-only {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .pip-toolbar-float .pip-toolbar-first-row-tail {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
}

@media (min-width: 961px) {
  .pip-toolbar-panel-toggle {
    display: none !important;
  }
}

.pip-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pip-toolbar-secondary-wrap {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Fleches + style tracé + recherche — alignés à droite du bouton réglages */
.pip-toolbar-first-row-tail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 5px;
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.pip-toolbar-map-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  color: rgba(248, 250, 252, 0.95);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pip-toolbar-map-btn:hover,
.pip-toolbar-map-btn--open {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
}

.pip-toolbar-map-btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

.pip-toolbar-map-panel__body .pip-dock-cluster--map {
  flex-wrap: wrap;
  max-width: 100%;
}

.pip-toolbar-map-panel {
  position: fixed;
  z-index: 10192;
  width: min(340px, calc(100vw - 28px));
  max-height: min(85vh, 680px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(18, 21, 32, 0.99) 0%, rgba(10, 12, 20, 0.98) 100%);
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(236, 72, 153, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.pip-toolbar-map-panel.pip-hidden {
  display: none !important;
}

.pip-toolbar-settings-panel__body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pip-toolbar-settings-section {
  padding: 10px 12px;
}

.pip-toolbar-settings-section + .pip-toolbar-settings-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pip-toolbar-settings-section--map {
  padding-bottom: 10px;
}

.pip-toolbar-more-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 1;
  background: inherit;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.pip-toolbar-more-panel__head:active {
  cursor: grabbing;
}

.pip-toolbar-more-panel__grip {
  flex-shrink: 0;
  width: 11px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.72;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.32) 0px,
    rgba(255, 255, 255, 0.32) 2px,
    transparent 2px,
    transparent 5px
  );
}

.pip-toolbar-more-panel__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.92);
}

.pip-toolbar-more-panel__close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 250, 252, 0.85);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.pip-toolbar-more-panel__close:hover {
  background: rgba(236, 72, 153, 0.22);
}

.pip-toolbar-more-panel__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pip-header-actions--in-more {
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  gap: 8px !important;
}

.pip-btn--toolbar-more {
  width: 100%;
  justify-content: center;
  font-size: 12px !important;
  padding: 8px 10px !important;
  min-height: 0 !important;
}

.pip-search-float--toolbar {
  flex: 0 1 118px;
  width: 100%;
  max-width: 118px;
  min-width: 0;
}

.pip-search-float--toolbar .pip-search-inner {
  min-height: 28px;
  padding: 1px 3px 1px 5px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  gap: 3px;
}

.pip-search-float--toolbar .pip-search-inner .pip-btn-compact {
  padding: 3px 6px;
  font-size: 10px;
  min-height: 0;
}

.pip-search-float--toolbar .pip-search-inner input[type="search"] {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.01em;
  color: rgba(248, 250, 252, 0.98);
  min-width: 0;
  text-overflow: ellipsis;
}

.pip-toolbar-float .pip-scribble-row--tools-only {
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: auto;
  min-width: 0;
}

.pip-toolbar-float .pip-dock-cluster--history {
  flex-shrink: 0;
}

.pip-search-float--in-more {
  width: 100%;
  max-width: none !important;
}

.pip-search-float--in-more .pip-search-inner {
  min-height: 36px;
}

.pip-toolbar-style-block__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.55);
  margin-bottom: 6px;
}

.pip-toolbar-style-block__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
}

/* Style du tracé — compact (1re rangée : après les flèches, avant la recherche) */
.pip-toolbar-float .pip-toolbar-style-block--dock {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 3px 4px;
  padding: 1px 3px;
  flex-shrink: 1;
  min-width: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.pip-toolbar-float .pip-toolbar-style-block__row--dock {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 3px 5px;
  flex: 1 1 auto;
  min-width: 0;
}

.pip-toolbar-float .pip-toolbar-style-block__row--dock .pip-sb-color {
  flex-direction: column;
  gap: 0;
}

.pip-toolbar-float .pip-toolbar-style-block__row--dock .pip-sb-mini {
  font-size: 7px;
  margin-bottom: 1px;
  line-height: 1;
}

.pip-toolbar-float .pip-toolbar-style-block__row--dock .pip-sb-color input[type="color"] {
  width: 26px;
  height: 24px;
  border-radius: 6px;
  padding: 1px;
}

.pip-toolbar-float .pip-toolbar-style-block__row--dock .pip-sb-num input {
  width: 34px;
  height: 24px;
  font-size: 11px;
  padding: 0 2px;
  border-radius: 6px;
}

.pip-toolbar-float .pip-toolbar-style-block__row--dock .pip-sb-dash select {
  height: 24px;
  max-width: 72px;
  font-size: 10px;
  font-weight: 600;
  padding: 0 4px;
  border-radius: 6px;
}

.pip-toolbar-float .pip-sb-sep--style {
  height: 22px;
  margin: 0 2px;
  align-self: center;
}

.pip-toolbar-float .pip-scribble-row--tools {
  flex-wrap: wrap;
  align-items: center;
  row-gap: 6px;
}

.pip-toolbar-float .pip-sb-svg {
  width: 15px;
  height: 15px;
}

.pip-toolbar-float .pip-sb-btn,
.pip-toolbar-float .pip-sb-tool {
  min-width: 30px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.pip-toolbar-float .pip-sb-tool--letter .pip-sb-letter {
  font-size: 12px;
}

.pip-toolbar-float .pip-sb-sep {
  height: 20px;
  margin: 0 1px;
}

.pip-toolbar-float .pip-sb-sep--accent {
  height: 24px;
  margin: 0 3px;
}

.pip-toolbar-float .pip-dock-cluster {
  padding: 2px 3px;
  gap: 3px;
}

.pip-toolbar-float .pip-scribble-row {
  padding: 4px 5px !important;
  gap: 4px 5px !important;
}


.pip-toolbar-fallback .pip-header-actions.pip-header-actions--in-more {
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.pip-toolbar-panel-body > .pip-scribble-row {
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.pip-toolbar-panel-body > .pip-scribble-row + .pip-scribble-row {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.pip-toolbar-fallback .pip-header-actions,
.pip-toolbar-fallback .pip-scribble-dock,
.pip-toolbar-fallback .pip-toolbar-float,
.pip-toolbar-fallback .pip-header {
  pointer-events: auto;
}

.pip-toolbar-fallback .pip-header {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.pip-toolbar-fallback .pip-header-actions {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 2;
  margin-left: 0;
  justify-content: flex-start;
  flex-wrap: wrap;
  white-space: normal;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--pip-edge);
  border-radius: 12px;
  background: var(--pip-surface);
  box-shadow: var(--pip-inner), 0 4px 22px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(236, 72, 153, 0.16);
}

.pip-toolbar-fallback .pip-header-actions .pip-btn {
  min-height: 36px;
  padding: 8px 12px;
}

.pip-toolbar-fallback .pip-scribble-dock {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: auto !important;
  width: auto;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.pip-toolbar-fallback .pip-scribble-row--style {
  position: relative;
  z-index: 5;
  overflow: visible;
}

.pip-toolbar-fallback .pip-scribble-row--style .pip-search-float {
  z-index: 2000;
}

.pip-toolbar-fallback .pip-toolbar-panel-body > .pip-scribble-row:not(.pip-scribble-row--tools-only) {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.pip-toolbar-fallback .pip-toolbar-panel-body > .pip-scribble-row--tools-only {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
  flex-wrap: nowrap;
  align-items: center;
}

.pip-toolbar-fallback .pip-toolbar-panel-body {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}

.pip-toolbar-fallback .pip-scribble-row--style .pip-search-float:not(.pip-search-float--toolbar) {
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 100%;
}

/* Hard reset fallback layout to avoid cumulative conflicts */
.pip-toolbar-fallback .pip-toolbar-fallback-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.pip-toolbar-fallback .pip-header {
  display: none !important;
}

.pip-toolbar-fallback .pip-header-actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  width: auto;
  min-width: 260px;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--pip-edge);
  border-radius: 12px;
  background: var(--pip-surface);
  box-shadow: var(--pip-inner), 0 4px 22px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(236, 72, 153, 0.16);
}

.pip-toolbar-fallback .pip-scribble-dock {
  display: flex !important;
  position: static !important;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  z-index: auto !important;
}

@media (max-width: 1400px) {
  .pip-toolbar-fallback {
    top: 10px;
    gap: 6px;
  }

  .pip-toolbar-fallback .pip-header {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .pip-toolbar-fallback .pip-header-actions,
  .pip-toolbar-fallback .pip-scribble-dock {
    width: auto;
    max-width: none;
    min-width: 0;
    flex: 0 0 auto;
    overflow-x: visible;
    overflow-y: visible;
  }

  .pip-toolbar-fallback .pip-header-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .pip-toolbar-fallback .pip-scribble-dock {
    flex: 1 1 auto;
    min-width: min(100%, 420px);
  }
}

@media (max-width: 980px) {
  .pip-toolbar-fallback:not(.pip-toolbar-fallback--placed) {
    left: 6px;
    right: 6px;
  }

  .pip-toolbar-fallback .pip-header-actions .pip-btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .pip-toolbar-fallback .pip-scribble-row {
    padding: 7px 8px;
    gap: 6px 8px;
  }

  .pip-toolbar-fallback .pip-scribble-row--style .pip-search-float {
    flex-basis: 100%;
    min-width: 0;
  }
}

.pip-toolbar-panel-body > .pip-scribble-row {
  flex: 0 0 auto;
  min-height: 0;
}

.pip-scribble-dock * {
  pointer-events: auto;
}

.pip-scribble-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(6px, 0.8vw, 10px);
  padding: clamp(6px, 0.6vw + 4px, 10px) clamp(8px, 1vw + 4px, 12px);
  background-color: rgba(14, 16, 26, 0.98);
  background: var(--pip-surface);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid var(--pip-edge);
  border-radius: 12px;
  box-shadow: var(--pip-inner), 0 4px 22px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(236, 72, 153, 0.16);
}

.pip-dock-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pip-dock-cluster--history {
  background: rgba(236, 72, 153, 0.08);
  border-color: rgba(236, 72, 153, 0.2);
}

.pip-dock-cluster--modes {
  background: rgba(236, 72, 153, 0.06);
  border-color: rgba(236, 72, 153, 0.15);
}

.pip-dock-cluster--draw {
  background: rgba(251, 191, 36, 0.07);
  border-color: rgba(251, 191, 36, 0.14);
}

.pip-dock-cluster--map {
  gap: 8px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
}

.pip-display-wrap,
.pip-style-studio-wrap {
  position: relative;
  align-self: center;
  flex-shrink: 0;
}

.pip-sb-tool--display {
  min-width: 38px;
  padding: 0 8px;
  justify-content: center;
}

.pip-display-panel {
  z-index: 200100;
  width: min(92vw, 300px);
  max-width: 300px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--pip-edge);
  background: var(--pip-surface);
  box-shadow: var(--pip-inner), 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(236, 72, 153, 0.18);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

/* Modale centrée (portée sur body) */
.pip-display-panel.pip-display-panel--portal {
  position: relative;
  z-index: 300200;
  max-width: min(400px, calc(100vw - 32px));
  padding: 22px 22px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(236, 72, 153, 0.12) 0%, transparent 55%),
    linear-gradient(175deg, rgba(22, 24, 38, 0.99) 0%, rgba(10, 12, 22, 0.97) 100%);
  box-shadow:
    0 0 0 1px rgba(236, 72, 153, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 32px 100px rgba(0, 0, 0, 0.65),
    0 12px 40px rgba(0, 0, 0, 0.4);
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 72, 153, 0.35) rgba(0, 0, 0, 0.2);
}

.pip-display-panel.pip-display-panel--portal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(200px, 60%);
  height: 4px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(167, 139, 250, 0.5),
    rgba(236, 72, 153, 0.95),
    rgba(244, 114, 182, 0.85),
    rgba(236, 72, 153, 0.95),
    rgba(167, 139, 250, 0.5),
    transparent
  );
  pointer-events: none;
}

.pip-display-panel.pip-display-panel--portal::-webkit-scrollbar {
  width: 8px;
}

.pip-display-panel.pip-display-panel--portal::-webkit-scrollbar-thumb {
  background: rgba(236, 72, 153, 0.35);
  border-radius: 8px;
}

.pip-display-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300150;
  background: radial-gradient(ellipse 120% 80% at 50% 35%, rgba(15, 18, 30, 0.35) 0%, rgba(4, 6, 12, 0.78) 55%, rgba(2, 3, 8, 0.88) 100%);
  backdrop-filter: blur(8px) saturate(1.15);
  -webkit-backdrop-filter: blur(8px) saturate(1.15);
}

body.pip-display-modal-open {
  overflow: hidden;
}

body.pip-style-studio-modal-open:not(.pip-display-modal-open) {
  overflow: visible;
}

/* Fond « style tracé » : pas de flou ni d’assombrissement — la carte reste lisible et cliquable */
.pip-style-studio-backdrop {
  z-index: 300158 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
}

/* Popup style tracé (même famille visuelle que Fond de carte, déplaçable) */
.pip-style-popup {
  position: fixed;
  z-index: 300205;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100vw - 28px));
  max-height: min(88vh, 560px);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  pointer-events: none;
}

.pip-style-popup.pip-style-popup--studio {
  width: min(440px, calc(100vw - 20px));
  max-height: none;
  top: 42%;
}

.pip-style-popup:not(.pip-hidden) {
  pointer-events: auto;
}

.pip-style-popup.pip-style-popup--portal {
  z-index: 300210;
}

.pip-style-popup.pip-style-popup--positioned {
  transform: none;
}

.pip-style-popup__move {
  position: absolute;
  z-index: 4;
  background: transparent;
  cursor: move;
  touch-action: none;
}

.pip-style-popup__move--n {
  top: -8px;
  left: 16px;
  right: 16px;
  height: 14px;
}

.pip-style-popup__move--s {
  bottom: -8px;
  left: 16px;
  right: 16px;
  height: 14px;
}

.pip-style-popup__move--w {
  top: 16px;
  bottom: 16px;
  left: -8px;
  width: 14px;
}

.pip-style-popup__move--e {
  top: 16px;
  bottom: 16px;
  right: -8px;
  width: 14px;
}

.pip-style-popup__panel {
  position: relative;
  z-index: 2;
  margin: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(236, 72, 153, 0.12) 0%, transparent 55%),
    linear-gradient(175deg, rgba(22, 24, 38, 0.99) 0%, rgba(10, 12, 22, 0.97) 100%);
  box-shadow:
    0 0 0 1px rgba(236, 72, 153, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 32px 100px rgba(0, 0, 0, 0.65),
    0 12px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  pointer-events: auto;
}

.pip-style-popup__panel::before {
  content: none;
}

.pip-style-popup__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 16px 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  cursor: move;
  touch-action: none;
  user-select: none;
}

.pip-style-popup__head:active {
  cursor: grabbing;
}

.pip-style-popup__grip {
  flex-shrink: 0;
  width: 28px;
  height: 36px;
  margin-top: 2px;
  border-radius: 8px;
  border: 1px dashed rgba(236, 72, 153, 0.35);
  background: repeating-linear-gradient(
    90deg,
    rgba(236, 72, 153, 0.12),
    rgba(236, 72, 153, 0.12) 3px,
    transparent 3px,
    transparent 6px
  );
  opacity: 0.85;
}

.pip-style-popup__head-text {
  flex: 1;
  min-width: 0;
}

.pip-style-popup__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: rgba(241, 245, 249, 0.98);
}

.pip-style-popup__lead {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(241, 245, 249, 0.52);
}

.pip-style-popup__lead--studio {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(241, 245, 249, 0.48);
}

.pip-style-popup__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.75);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pip-style-popup__close:hover {
  color: #fce7f3;
  border-color: rgba(236, 72, 153, 0.45);
  background: rgba(236, 72, 153, 0.15);
}

.pip-style-popup__body {
  padding: 14px 18px 20px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 72, 153, 0.35) rgba(0, 0, 0, 0.2);
}

.pip-style-popup.pip-style-popup--studio .pip-style-popup__body.pip-style-studio-body {
  max-height: none;
  overflow: visible;
  padding: 10px 14px 12px;
}

.pip-style-popup__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.pip-style-popup__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pip-style-popup__field--span2 {
  grid-column: 1 / -1;
}

.pip-style-popup__field--full {
  grid-column: 1 / -1;
}

.pip-style-popup__lab {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(241, 245, 249, 0.55);
}

.pip-style-popup__color {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  padding: 3px;
  background: rgba(0, 0, 0, 0.15);
}

.pip-style-popup__numrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pip-style-popup__numrow--compact {
  gap: 8px;
}

.pip-style-popup__range {
  flex: 1;
  min-width: 0;
  height: 8px;
  border-radius: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.pip-style-popup__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f9a8d4, #ec4899);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.45);
  cursor: pointer;
}

.pip-style-popup__range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f9a8d4, #ec4899);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.45);
  cursor: pointer;
}

.pip-style-popup__num {
  width: 4.25rem;
  flex-shrink: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 10, 18, 0.85);
  color: #f8fafc;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
}

.pip-style-popup__num:focus {
  outline: none;
  border-color: rgba(236, 72, 153, 0.55);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

.pip-style-popup__select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 10, 18, 0.92);
  color: #f8fafc;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.pip-style-popup__select:focus {
  outline: none;
  border-color: rgba(236, 72, 153, 0.55);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

@media (max-width: 520px) {
  .pip-style-popup__grid {
    grid-template-columns: 1fr;
  }

  .pip-style-popup__field--span2,
  .pip-style-popup__field--full {
    grid-column: 1;
  }
}

.pip-display-panel__head {
  margin-bottom: 12px;
}

.pip-display-panel.pip-display-panel--portal .pip-display-panel__head {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pip-display-panel__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pip-tx);
}

.pip-display-panel.pip-display-panel--portal .pip-display-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.pip-display-panel.pip-display-panel--portal .pip-display-panel__title::before {
  content: "";
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid rgba(236, 72, 153, 0.4);
  background-color: rgba(236, 72, 153, 0.16);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fce7f3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5'/%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 18px rgba(236, 72, 153, 0.18);
}

.pip-display-panel__lead {
  margin: 0;
  font-size: 11px;
  color: var(--pip-tx-muted);
  line-height: 1.4;
}

.pip-display-panel.pip-display-panel--portal .pip-display-panel__lead {
  margin-top: 6px;
  padding-left: 46px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(241, 245, 249, 0.52);
}

.pip-display-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--pip-tx);
}

.pip-display-panel.pip-display-panel--portal .pip-display-row {
  margin-bottom: 16px;
}

.pip-display-row--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pip-display-row__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.pip-display-panel.pip-display-panel--portal .pip-display-row__label {
  font-size: 12px;
  color: rgba(241, 245, 249, 0.92);
}

.pip-display-row__label output {
  font-variant-numeric: tabular-nums;
  min-width: 2.5em;
  text-align: right;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fce7f3;
  background: rgba(236, 72, 153, 0.14);
  border: 1px solid rgba(236, 72, 153, 0.22);
}

/* Curseurs personnalisés (remplissage = --range-pct, posé en JS) */
.pip-display-range-wrap {
  --range-pct: 50%;
  display: block;
  padding: 4px 2px 2px;
}

.pip-display-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.pip-display-range:focus {
  outline: none;
}

.pip-display-range:focus-visible {
  outline: none;
}

.pip-display-range-wrap:focus-within {
  outline: 2px solid rgba(236, 72, 153, 0.45);
  outline-offset: 4px;
  border-radius: 12px;
}

/* WebKit */
.pip-display-range-wrap--accent .pip-display-range::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(236, 72, 153, 0.95) 0%,
    rgba(244, 114, 182, 0.85) var(--range-pct),
    rgba(255, 255, 255, 0.07) var(--range-pct),
    rgba(255, 255, 255, 0.07) 100%
  );
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.pip-display-range-wrap--hue .pip-display-range::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #f43f5e,
    #f97316,
    #eab308,
    #22c55e,
    #14b8a6,
    #3b82f6,
    #a855f7,
    #ec4899,
    #f43f5e
  );
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.pip-display-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: linear-gradient(160deg, #fff 0%, #f0abfc 45%, #e879f9 100%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(236, 72, 153, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.pip-display-range-wrap--hue .pip-display-range::-webkit-slider-thumb {
  margin-top: -5px;
  background: linear-gradient(160deg, #fff 0%, #f8fafc 100%);
  border-color: rgba(15, 23, 42, 0.35);
}

.pip-display-range:hover::-webkit-slider-thumb {
  transform: scale(1.06);
  box-shadow:
    0 4px 14px rgba(236, 72, 153, 0.45),
    0 0 0 1px rgba(236, 72, 153, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.pip-display-range:active::-webkit-slider-thumb {
  transform: scale(0.98);
}

/* Firefox */
.pip-display-range-wrap--accent .pip-display-range::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(236, 72, 153, 0.95) 0%,
    rgba(244, 114, 182, 0.85) var(--range-pct),
    rgba(255, 255, 255, 0.07) var(--range-pct),
    rgba(255, 255, 255, 0.07) 100%
  );
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.pip-display-range-wrap--hue .pip-display-range::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #f43f5e,
    #f97316,
    #eab308,
    #22c55e,
    #14b8a6,
    #3b82f6,
    #a855f7,
    #ec4899,
    #f43f5e
  );
}

.pip-display-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: linear-gradient(160deg, #fff 0%, #f0abfc 45%, #e879f9 100%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(236, 72, 153, 0.5);
}

.pip-display-range-wrap--hue .pip-display-range::-moz-range-thumb {
  background: linear-gradient(160deg, #fff 0%, #f8fafc 100%);
  border-color: rgba(15, 23, 42, 0.35);
}

.pip-display-row--check {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pip-display-row--check:hover {
  border-color: rgba(236, 72, 153, 0.25);
  background: rgba(236, 72, 153, 0.06);
}

.pip-display-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  accent-color: var(--pip-accent);
  cursor: pointer;
}

.pip-display-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: stretch;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pip-display-panel.pip-display-panel--portal .pip-display-panel__actions {
  margin-top: 4px;
  padding-top: 18px;
  gap: 12px;
}

.pip-display-panel.pip-display-panel--portal .pip-display-btn-secondary,
.pip-display-panel.pip-display-panel--portal .pip-display-btn-primary {
  flex: 1 1 auto;
  min-height: 42px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
}

.pip-display-btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.pip-display-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.pip-display-btn-primary {
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.25);
}

.pip-sb-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

.pip-sb-letter {
  font-size: 15px;
  font-weight: 800;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1;
}

.pip-sb-btn,
.pip-sb-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  color: var(--pip-tx);
  line-height: 0;
  transition:
    transform 0.12s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.pip-sb-btn:hover,
.pip-sb-tool:hover {
  background: var(--pip-accent-soft);
  border-color: var(--pip-accent-glow);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.2), 0 6px 20px rgba(236, 72, 153, 0.2);
  transform: translateY(-1px);
}

.pip-sb-btn:focus-visible,
.pip-sb-tool:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(10, 12, 20, 0.95), 0 0 0 4px var(--pip-accent);
}

.pip-sb-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pip-sb-tool--draw:hover {
  background: var(--pip-draw-soft);
  border-color: var(--pip-draw-glow);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2), 0 6px 20px rgba(251, 191, 36, 0.1);
}

.pip-sb-tool--draw:focus-visible {
  box-shadow: 0 0 0 2px rgba(10, 12, 20, 0.95), 0 0 0 4px var(--pip-draw);
}

.pip-sb-tool.pip-tool-active {
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.35), rgba(236, 72, 153, 0.12));
  border-color: rgba(236, 72, 153, 0.7);
  color: #fff1f7;
  box-shadow:
    0 0 0 1px rgba(236, 72, 153, 0.45),
    0 4px 22px rgba(236, 72, 153, 0.24);
  transform: translateY(-1px);
}

.pip-sb-tool--draw.pip-tool-active {
  background: linear-gradient(180deg, rgba(244, 114, 182, 0.36), rgba(244, 114, 182, 0.14));
  border-color: rgba(244, 114, 182, 0.75);
  color: #fff5fa;
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.5),
    0 4px 22px rgba(244, 114, 182, 0.22);
}

.pip-sb-sep {
  width: 1px;
  height: 28px;
  align-self: center;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  margin: 0 2px;
  flex-shrink: 0;
}

.pip-sb-sep--accent {
  width: 2px;
  height: 32px;
  margin: 0 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.1), rgba(244, 114, 182, 0.65), rgba(236, 72, 153, 0.1));
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}

.pip-sb-mini {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pip-tx-muted);
  margin-bottom: 2px;
}

.pip-sb-color {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pip-sb-color input[type="color"] {
  width: 42px;
  height: 30px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.35);
}

.pip-sb-num input {
  width: 50px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
  color: var(--pip-tx);
}

.pip-sb-dash select {
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 500;
  padding: 0 8px;
  max-width: 118px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--pip-tx);
  cursor: pointer;
}

.pip-sb-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--pip-tx-muted);
  cursor: help;
}

.pip-sb-check input {
  accent-color: var(--pip-accent);
  width: 15px;
  height: 15px;
}

.pip-sb-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pip-tx-muted);
}

.pip-sb-select {
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 600;
  padding: 0 10px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--pip-tx);
  max-width: 128px;
  cursor: pointer;
}

.pip-sb-select:focus-visible {
  outline: none;
  border-color: var(--pip-accent-glow);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

@media (max-width: 1180px) {
  .pip-main {
    min-height: calc(100vh - var(--app-top-chrome-height, 88px));
  }

  .top-user-actions .top-pyromap-brand__logo {
    height: 70px;
    max-width: min(312px, 94vw);
  }

  body.has-top-profile-menu:has(.top-pyromap-brand) .pip-main {
    padding-top: 108px !important;
  }

  body.has-top-profile-menu .top-user-actions:has(.top-pyromap-brand) {
    min-height: 92px !important;
  }

  .pip-btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .pip-toolbar-panel-body > .pip-scribble-row {
    flex: 1 1 auto;
    min-width: 0;
  }

}

/* style.css force 80px sur .top-user-actions ≤980px — place pour le logo Pyromap */
@media (max-width: 980px) {
  body.has-top-profile-menu .top-user-actions:has(.top-pyromap-brand) {
    height: auto !important;
    min-height: 96px !important;
    max-height: none !important;
  }

  body.has-top-profile-menu:has(.top-pyromap-brand) .pip-main {
    padding-top: 112px !important;
  }
}

.pip-sb-row-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(244, 114, 182, 0.98);
  margin-right: 4px;
  text-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

.pip-sb-sym {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--pip-tx);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.pip-sb-sym:hover {
  background: rgba(236, 72, 153, 0.14);
  border-color: rgba(236, 72, 153, 0.45);
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.16);
  transform: translateY(-1px);
}

.pip-sb-sym:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(10, 12, 20, 0.95), 0 0 0 4px rgba(236, 72, 153, 0.55);
}

.pip-quick-radius {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.pip-quick-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  width: 100%;
}

.pip-chip {
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: var(--pip-accent-soft);
  color: #ecfeff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.pip-chip:hover {
  background: rgba(34, 211, 238, 0.28);
  border-color: var(--pip-accent-glow);
  transform: translateY(-1px);
}

/* Masquer la barre Geoman native — tout passe par pip-scribble-dock */
.leaflet-top.leaflet-left .leaflet-pm-toolbar,
.leaflet-pm-toolbar {
  display: none !important;
}

/* Recherche : même ligne que ↶ ↷ (première rangée du dock) */
.pip-scribble-row--style .pip-search-float {
  position: relative;
  flex: 1 1 160px;
  min-width: min(180px, 100%);
  max-width: min(380px, 42vw);
  z-index: 2;
}

.pip-search-float {
  width: 100%;
}

.pip-search-inner {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: var(--pip-inner), 0 4px 16px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  min-height: 40px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pip-search-inner:focus-within {
  border-color: var(--pip-accent-glow);
  box-shadow: var(--pip-inner), 0 0 0 1px rgba(34, 211, 238, 0.25), 0 6px 24px rgba(34, 211, 238, 0.12);
}

.pip-search-ico {
  flex-shrink: 0;
  align-self: center;
  margin-left: 10px;
  color: var(--pip-accent);
  opacity: 0.85;
}

.pip-search-inner input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 13px;
  padding: 8px 8px;
  outline: none;
}

.pip-search-inner input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.pip-search-inner .pip-btn-compact {
  align-self: stretch;
  margin: 0;
  border-radius: 0;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.28), rgba(236, 72, 153, 0.12));
  color: #fff1f7;
}

.pip-search-inner .pip-btn-compact:hover {
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.42), rgba(236, 72, 153, 0.2));
}

.pip-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin-top: 0;
  background: rgba(18, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  max-height: min(240px, 40vh);
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  z-index: 1200;
}

.pip-search-item {
  padding: 10px 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.35;
}

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

.pip-search-item:hover,
.pip-search-item.pip-search-item-active {
  background: var(--pip-accent-soft);
}

.pip-search-item small {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

.pip-search-status {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(251, 191, 36, 0.95);
  z-index: 1199;
  pointer-events: none;
}

.pip-map-tools {
  display: none;
}

.pip-tools-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
}

.pip-select-dark {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.pip-map-hud {
  position: absolute;
  bottom: 28px;
  left: 12px;
  z-index: 10020;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  background: linear-gradient(165deg, rgba(18, 21, 32, 0.94), rgba(10, 12, 20, 0.9));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(236, 72, 153, 0.2);
  border-radius: 10px;
  font-size: 11px;
  color: var(--pip-tx-muted);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  max-width: 90%;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.pip-coords {
  font-family: ui-monospace, monospace;
  color: var(--pip-tx);
}

.pip-hud-sel {
  color: rgba(244, 114, 182, 0.95);
  font-size: 11px;
  font-weight: 600;
}

.pip-north {
  position: absolute;
  bottom: 102px;
  right: 18px;
  z-index: 10030;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.pip-north__n {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(245, 248, 255, 0.95);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

.pip-north__compass {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(245, 248, 255, 0.82);
  background: rgba(8, 12, 20, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pip-north__needle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
}

.pip-north__needle--north {
  top: 7px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 24px solid rgba(248, 250, 255, 0.96);
}

.pip-north__needle--south {
  bottom: 7px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 20px solid rgba(112, 122, 140, 0.88);
}

/* Calques : contenu dans #pipCalquesPopup (.pip-calques-popup__body) */

.pip-panel-intro {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.45;
  margin: 0 0 12px;
  padding: 0;
  border: none;
  background: transparent;
}

.pip-h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 10px;
}

.pip-sel-style-section .pip-h3--style-block {
  margin-top: 16px;
  margin-bottom: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pip-style-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pip-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pip-style-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.pip-style-grid input[type="color"] {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  padding: 2px;
}

.pip-style-grid input[type="range"] {
  width: 100%;
}

.pip-num {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  text-align: right;
}

.pip-muted {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

.pip-sel-type {
  font-size: 13px;
  font-weight: 600;
  color: rgba(236, 72, 153, 0.85);
  margin: 0 0 10px;
}

.pip-full {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
  grid-column: 1 / -1;
}

.pip-full input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff;
  font-size: 13px;
}

.pip-measure {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 10px;
  font-variant-numeric: tabular-nums;
}

.pip-sel-style-hint {
  margin-top: 10px;
  line-height: 1.4;
}

.pip-style-grid .pip-sel-dash {
  grid-column: 1 / -1;
}

/* Studio : un seul défilement éventuel sur la carte du panneau (pas de zone interne imbriquée) */
.pip-style-popup.pip-style-popup--studio .pip-style-popup__panel {
  max-height: min(94vh, 820px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 72, 153, 0.35) rgba(0, 0, 0, 0.2);
}

.pip-style-popup.pip-style-popup--studio .pip-style-studio-body {
  overflow: visible;
}

.pip-style-popup.pip-style-popup--studio .pip-style-popup__head {
  padding: 12px 14px 10px 16px;
}

.pip-style-popup.pip-style-popup--studio .pip-style-popup__grip {
  width: 24px;
  height: 30px;
}

.pip-style-popup.pip-style-popup--studio .pip-style-popup__title {
  font-size: 16px;
  margin-bottom: 4px;
}

.pip-style-popup.pip-style-popup--studio .pip-style-studio-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pip-style-popup.pip-style-popup--studio .pip-style-section {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.pip-studio-editor .pip-sel-type {
  margin-bottom: 8px;
}

.pip-studio-editor .pip-full {
  margin-bottom: 8px;
}

.pip-sel-style-section--studio {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.pip-sel-style-section--studio .pip-h3--style-block {
  margin-top: 10px;
  margin-bottom: 6px;
  padding-top: 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.pip-sel-style--studio {
  gap: 8px 10px;
}

.pip-studio-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(0, 0, 0, 0.28), rgba(8, 10, 18, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pip-studio-field:focus-within {
  border-color: rgba(236, 72, 153, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(236, 72, 153, 0.12);
}

.pip-studio-field__lab {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(241, 245, 249, 0.55);
}

.pip-studio-field--text .pip-studio-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 8, 14, 0.92);
  color: #f8fafc;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pip-studio-field--text .pip-studio-input:focus {
  outline: none;
  border-color: rgba(236, 72, 153, 0.5);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.18);
}

.pip-studio-circle {
  margin-bottom: 6px;
}

.pip-quick-radius--studio {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}

.pip-quick-label--presets {
  display: block;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(241, 245, 249, 0.62);
}

.pip-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.pip-quick-radius--studio .pip-chip--preset {
  min-width: 48px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fce7f3;
  border-color: rgba(236, 72, 153, 0.4);
  background: rgba(236, 72, 153, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pip-quick-radius--studio .pip-chip--preset:hover {
  background: rgba(236, 72, 153, 0.24);
  border-color: rgba(244, 114, 182, 0.65);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.2);
  transform: translateY(-1px);
}

.pip-quick-radius--studio .pip-chip--preset:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(10, 12, 20, 0.95), 0 0 0 4px rgba(236, 72, 153, 0.45);
}

.pip-quick-radius--studio .pip-chip--preset.pip-chip--active {
  color: #fff7fb;
  border-color: rgba(251, 113, 133, 0.85);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.42), rgba(236, 72, 153, 0.28));
  box-shadow: 0 8px 18px rgba(244, 63, 94, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.pip-studio-field--color .pip-studio-color {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.pip-studio-field--color .pip-studio-color:hover {
  border-color: rgba(236, 72, 153, 0.45);
  transform: scale(1.01);
}

.pip-studio-field--color .pip-studio-color::-webkit-color-swatch-wrapper {
  padding: 0;
}

.pip-studio-field--color .pip-studio-color::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

/* Curseurs = même composant que le popup Affichage (.pip-display-range + wrap --accent) */
.pip-studio-field--range .pip-studio-field__row--slider {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pip-studio-field__row--slider .pip-display-range-wrap {
  flex: 1;
  min-width: 0;
  padding: 2px 0 0;
}

.pip-studio-val-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pip-studio-val-input {
  box-sizing: border-box;
  width: 3.35rem;
  min-width: 3rem;
  padding: 4px 6px;
  border-radius: 8px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  color: #fce7f3;
  background: rgba(236, 72, 153, 0.14);
  border: 1px solid rgba(236, 72, 153, 0.22);
  -moz-appearance: textfield;
  appearance: textfield;
}

.pip-studio-val-input::-webkit-outer-spin-button,
.pip-studio-val-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pip-studio-val-input:focus {
  outline: none;
  border-color: rgba(236, 72, 153, 0.55);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

.pip-studio-val-suffix {
  font-size: 11px;
  font-weight: 600;
  color: rgba(252, 231, 243, 0.75);
  user-select: none;
}

.pip-studio-field--dash {
  grid-column: 1 / -1;
}

.pip-studio-select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  padding-right: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(14, 16, 26, 0.98), rgba(8, 10, 18, 0.95)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f9a8d4' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
      no-repeat right 10px center;
  color: #f8fafc;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.pip-studio-select:focus {
  outline: none;
  border-color: rgba(236, 72, 153, 0.55);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

@media (max-width: 420px) {
  .pip-style-popup.pip-style-popup--studio {
    width: calc(100vw - 16px);
  }

  .pip-sel-style--studio {
    grid-template-columns: 1fr;
  }
}

.pip-layer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(42vh, 420px);
  overflow-y: auto;
}

.pip-layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  cursor: grab;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}

.pip-layer-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.pip-layer-item.pip-layer-sel {
  border-color: rgba(236, 72, 153, 0.45);
  background: rgba(236, 72, 153, 0.1);
  box-shadow: none;
}

.pip-layer-item.pip-layer-item--hidden {
  opacity: 0.55;
}

.pip-layer-item.pip-layer-item--hidden .pip-layer-name {
  text-decoration: line-through;
}

.pip-layer-item.pip-layer-item--dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.pip-layer-item.pip-layer-item--drop-target {
  border-color: rgba(236, 72, 153, 0.72);
  box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.3);
}

/* Visibilité carte : un œil par objet (liste calques) */
.pip-layer-vis {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 14, 22, 0.85);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pip-layer-vis:hover {
  color: #f9a8d4;
  border-color: rgba(236, 72, 153, 0.45);
  background: rgba(236, 72, 153, 0.12);
}

.pip-layer-vis:focus-visible {
  outline: 2px solid rgba(236, 72, 153, 0.55);
  outline-offset: 2px;
}

.pip-layer-vis .pip-ico-eye-off {
  display: none;
}

.pip-layer-vis.pip-layer-vis--off .pip-ico-eye {
  display: none;
}

.pip-layer-vis.pip-layer-vis--off .pip-ico-eye-off {
  display: block;
}

/* Style du tracé (liste calques) — entre œil et suppression */
.pip-layer-style {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 14, 22, 0.85);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pip-layer-style:hover {
  color: #f9a8d4;
  border-color: rgba(236, 72, 153, 0.45);
  background: rgba(236, 72, 153, 0.12);
}

.pip-layer-style:focus-visible {
  outline: 2px solid rgba(236, 72, 153, 0.55);
  outline-offset: 2px;
}

/* Suppression rapide : croix par ligne */
.pip-layer-del {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pip-layer-del:hover {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(220, 38, 38, 0.18);
}

.pip-layer-del:focus-visible {
  outline: 2px solid rgba(248, 113, 113, 0.65);
  outline-offset: 2px;
}

.pip-layer-ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.pip-layer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 4px;
  outline: none;
}

.pip-layer-name:hover {
  color: rgba(255, 255, 255, 0.98);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pip-layer-name:focus-visible {
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.55);
}

.pip-layer-item input.pip-layer-name-input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(236, 72, 153, 0.5);
  border-radius: 6px;
  color: #fff;
  padding: 4px 8px;
  font-size: 13px;
}

.pip-layer-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.pip-layer-poste-check {
  width: 16px;
  height: 16px;
  accent-color: #ec4899;
  cursor: pointer;
  flex-shrink: 0;
}

.pip-poste-group-popup__panel {
  width: min(520px, calc(100vw - 24px));
}

.pip-poste-group-popup__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pip-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pip-meta-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.pip-meta-grid input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff;
  font-size: 13px;
}

.pip-views-folder {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(147, 197, 253, 0.24);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.62), rgba(15, 23, 42, 0.36));
}

.pip-views-folder__head {
  margin-bottom: 8px;
}

.pip-views-folder__hint {
  margin: 4px 0 0 !important;
}

.pip-views-folder__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}

.pip-views-folder__steps {
  margin: 6px 0 10px;
  padding-left: 18px;
  color: rgba(241, 245, 249, 0.86);
  font-size: 12px;
  line-height: 1.45;
}

.pip-views-folder__steps li {
  margin: 3px 0;
}

.pip-views-folder__name {
  min-width: 0;
}

.pip-views-folder__list {
  width: 100%;
  min-height: 156px;
  background: rgba(3, 7, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 12px;
  padding: 6px;
  box-sizing: border-box;
}

.pip-views-folder__list--cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(280px, 42vh);
  overflow-y: auto;
  padding: 8px;
  scrollbar-color: rgba(236, 72, 153, 0.45) rgba(15, 23, 42, 0.5);
}

.pip-views-folder__list--cards:focus {
  outline: none;
}

.pip-views-folder__list--cards:focus-visible {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
  border-radius: 10px;
}

.pip-views-folder__empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(148, 163, 184, 0.95);
}

.pip-views-folder__item {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.55);
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.pip-views-folder__item[draggable="true"] {
  cursor: grab;
}

.pip-views-folder__item--dragging {
  opacity: 0.62;
  cursor: grabbing;
}

.pip-views-folder__item--drop-before {
  box-shadow: inset 0 3px 0 rgba(56, 189, 248, 0.9);
}

.pip-views-folder__item--drop-after {
  box-shadow: inset 0 -3px 0 rgba(56, 189, 248, 0.9);
}

.pip-views-folder__item:hover {
  border-color: rgba(244, 114, 182, 0.42);
  background: rgba(30, 41, 59, 0.72);
}

.pip-views-folder__item--selected {
  border-color: rgba(236, 72, 153, 0.78);
  background: linear-gradient(145deg, rgba(131, 24, 67, 0.42), rgba(15, 23, 42, 0.72));
  box-shadow:
    0 0 0 1px rgba(236, 72, 153, 0.22),
    0 8px 22px rgba(0, 0, 0, 0.38);
}

.pip-views-folder__item:focus {
  outline: none;
}

.pip-views-folder__item:focus-visible {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.55);
}

.pip-views-folder__item-title {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: rgba(248, 250, 252, 0.98);
  letter-spacing: 0.01em;
}

.pip-views-folder__item-meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(203, 213, 225, 0.88);
  font-variant-numeric: tabular-nums;
}

.pip-views-folder__actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pip-views-folder__actions--export {
  margin-top: 6px;
  justify-content: flex-end;
  align-items: center;
}

.pip-btn-views-export-one {
  border: 1px solid rgba(192, 132, 252, 0.55);
  background: rgba(88, 28, 135, 0.32);
  color: #f5f3ff;
}

.pip-btn-views-export-one:hover {
  background: rgba(109, 40, 163, 0.48);
  border-color: rgba(216, 180, 254, 0.72);
}

.pip-views-folder-quick {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(147, 197, 253, 0.24);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.62), rgba(15, 23, 42, 0.36));
}

.pip-views-popup__panel {
  max-width: 560px;
}

.pip-style-popup .pip-style-popup__body.pip-views-popup__body {
  max-height: min(58vh, 560px);
}

.pip-export-zone-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.pip-export-zone-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(241, 245, 249, 0.9);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
}

.pip-export-zone-option input {
  accent-color: #ec4899;
}

/* Prévisualisation export : cadre 1240×875 (rapport fixe), ancré sur #pipMap (même repère que la capture html2canvas) */
.pip-export-frame-overlay {
  position: absolute;
  inset: 0;
  z-index: 10060;
  pointer-events: none;
}

.pip-export-frame-overlay.pip-hidden {
  display: none;
}

.pip-export-frame-fit {
  position: absolute;
  inset: 12px;
  bottom: 84px;
  box-sizing: border-box;
  pointer-events: none;
  /* Container pour dimensionner le cadre (flex + auto sans contenu = 0×0 dans certains moteurs) */
  container-type: size;
  container-name: pip-export-fit;
}

.pip-export-frame-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  /* Plus grand rectangle 1240:875 dans la zone (min largeur, min hauteur du parent) */
  width: min(100cqw, calc(100cqh * 1240 / 875));
  aspect-ratio: 1240 / 875;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border: 2px dashed rgba(236, 72, 153, 0.95);
  border-radius: 3px;
  box-shadow: 0 0 0 9999px rgba(2, 6, 18, 0.42);
  pointer-events: none;
}

/* Sans requêtes de conteneur : éviter 0×0 (flex + auto + aspect-ratio seuls) */
@supports not (container-type: size) {
  .pip-export-frame-fit {
    container-type: normal;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pip-export-frame-box {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 96%;
    max-width: 96%;
    max-height: 96%;
    aspect-ratio: 1240 / 875;
    height: auto;
  }
}

.pip-export-frame-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  z-index: 25;
  pointer-events: auto;
  max-width: calc(100% - 24px);
}

.pip-export-frame-overlay--dossier .pip-export-frame-bar {
  display: none;
}

body.pip-export-loading-open #pipMap {
  filter: blur(2.2px) saturate(0.95);
  transition: filter 180ms ease;
}

.pip-export-loading {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 20, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.pip-export-loading__card {
  min-width: 320px;
  max-width: min(92vw, 520px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 12, 26, 0.92);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.pip-export-loading__spinner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2.5px solid rgba(255, 255, 255, 0.22);
  border-top-color: #f472b6;
  animation: pipExportSpin 0.9s linear infinite;
}

.pip-export-loading__texts strong {
  display: block;
  font-size: 14px;
  color: #f8fafc;
  letter-spacing: 0.01em;
}

.pip-export-loading__texts p {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.9);
}

@keyframes pipExportSpin {
  to {
    transform: rotate(360deg);
  }
}

.pip-export-frame-hint {
  font-size: 13px;
  color: rgba(248, 250, 252, 0.95);
  line-height: 1.35;
}

.pip-export-frame-hint strong {
  color: #fda4af;
  font-weight: 600;
}

.pip-export-copyright {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 550;
  display: none;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 12, 24, 0.78);
  color: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

/* Capture export PDF: on masque uniquement l'UI, jamais les tracés. */
body.pip-export-capture .pip-map-hud,
body.pip-export-capture .top-pyromap-brand,
body.pip-export-capture .pip-north,
body.pip-export-capture .pip-scribble-dock,
body.pip-export-capture .pip-toolbar-fallback,
body.pip-export-capture .pip-map-edge-tools {
  display: none !important;
}

body.pip-export-capture .pip-export-copyright {
  display: block !important;
}

/* En export, on garde uniquement l'échelle Leaflet, lisible en bas-gauche. */
body.pip-export-capture .leaflet-control-container .leaflet-control {
  display: none !important;
}

body.pip-export-capture .leaflet-control-container .leaflet-control-scale {
  display: block !important;
  margin: 0 0 16px 16px !important;
}

body.pip-export-capture .leaflet-control-scale-line {
  min-width: 150px;
  font-size: 18px !important;
  line-height: 1.2;
  padding: 5px 10px 4px !important;
  border-width: 2px !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  background: rgba(11, 16, 30, 0.86) !important;
  border-radius: 8px;
}

.pip-tech-symbols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.pip-tech-popup__panel {
  width: min(460px, calc(100vw - 28px));
}

.pip-tech-popup__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pip-meta-popup__panel {
  width: min(940px, calc(100vw - 28px));
  max-height: none;
}

.pip-meta-popup__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: none !important;
  overflow: visible !important;
}

.pip-meta-popup__panel .pip-style-popup__close {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.pip-tech-sym {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--pip-tx);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.pip-tech-sym:hover {
  background: rgba(236, 72, 153, 0.12);
  border-color: rgba(236, 72, 153, 0.35);
}

.pip-tech-sym:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(10, 12, 20, 0.95), 0 0 0 4px rgba(236, 72, 153, 0.45);
}

.pip-tech-sym.pip-sym-tool-active {
  border-color: rgba(244, 114, 182, 0.75);
  background: rgba(236, 72, 153, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 18px rgba(236, 72, 153, 0.15);
}

/* Pied d’onglet Éléments techniques — même langage que les actions des popups (Fond / Style) */
.pip-tech-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: stretch;
}

.pip-tech-actions .pip-tech-stop-btn {
  flex: 1 1 auto;
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, rgba(22, 24, 38, 0.98) 0%, rgba(10, 12, 22, 0.96) 100%);
  color: rgba(241, 245, 249, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 22px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(236, 72, 153, 0.1);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.pip-tech-actions .pip-tech-stop-btn:hover {
  border-color: rgba(236, 72, 153, 0.42);
  background: linear-gradient(165deg, rgba(236, 72, 153, 0.16) 0%, rgba(10, 12, 22, 0.94) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 28px rgba(236, 72, 153, 0.12),
    0 0 0 1px rgba(236, 72, 153, 0.22);
}

.pip-tech-actions .pip-tech-stop-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(10, 12, 20, 0.95), 0 0 0 4px rgba(236, 72, 153, 0.45);
}

.pip-tech-actions .pip-tech-stop-btn:active {
  transform: scale(0.99);
}

.pip-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.45;
  margin: 16px 0 0;
}

.pip-hidden {
  display: none !important;
}

/* Leaflet — tracé plus lisible & fluide */
.leaflet-container {
  font-family: "Inter", system-ui, sans-serif;
}

/* Crédits fournisseurs de tuiles masqués (contrôle désactivé dans plan-implantation.js) */
#pipMap .leaflet-control-attribution {
  display: none !important;
}

#pipMap.leaflet-container.pip-map--drawing,
#pipMap.leaflet-container.pip-map--drawing .leaflet-grab {
  cursor: crosshair !important;
}

#pipMap.leaflet-container.pip-map--symbol-place,
#pipMap.leaflet-container.pip-map--symbol-place .leaflet-grab {
  cursor: crosshair !important;
}

#pipMap.leaflet-container.pip-map--poste-place,
#pipMap.leaflet-container.pip-map--poste-place .leaflet-grab {
  cursor: crosshair !important;
}

#pipMap.leaflet-container.pip-map--safearrow,
#pipMap.leaflet-container.pip-map--safearrow .leaflet-grab {
  cursor: crosshair !important;
}

#pipMap.leaflet-container.pip-map--safearrow-tip-drag,
#pipMap.leaflet-container.pip-map--safearrow-tip-drag .leaflet-grab {
  cursor: grabbing !important;
}

.leaflet-interactive.pip-safearrow-arrow-polygon {
  cursor: grab;
}

.leaflet-interactive.pip-safearrow-tip-handle {
  cursor: grab;
}

.pip-safearrow-hud {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  font-family: "Inter", system-ui, sans-serif;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  pointer-events: none;
  text-align: center;
  line-height: 1.35;
}

.pip-safearrow-label-marker {
  background: transparent !important;
  border: none !important;
  pointer-events: none !important;
}

.pip-safearrow-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform-origin: center center;
}

.pip-safearrow-label__txt {
  white-space: nowrap;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  padding: 4px 12px;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 1px rgba(0, 0, 0, 0.85);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(2, 6, 23, 0.45) inset;
}

.pip-postes-popup__body {
  padding: 0 0 4px;
}

.pip-postes-popup__label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.85);
}

.pip-poste-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 14px;
  justify-items: center;
}

.pip-poste-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.95);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.pip-poste-swatch:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}

.pip-poste-swatch--active {
  outline: 2px solid rgba(56, 189, 248, 0.95);
  outline-offset: 3px;
}

/* Leaflet applique un fond blanc sur .leaflet-div-icon : on le retire pour voir le disque et le texte. */
#pipMap .pip-marker-poste.leaflet-div-icon {
  background: transparent !important;
  border: none !important;
  font-size: 16px;
}

.pip-marker-poste__disk {
  box-sizing: border-box;
}

.pip-marker-poste__txt {
  user-select: none;
  pointer-events: none;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
}

.pip-marker-poste__input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 22px;
  margin: 0;
  padding: 0 2px;
  border: none;
  background: transparent;
  text-align: center;
  font-weight: 700;
  line-height: 1.1;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  cursor: text;
}

.pip-marker-poste--editing .pip-marker-poste__disk {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 2px 10px rgba(0, 0, 0, 0.5);
}

#pipMap.leaflet-container .leaflet-interactive {
  transition: opacity 0.12s ease;
}

/* Sommets / poignées Geoman un peu plus grosses (saisie au doigt) */
#pipMap .leaflet-pm-icon,
#pipMap .leaflet-pm-draggable {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}

.leaflet-control-scale-line {
  border-color: rgba(236, 72, 153, 0.55) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  background: rgba(15, 18, 28, 0.8) !important;
}

.leaflet-pm-toolbar a {
  background: rgba(15, 18, 28, 0.94) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.leaflet-pm-toolbar a:hover {
  background: rgba(236, 72, 153, 0.28) !important;
}

/* Texte sur carte */
.pip-text-marker {
  background: transparent !important;
  border: none !important;
}

.pip-symbol-marker {
  background: transparent !important;
  border: none !important;
}

.pip-symbol-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
}

.pip-symbol-emoji {
  font-size: 44px;
  line-height: 1;
}

.pip-symbol-png {
  width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
}

/* L'asset rassemblement contient plus de marge interne : on compense pour matcher extincteur. */
.pip-symbol-inner--assembly .pip-symbol-png {
  transform: scale(1.3);
  transform-origin: center;
}

.pip-symbol-cap {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(12, 14, 22, 0.9);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pip-map-text {
  box-sizing: border-box;
  border-radius: 6px;
  white-space: nowrap;
  line-height: 1.25;
  max-width: min(480px, 92vw);
  overflow: hidden;
  text-overflow: ellipsis;
}

#pipMap .pip-text-marker.leaflet-div-icon {
  background: transparent !important;
  border: none !important;
}

.pip-text-marker-root {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  box-sizing: border-box;
}

.pip-text-marker-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transform-origin: center center;
}

.pip-text-rotate-handle {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.92);
  color: rgba(248, 250, 252, 0.95);
  font-size: 15px;
  line-height: 1;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.pip-text-rotate-handle:hover {
  background: rgba(236, 72, 153, 0.35);
  border-color: rgba(251, 113, 133, 0.65);
}

.pip-text-rotate-handle:active {
  cursor: grabbing;
}

.pip-text-style-popup__panel {
  max-width: 440px;
}

.pip-text-style-popup__body {
  padding-bottom: 8px;
  overflow-y: auto;
  max-height: min(58vh, 520px);
}

.pip-text-style-textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.35;
}

.pip-text-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-top: 12px;
}

@media (max-width: 520px) {
  .pip-text-style-grid {
    grid-template-columns: 1fr;
  }
}

.pip-text-style-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pip-text-style-field__lab {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(203, 213, 225, 0.92);
}

.pip-text-style-field--range .pip-text-style-field__lab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pip-text-style-val {
  font-variant-numeric: tabular-nums;
  color: rgba(251, 113, 133, 0.95);
}

.pip-text-style-field--color {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pip-text-style-field--color .pip-text-style-field__lab {
  flex: 1;
}

.pip-text-style-color {
  width: 44px;
  height: 32px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
}

.pip-text-style-check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.95);
  grid-column: 1 / -1;
}

.pip-text-style-check input {
  accent-color: #ec4899;
  width: 18px;
  height: 18px;
}

.pip-text-style-field--range {
  grid-column: 1 / -1;
}

.pip-text-style-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(148, 163, 184, 0.95);
}

/* Lien projet + modal choix */
.pip-h3-inline {
  margin: 0 0 6px;
}

.pip-projet-lien {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(236, 72, 153, 0.06);
  border: 1px solid rgba(236, 72, 153, 0.2);
  border-radius: 10px;
}

.pip-projet-lien-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pip-linked-summary {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
  margin: 0;
  max-width: 220px;
}

.pip-projet-lien-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pip-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.pip-projet-lien-hint {
  margin: 10px 0 0 !important;
}

.pip-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pip-modal.pip-hidden {
  display: none !important;
}

.pip-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.pip-modal-box {
  position: relative;
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  background: rgba(18, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.pip-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pip-modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.pip-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.pip-modal-close:hover {
  background: rgba(236, 72, 153, 0.2);
}

.pip-modal-lead {
  margin: 0;
  padding: 12px 18px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.45;
}

.pip-modal-search {
  margin: 12px 18px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 14px;
  width: calc(100% - 36px);
}

.pip-project-list {
  flex: 1;
  min-height: 120px;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px 12px 16px;
}

.pip-project-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pip-project-item:hover {
  background: rgba(236, 72, 153, 0.12);
  border-color: rgba(236, 72, 153, 0.35);
}

.pip-project-item.pip-project-item--free {
  border-style: dashed;
  color: rgba(255, 255, 255, 0.75);
}

.pip-project-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.pip-project-item small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.pip-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
}

.pip-modal--export-meta .pip-modal-box {
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
}

.pip-modal--export-meta .pip-modal-lead {
  padding-bottom: 8px;
}

.pip-modal--export-meta .pip-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 8px;
  overflow-y: auto;
}

.pip-modal--export-meta .pip-meta-grid label {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.pip-modal--export-meta .pip-meta-grid input {
  margin: 0;
  width: 100%;
}

/* Bloc feuille A3 (écran : seule la carte est visible ; légende + pied masqués) */
.pip-print-a3 {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  width: 100%;
}

.pip-print-top {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pip-print-only {
  display: none !important;
}

/* Impression — A3 paysage, trame type plan officiel */
@page {
  size: A3 landscape;
  margin: 10mm;
}

@media print {
  html,
  body {
    background: #fff !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sidebar,
  .top-user-actions,
  .pyromap-topbar,
  .pip-search-float,
  .pip-scribble-dock,
  .pip-circle-hud,
  .pip-calques-open-btn,
  .pip-map-edge-tools,
  .pip-style-popup,
  .pip-style-studio-backdrop,
  .pip-modal,
  .pip-map-tools,
  .pip-map-hud,
  .pip-globe-fireworks,
  .leaflet-control-zoom,
  .leaflet-control-attribution,
  .leaflet-pm-toolbar {
    display: none !important;
  }

  .leaflet-control-container {
    display: block !important;
  }

  .leaflet-bottom.leaflet-left {
    bottom: 4px !important;
    left: 4px !important;
  }

  .pip-studio {
    grid-template-columns: 1fr !important;
    display: block !important;
    background: #fff !important;
  }

  .pip-print-a3 {
    display: flex !important;
    flex-direction: column !important;
    gap: 0;
    min-height: 0;
  }

  .pip-print-top {
    display: grid !important;
    grid-template-columns: 1.62fr 0.52fr !important;
    gap: 10px !important;
    align-items: stretch !important;
    page-break-inside: avoid;
  }

  .pip-print-only {
    display: block !important;
  }

  aside.pip-print-legend {
    display: flex !important;
    flex-direction: column !important;
    border: 1.5pt solid #000 !important;
    padding: 10px 12px !important;
    background: #fff !important;
    font-size: 9.5pt !important;
    line-height: 1.35 !important;
    min-height: 0;
  }

  .pip-print-legend__title {
    margin: 0 0 10px !important;
    font-size: 11pt !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-align: center !important;
    border-bottom: 0.75pt solid #000 !important;
    padding-bottom: 6px !important;
  }

  .pip-print-legend__list {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .pip-print-legend__item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
  }

  .pip-print-legend__sw {
    flex-shrink: 0;
  }

  .pip-print-legend__sw--green-dash {
    width: 28px;
    height: 16px;
    border: 1.5pt dashed #16a34a;
    background: rgba(34, 197, 94, 0.2);
  }

  .pip-print-legend__sw--red-solid {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #dc2626;
    border: 1pt solid #991b1b;
  }

  .pip-print-legend__sw--letter {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5pt solid #b91c1c;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10pt !important;
    font-weight: 700 !important;
    background: #fff !important;
  }

  .pip-map-stage {
    position: relative !important;
    min-height: 148mm !important;
    height: 148mm !important;
    border: 1.5pt solid #000 !important;
    overflow: hidden !important;
    page-break-inside: avoid;
  }

  #pipMap {
    min-height: 148mm !important;
    height: 148mm !important;
    width: 100% !important;
    page-break-inside: avoid;
  }

  .pip-north {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2px !important;
    position: absolute !important;
    right: 8px !important;
    bottom: 36px !important;
    top: auto !important;
    left: auto !important;
    color: #000 !important;
    z-index: 400 !important;
  }

  .pip-north__n {
    display: block !important;
    font-size: 9pt !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }

  .pip-north svg {
    fill: #000 !important;
    width: 28px !important;
    height: 28px !important;
  }

  .pip-print-map-note {
    display: block !important;
    position: absolute !important;
    right: 8px !important;
    bottom: 8px !important;
    max-width: 52% !important;
    margin: 0 !important;
    font-size: 7.5pt !important;
    line-height: 1.25 !important;
    color: #111 !important;
    text-align: right !important;
    z-index: 400 !important;
  }

  .pip-print-footer {
    display: block !important;
    margin-top: 10px !important;
    page-break-inside: avoid;
    font-size: 9pt !important;
    line-height: 1.35 !important;
  }

  .pip-print-sheet-title {
    margin: 0 0 8px !important;
    text-align: center !important;
    font-size: 16pt !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
  }

  .pip-print-footer__grid {
    display: grid !important;
    grid-template-columns: 1.15fr 1fr 0.85fr !important;
    gap: 10px 14px !important;
    border: 1.5pt solid #000 !important;
    padding: 10px 12px !important;
    align-items: start !important;
  }

  .pip-print-footer__col {
    border-right: 0.75pt solid #ccc !important;
    padding-right: 10px !important;
  }

  .pip-print-footer__col:last-child {
    border-right: none !important;
    padding-right: 0 !important;
  }

  .pip-print-footer__col--brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    text-align: right !important;
  }

  .pip-print-line {
    margin-bottom: 6px !important;
  }

  .pip-print-line--2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .pip-print-k {
    font-weight: 700 !important;
  }

  .pip-print-v {
    font-weight: 400 !important;
  }

  .pip-print-sign-area {
    width: 100%;
    min-height: 22mm;
    border: 0.75pt dashed #999;
    margin: 6px 0 10px;
  }

  .pip-print-logo-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 4px !important;
  }

  .pip-print-logo {
    max-width: 42mm !important;
    height: auto !important;
  }

  .pip-print-logo-txt {
    font-size: 8pt !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
  }

  .pip-print-legal {
    margin: 10px 0 0 !important;
    font-size: 7.5pt !important;
    text-align: center !important;
    font-style: italic !important;
  }

  .pip-main {
    max-width: none !important;
  }
}

/* Bandeau outils : sur mobile/tablette pleine largeur ; sur HD le bloc est limité et centré (voir media ≥1181px) */
.pip-toolbar-fallback {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  justify-content: flex-start;
  overflow: visible !important;
  white-space: normal;
}

.pip-toolbar-fallback .pip-toolbar-band-actions,
.pip-toolbar-fallback .pip-toolbar-band-tools {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.pip-toolbar-fallback .pip-toolbar-band-actions {
  display: none !important;
}

.pip-toolbar-fallback .pip-toolbar-band-actions > .pip-header-actions {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--pip-edge);
  border-radius: 12px;
  background: var(--pip-surface);
  box-shadow: var(--pip-inner), 0 4px 22px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(236, 72, 153, 0.16);
}

/* Ne pas étirer ce bloc : sinon une « trou » entre recherche/couleurs et la 2e rangée sur grand écran */
.pip-header-actions--dock {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  margin-left: 0 !important;
}

.pip-toolbar-fallback .pip-toolbar-band-tools > .pip-scribble-dock {
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0;
  position: static !important;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: wrap !important;
  gap: 6px;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: visible !important;
}

.pip-toolbar-fallback .pip-toolbar-band-tools,
.pip-toolbar-fallback .pip-toolbar-panel-body > .pip-scribble-row,
.pip-toolbar-fallback .pip-scribble-row--style,
.pip-toolbar-fallback .pip-scribble-row--style .pip-search-float:not(.pip-search-float--toolbar) {
  overflow: visible !important;
}

.pip-toolbar-fallback .pip-search-results {
  z-index: 10050 !important;
}

.pip-toolbar-fallback .pip-toolbar-panel-body > .pip-scribble-row:not(.pip-scribble-row--tools-only) {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.pip-toolbar-fallback .pip-toolbar-panel-body > .pip-scribble-row--tools-only {
  width: auto !important;
  max-width: 100% !important;
  flex: 0 1 auto !important;
}

/* ===== Responsive lock (final) ===== */
@media (max-width: 1400px) {
  .pip-toolbar-fallback:not(.pip-toolbar-fallback--placed) {
    left: 50% !important;
    right: auto !important;
    top: 10px !important;
    transform: translateX(-50%) !important;
    justify-content: center !important;
    overflow: visible !important;
  }

  .pip-header-actions--dock {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
}

@media (max-width: 767px) {
  .pip-main .pip-studio {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(420px, 58vh) !important;
  }
}

@media (max-width: 1180px) {
  .pip-toolbar-fallback:not(.pip-toolbar-fallback--placed) {
    position: absolute !important;
    top: 8px !important;
    left: 6px !important;
    right: 6px !important;
    transform: none !important;
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  .pip-toolbar-fallback .pip-toolbar-band-tools > .pip-scribble-dock {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }

  .pip-toolbar-fallback .pip-toolbar-panel-body > .pip-scribble-row:not(.pip-scribble-row--tools-only) {
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  .pip-toolbar-fallback .pip-toolbar-panel-body > .pip-scribble-row--tools-only {
    width: auto !important;
    flex: 0 1 auto !important;
    flex-wrap: wrap !important;
  }

  .pip-toolbar-fallback .pip-header-actions--dock {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 6px 8px !important;
  }
}

/* Search suggestions must never be clipped by toolbar wrappers */
.pip-toolbar-fallback .pip-search-float,
.pip-toolbar-fallback .pip-search-inner,
.pip-toolbar-fallback .pip-search-status {
  overflow: visible !important;
}

.pip-toolbar-fallback .pip-search-results {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: rgba(18, 20, 30, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5) !important;
}

@media (max-width: 760px) {
  .pip-toolbar-fallback .pip-header-actions--dock .pip-btn {
    font-size: 11px !important;
    padding: 6px 8px !important;
  }

  .pip-toolbar-fallback .pip-scribble-row {
    padding: 6px 7px !important;
    gap: 6px !important;
  }

  .pip-toolbar-fallback .pip-scribble-row--style .pip-search-float {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }
}

/* HD / large : bloc d’outils centré, largeur max modérée (pas bord à bord carte) */
@media (min-width: 1181px) {
  .pip-toolbar-fallback .pip-toolbar-band-actions,
  .pip-toolbar-fallback .pip-toolbar-band-tools {
    width: auto;
    max-width: min(520px, 100%);
    flex: 0 1 auto;
  }

  .pip-toolbar-fallback:not(.pip-toolbar-fallback--placed) {
    left: 50% !important;
    right: auto !important;
    top: 12px !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    max-width: none !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .pip-toolbar-fallback.pip-toolbar-fallback--placed {
    align-items: center !important;
  }

  .pip-toolbar-fallback .pip-toolbar-band-tools {
    display: flex !important;
    justify-content: center !important;
    width: auto !important;
    max-width: min(520px, 100%) !important;
  }

  .pip-toolbar-fallback .pip-toolbar-band-tools > .pip-scribble-dock {
    width: auto !important;
    max-width: min(520px, 100%) !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .pip-toolbar-fallback .pip-toolbar-panel-body > .pip-scribble-row:not(.pip-scribble-row--tools-only) {
    width: auto !important;
    max-width: 100% !important;
    flex: 0 1 auto !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  .pip-toolbar-fallback .pip-toolbar-panel-body > .pip-scribble-row--tools-only {
    justify-content: flex-start !important;
  }

  /* La recherche ne s’étire plus sur toute la ligne (hors champ compact barre) */
  .pip-toolbar-fallback .pip-scribble-row--style .pip-search-float:not(.pip-search-float--toolbar) {
    flex: 0 1 min(380px, 52vw) !important;
    max-width: min(380px, 52vw) !important;
  }
}
