:root {
  --bg: #0b0c0f;
  --card: #101217;
  --muted: #8a8f98;
  --text: #e8eaed;
  --line: #1d222b;
  --brand: #ff9900;
  --brand-600: #ff9900;
  --brand-700: #e58900;
  --ok: #1db954;
  --error: #e5484d;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --radius: 16px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --card: #fff;
    --muted: #667085;
    --text: #0b0c0f;
    --line: #e7e9ee;
    --shadow: 0 8px 20px rgba(27, 31, 35, 0.08);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, "Helvetica Neue", Arial;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== App Shell ===== */
.container {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
  width: 100%;
}

header.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
}

.appbar__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
}

.brand span {
  font-size: 18px;
}

.app-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  background: var(--brand);
  color: #101217;
  box-shadow: var(--shadow);
  transition: transform 0.05s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:hover {
  filter: brightness(1.03);
}

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  box-shadow: none;
  padding: 8px 10px;
}

.btn.full {
  width: 100%;
}

.btn.small {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 10px;
}

input[type="text"],
input[type="number"],
input[type="search"],
input[type="range"] {
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

input[type="range"] {
  padding: 0;
  height: 34px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 6px;
}

.muted {
  color: var(--muted);
}

.ok {
  color: var(--ok);
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--brand) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--brand) 35%, var(--line));
  color: var(--text);
}

/* ===== Desktop Layout ===== */
.page {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  padding: 16px;
}

@media (max-width: 1100px) {
  .page {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 920px) {
  .page {
    grid-template-columns: 1fr;
    padding: 12px;
  }
}

aside.panel {
  position: relative;
  height: calc(100dvh - 84px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}

aside.panel h1 {
  margin: 2px 0 6px;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.panel .sub {
  font-size: 13px;
  color: var(--muted);
}

.panel .box {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--card) 96%, transparent) 0%,
    color-mix(in oklab, var(--card) 92%, transparent) 100%
  );
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row.wrap {
  flex-wrap: wrap;
}

main#map {
  height: calc(100dvh - 84px);
  background: #0f1115;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.leaflet-container {
  background: #0f1115;
}

.leaflet-bar a {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}

:root {
  --peek-h: 28svh;
} /* hauteur visible en "peek" (native small viewport units) */

@media (max-width: 920px) {
  aside.panel {
    position: fixed !important;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    border-radius: 20px;
    will-change: transform;
    transform: translateY(100%); /* état base */
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
    padding-bottom: max(
      14px,
      env(safe-area-inset-bottom)
    ); /* respire au-dessus du bord */
    max-height: min(86svh, 640px); /* limite raisonnable quand "open" */
    overflow: auto;
  }
  aside.panel.open {
    transform: translateY(0) !important;
  }
  aside.panel.peek {
    transform: translateY(calc(100% - var(--peek-h))) !important;
  }
  aside.panel.closed {
    transform: translateY(100%) !important;
  }

  .grabber {
    touch-action: none;
    cursor: grab;
  }
}

/* réduit les anims si demandé */
@media (prefers-reduced-motion: reduce) {
  aside.panel {
    transition: none !important;
  }
}

/* ===== Bottom Tab Bar (mobile) ===== */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--card);
  border-top: 1px solid var(--line);
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  -webkit-tap-highlight-color: transparent;
}

.tabbar a.active {
  color: var(--text);
  background: color-mix(in oklab, var(--brand) 12%, transparent);
}

.tabbar .icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* ===== Story Strip (mobile) ===== */
.story-strip {
  display: none;
  gap: 10px;
  overflow: auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  scroll-snap-type: x mandatory;
}

.story {
  flex: 0 0 auto;
  width: 68px;
  scroll-snap-align: start;
  text-align: center;
}

.story .thumb {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 2px solid var(--brand);
  overflow: hidden;
  display: block;
  margin: 0 auto 6px;
  background: var(--line);
}

.story span {
  font-size: 11px;
  color: var(--muted);
}

/* ===== Feed Grid (mobile) ===== */
.grid-tiles {
  display: none;
  padding: 8px 8px 90px;
  gap: 2px;
}

.grid-tiles.three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.tile {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--card);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile .badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}

/* ===== Layout Desktop ===== */
.page {
  display: grid;
  grid-template-columns: 380px 1fr;
  /* Panneau + Carte */
  gap: 16px;
  padding: 16px;
}

@media (max-width: 1100px) {
  .page {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 920px) {
  .page {
    grid-template-columns: 1fr;
    padding: 0;
  }
}

/* ===== Panneau (Desktop) ===== */
aside.panel {
  position: relative;
  height: calc(100dvh - 84px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}

/* ===== Panneau (Mobile en bottom sheet) ===== */
@media (max-width: 920px) {
  aside.panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    max-height: 70dvh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--line);
    transform: translateY(calc(100% - 58px));
    /* Fermé par défaut */
    transition: transform 0.25s ease;
  }

  aside.panel.open {
    transform: translateY(0);
    /* Quand ouvert */
  }

  /* Grabber */
  .grabber {
    width: 44px;
    height: 5px;
    background: #ccc;
    border-radius: 999px;
    margin: 6px auto 12px;
  }

  /* Map prend tout l’écran derrière */
  main#map {
    height: calc(100dvh - 56px);
    /* sous la barre du haut */
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* Boutons larges */
  .btn.full,
  .btn {
    width: 100%;
    min-height: 44px;
    font-size: 15px;
  }

  /* Appbar plus compacte */
  .appbar__inner {
    padding: 10px 12px;
  }
}

/* === MOBILE: carte 100% + panel flottant en bas (style Airbnb) === */
@media (max-width: 920px) {
  :root {
    /* ajuste si besoin */
    --appbar-h: 56px;
    /* hauteur de ta barre du haut */
    --sheet-h: 42vh;
    /* hauteur ouverte de la sheet */
    --sheet-collapsed: 64px;
    /* hauteur fermée (juste l'entête) */
  }

  /* La page devient une zone plein-écran sous l'appbar, sans padding */
  .page {
    position: relative;
    height: calc(100dvh - var(--appbar-h));
    min-height: calc(100dvh - var(--appbar-h));
    padding: 0;
    overflow: hidden;
    /* évite le scroll de la page, on scrolle la sheet */
  }

  /* Carte plein écran derrière */
  main#map {
    position: absolute;
    inset: 0;
    border: none;
    border-radius: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    z-index: 1;
    /* sous la sheet */
  }

  /* Sheet flottante par-dessus la carte */
  aside.panel {
    position: fixed !important;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 5;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    transform: translateZ(0);
    /* lissage GPU */
    /* état "ouvert" par défaut */
    max-height: var(--sheet-h);
    min-height: 220px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
  }

  /* Grabber visible en mode mobile flottant */
  .grabber {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: #e5e7eb;
    margin: 6px auto 10px;
  }

  /* État "fermé" optionnel via la classe .closed (sans JS obligatoire) */
  aside.panel.closed {
    max-height: var(--sheet-collapsed) !important;
    overflow: hidden !important;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* Petites touches mobiles */
  .appbar__inner {
    padding: 10px 12px;
  }

  .btn {
    min-height: 44px;
  }
}

.btn.full,
.btn {
  text-align: center !important;
}

/* ---- SimpleBar sur aside.panel ---- */
aside.panel[data-simplebar] {
  /* garantis le scroll interne : déjà true chez toi, mais on confirme */
  overflow: auto;
}

/* Largeur de la barre (verticale) */
aside.panel .simplebar-scrollbar::before {
  /* épaisseur du thumb */
  width: 6px;
  /* couleur du thumb */
  background: var(--brand) !important;
  /* arrondi */
  border-radius: 999px;
  /* opacité par défaut */
  opacity: 0.7;
}

/* au survol : plus visible */
aside.panel .simplebar-scrollbar.simplebar-visible::before,
aside.panel:hover .simplebar-scrollbar::before {
  opacity: 1;
}

/* Couleur/espacement de la “piste” (track) */
aside.panel .simplebar-track.simplebar-vertical {
  width: 10px;
  /* largeur totale (track + thumb) */
  background: transparent;
  /* ou var(--bg) si tu veux une piste visible */
  margin: 4px 0;
  /* marges haut/bas pour “raccourcir” visuellement */
}

/* Optionnel: rendre la piste subtilement visible */
aside.panel .simplebar-track.simplebar-vertical::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: 2px;
  left: 2px;
  background: color-mix(in oklab, var(--line) 60%, transparent);
  border-radius: 999px;
}

/* Mobile: barre encore plus fine */
@media (max-width: 920px) {
  aside.panel .simplebar-scrollbar::before {
    width: 4px;
  }

  aside.panel .simplebar-track.simplebar-vertical {
    width: 8px;
  }
}

/* Réduit la zone utile → le thumb paraît plus court */
aside.panel .simplebar-track.simplebar-vertical {
  padding-top: 12px;
  padding-bottom: 12px;
}

#toast {
  display: none !important;
}
/* ===== Splash ===== */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--bg, #000);
  color: #fff;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#splash.hide {
  opacity: 0;
  visibility: hidden;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
  height: 100%;
}

/* Logo animé type "pulse" */
.splash-logo svg {
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.3));
  animation: splashPulse 2s ease-in-out infinite;
}

@keyframes splashPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

/* Texte animé façon Netflix */
.splash-footer {
  position: absolute;
  bottom: 40px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.splash-text {
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--brand) 0%,
    #fff 50%,
    var(--brand) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 2s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

/* Mode clair */
@media (prefers-color-scheme: light) {
  #splash {
    background: #fff;
    color: #000;
  }
}
.seller-card {
  display: flex;
  gap: 12px;
  min-width: 240px;
  align-items: flex-start;
}

.seller-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 56px;
  background: var(--line);
}

.seller-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.seller-card__avatar.is-skeleton {
  background: linear-gradient(90deg, #e9ecef, #f3f4f6, #e9ecef);
  animation: skel 1.2s infinite;
  border-radius: 50%;
}

@keyframes skel {
  0% {
    background-position: -120px 0;
  }

  100% {
    background-position: 120px 0;
  }
}

.seller-card__info {
  flex: 1;
}

.seller-card__name {
  font-weight: 800;
  font-size: 14px;
}

.seller-card__username {
  font-size: 12px;
}

.seller-card__stats {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  margin: 6px 0;
}

.seller-card__meta {
  font-size: 12px;
  line-height: 1.4;
}

.seller-card__cta {
  margin-top: 10px;
}

/* ===== Badges custom ===== */
.badge-public {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(29, 185, 84, 0.15);
  /* vert clair */
  color: #1db954;
  /* vert Spotify */
  border: 1px solid rgba(29, 185, 84, 0.4);
}

.badge-private {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(229, 72, 77, 0.15);
  /* rouge clair */
  color: #e5484d;
  /* rouge */
  border: 1px solid rgba(229, 72, 77, 0.4);
}

/* Bottom sheet login */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: saturate(120%) blur(2px);
}

.sheet-backdrop.show {
  display: block;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: 640px;
  background: var(--card);
  color: var(--text);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--line);
  border-bottom: none;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.25);
  padding: 14px;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.sheet-backdrop.show .sheet {
  transform: translateY(0);
}

.sheet__grabber {
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  margin: 6px auto 10px;
}

/* desktop: centre le modal si tu veux, ou garde le sheet */
@media (min-width: 921px) {
  .sheet {
    bottom: auto;
    top: 50%;
    transform: translateY(100%);
    border-radius: 16px;
    border: 1px solid var(--line);
    width: 420px;
  }

  .sheet-backdrop.show .sheet {
    transform: translateY(-50%);
  }

  #loginSheetBtn {
    text-align: center;
  }

  #toast {
    display: none !important;
  }
}

.seller-marker {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--brand);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  background: #fff;
}

.seller-marker img {
  width: 100% !important;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Visibilité responsive */
.only-desktop {
  display: inline-flex !important;
}

.only-mobile {
  display: none !important;
}

@media (max-width: 920px) {
  .only-desktop {
    display: none !important;
  }

  .only-mobile {
    display: inline-flex !important;
  }
}

/* Style des liens desktop */
.app-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  color: var(--text) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s !important;
}

.app-link:hover {
  background: color-mix(in oklab, var(--brand) 12%, transparent) !important;
  color: var(--brand) !important;
}

.app-link svg {
  flex-shrink: 0 !important;
  display: block !important;
}

/* Bouton mobile (optionnel) */
.btn.ghost svg {
  width: 22px !important;
  height: 22px !important;
}

.btn.ghost span {
  font-size: 14px !important;
  font-weight: 600 !important;
}

@media (max-width: 920px) {
  body .only-desktop {
    display: none !important;
  }

  body .only-mobile {
    display: inline-flex !important;
  }
}
/* ============ THEME TOKENS (optionnels) ============ */
/* Active le thème sombre en posant data-theme="dark" sur <html> ou <body> */
:root[data-theme="dark"] {
  --sa-panel: #111318; /* panneau principal */
  --sa-panel-2: #0d0f14; /* surfaces secondaires */
  --sa-ink: #e6e9ef; /* texte principal */
  --sa-muted: #9aa3b2; /* texte atténué */
  --sa-border: #1f242d; /* bordures */
  --sa-accent: #ff9900; /* Softadastra orange */
}
/* Fallback auto si tu utilises le thème système */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --sa-panel: #111318;
    --sa-panel-2: #0d0f14;
    --sa-ink: #e6e9ef;
    --sa-muted: #9aa3b2;
    --sa-border: #1f242d;
    --sa-accent: #ff9900;
  }
}

/* ============ MODAL / SHEET (DARK READY) ============ */
/* Backdrop : plus sombre + blur léger pour la carte */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  z-index: 9999999 !important;
  transition: opacity 0.2s ease;
}
.sheet-backdrop[aria-hidden="false"] {
  display: block;
}

/* Container */
.sheet {
  color: var(--sa-ink, #1f2937);
  background: var(--sa-panel, #fff);
  border: 1px solid var(--sa-border, #e5e7eb);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px;
  transform: translateY(100%);
  transition: transform 0.24s ease;
}
.sheet__grabber {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: var(--sa-border, #e5e7eb);
  margin: 6px auto 10px;
}
.sheet__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sheet__title {
  margin: 0;
  font-weight: 700;
}
.icon {
  flex-shrink: 0;
  color: var(--sa-accent, #ff9900);
}

/* Desktop: modal centré */
@media (min-width: 768px) {
  .sheet {
    border-radius: 16px;
    width: min(520px, 92vw);
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -40%) scale(0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  }
  .sheet__grabber {
    display: none;
  }
  .sheet-backdrop[aria-hidden="false"] .sheet {
    transform: translate(-50%, -50%) scale(1);
  }
}
/* Mobile open */
.sheet-backdrop[aria-hidden="false"] .sheet {
  transform: translateY(0);
}

/* Helpers */
.btn.full {
  width: 100%;
}
.muted {
  color: var(--sa-muted, #6b7280);
}

/* Accents & focus (meilleure accessibilité en sombre) */
.btn,
.btn.secondary,
.btn.ghost {
  color: var(--sa-ink, #e6e9ef);
  border-color: var(--sa-border, #1f242d);
}
.btn:focus-visible {
  outline: 2px solid var(--sa-accent, #ff9900);
  outline-offset: 2px;
  border-radius: 12px;
}

/* Optionnel : z-index au-dessus de Leaflet overlays si besoin */
.leaflet-container .sheet-backdrop {
  z-index: 120;
}
.box .row {
  margin-bottom: 10px;
}
#btnSaveMine .icon {
  color: black;
}
/* le grabber indique le geste */
.grabber {
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 2;
  background: transparent;
  touch-action: none; /* autorise le drag vertical */
  cursor: grab; /* desktop feedback */
}
.grabber::before {
  content: "";
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: var(--sa-border, #e5e7eb);
}
.grabber:active {
  cursor: grabbing;
}

/* petite anim de hint (rebond) au premier affichage) */
@keyframes panelHint {
  0% {
    transform: translateY(calc(100% - var(--peek-h)));
  }
  40% {
    transform: translateY(calc(100% - var(--peek-h) - 10px));
  }
  100% {
    transform: translateY(calc(100% - var(--peek-h)));
  }
}
.panel.hint {
  animation: panelHint 0.8s ease;
}
/* =========================
   Softadastra · Pro Marketplace Overrides
   (à coller tout en bas du CSS pour override)
   ========================= */

/* ---- Typographie & densité (inspiration Amazon) ---- */
:root {
  --font-sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, "Helvetica Neue", Arial;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-16: 16px;
  --lh-tight: 1.28;
  --lh-normal: 1.4;
}
body {
  font-family: var(--font-sans);
  letter-spacing: 0.1px;
}
h1,
h2,
h3,
.box-title {
  font-weight: 800;
  letter-spacing: 0.2px;
}
.panel h1 {
  font-size: 20px !important;
  margin: 0 0 6px !important;
}
.panel .sub {
  font-size: var(--fs-13) !important;
  line-height: var(--lh-normal);
}

/* ---- Boutons (états hover/active/focus pro) ---- */
.btn {
  border-radius: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  padding: 10px 14px !important;
  box-shadow: 0 2px 0 color-mix(in oklab, var(--brand) 45%, #000) !important;
  transform: translateZ(0);
}
.btn:hover {
  filter: brightness(1.03) saturate(1.02) !important;
}
.btn:active {
  transform: translateY(1px) !important;
  box-shadow: 0 1px 0 color-mix(in oklab, var(--brand) 45%, #000) !important;
}
.btn.secondary {
  border: 1px solid color-mix(in oklab, var(--line) 70%, transparent) !important;
  background: color-mix(in oklab, var(--card) 92%, transparent) !important;
}
.btn.ghost {
  padding: 8px 10px !important;
  opacity: 0.9;
}
.btn.full {
  width: 100%;
}
.btn.small {
  padding: 7px 10px !important;
  font-size: var(--fs-13) !important;
}

/* Spinner “loading” réutilisable */
.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}
.btn.loading::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: saSpin 700ms linear infinite;
}
@keyframes saSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Champs de saisie (focus/erreur/succès) ---- */
input[type="text"],
input[type="number"],
input[type="search"],
textarea {
  border: 1px solid var(--line) !important;
  background: color-mix(in oklab, var(--card) 95%, transparent) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--brand) 60%, var(--line)) !important;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 22%, transparent);
  background: color-mix(in oklab, var(--card) 98%, transparent) !important;
}
input:disabled {
  opacity: 0.6;
}

/* Range slider (track + thumb) */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 32px !important;
  background: transparent !important;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--line) 70%, transparent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid color-mix(in oklab, var(--brand) 40%, #000);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--line) 70%, transparent);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid color-mix(in oklab, var(--brand) 40%, #000);
}

/* Labels & microcopie */
label {
  font-size: var(--fs-12) !important;
  text-transform: none;
  letter-spacing: 0.15px;
}
.muted {
  font-size: var(--fs-13);
}

/* ---- Cartes/sections (box) ---- */
.panel .box {
  border-radius: 14px !important;
  border: 1px solid color-mix(in oklab, var(--line) 85%, transparent) !important;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--card) 98%, transparent) 0%,
    color-mix(in oklab, var(--card) 94%, transparent) 100%
  ) !important;
}
.box + .box {
  margin-top: 6px;
}
.box .row {
  margin-bottom: 8px !important;
}

/* Titre de section avec icône alignée */
.box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  margin: 0 0 6px;
}
.icon {
  flex-shrink: 0;
}

/* ---- Badges ---- */
.pill {
  font-weight: 700 !important;
}
.badge-public,
.badge-private {
  letter-spacing: 0.2px;
}

/* ---- Panel (bottom-sheet) états / transitions ---- */
:root {
  --peek-h: 28vh;
}
@media (max-width: 920px) {
  aside.panel {
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.3, 1) !important;
  }
  aside.panel.open {
    transform: translateY(0) !important;
  }
  aside.panel.peek {
    transform: translateY(calc(100% - var(--peek-h))) !important;
  }
  aside.panel.closed {
    transform: translateY(100%) !important;
  }
  .grabber {
    touch-action: none;
    cursor: grab;
  }
  .grabber::before {
    background: color-mix(in oklab, var(--line) 80%, transparent);
  }
  aside.panel:focus-within .grabber::before {
    background: var(--brand);
  }
}

/* ---- Backdrop & Sheets (success/login) harmonie visuelle ---- */
.sheet-backdrop {
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(4px) !important;
}
.sheet {
  border: 1px solid var(--line) !important;
  background: var(--card) !important;
  color: var(--text) !important;
}
.sheet__head .icon {
  color: var(--brand) !important;
}
@media (min-width: 768px) {
  .sheet {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35) !important;
  }
}

/* ---- Topbar / actions ---- */
header.appbar {
  border-bottom: 1px solid color-mix(in oklab, var(--line) 80%, transparent) !important;
}
.app-link:hover {
  color: var(--brand) !important;
}

/* ---- Leaflet (cohérence sombre) ---- */
.leaflet-bar a,
.leaflet-control-zoom a {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}
.leaflet-bar a:hover {
  filter: brightness(1.05);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}
.leaflet-popup-content {
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
}

/* ---- SimpleBar (scroll panel) raffiné ---- */
aside.panel .simplebar-scrollbar::before {
  background: var(--brand) !important;
  opacity: 0.75;
}
aside.panel:hover .simplebar-scrollbar::before {
  opacity: 1;
}
aside.panel .simplebar-track.simplebar-vertical {
  width: 10px;
}
@media (max-width: 920px) {
  aside.panel .simplebar-scrollbar::before {
    width: 4px;
  }
  aside.panel .simplebar-track.simplebar-vertical {
    width: 8px;
  }
}

/* ---- FAB (bouton flottant) optionnel pour mobile ---- */
@media (max-width: 920px) {
  .panel-fab {
    position: fixed;
    right: 12px;
    bottom: 86px;
    z-index: 115;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  }
}

/* ---- Accessibilité focus visible (AA+) ---- */
:where(a, button, .btn, input, textarea):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ---- Réduction animations si demandé ---- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ==== Petites finitions ==== */
#btnSaveMine .icon {
  color: #000 !important;
} /* ton icône Save en noir */
.highlight {
  color: var(--brand) !important;
  font-weight: 800 !important;
}
/* ===== Grabber brand visible (#ff9900) ===== */
:root {
  --grabber-bar: #ff9900; /* barre brand orange */
  --grabber-plate: rgba(20, 20, 20, 0.55); /* plaque sombre translucide */
  --grabber-ring: rgba(255, 255, 255, 0.12); /* liseré subtil */
  --grabber-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); /* ombre externe */
}

/* Zone du grabber */
.grabber {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 8px;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

/* États : drag, focus, hint */
.grabber:active {
  cursor: grabbing;
}
aside.panel:focus-within .grabber::before,
.grabber.is-dragging::before {
  background: #ff9900 !important; /* accent brand solide */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 0 3px rgba(255, 153, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Animation hint */
@keyframes grabberPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
.panel.hint .grabber::before {
  animation: grabberPulse 1s ease;
}
/* How much of the sheet remains visible when "closed" (grab area) */
:root {
  --panel-collapsed: calc(
    64px + env(safe-area-inset-bottom)
  ); /* visible strip */
  --peek-h: 28svh; /* you already use this for the 'peek' state */
}

@media (max-width: 920px) {
  /* Base mobile sheet states */
  aside.panel {
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
    will-change: transform;
  }
  aside.panel.open {
    transform: translateY(0) !important;
  }
  aside.panel.peek {
    transform: translateY(calc(100% - var(--peek-h))) !important;
  }

  /* NEW: closed keeps a visible strip so the grabber is reachable */
  aside.panel.has-actions.closed {
    transform: translateY(calc(100% - var(--panel-collapsed))) !important;
  }

  /* Make sure the grabber is visible and tappable in closed state */
  aside.panel.has-actions.closed .grabber {
    pointer-events: auto;
  }

  /* Optional: slightly compress content when closed so only header is visible */
  aside.panel.has-actions.closed .box,
  aside.panel.has-actions.closed .sub {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 920px) {
  aside.panel.has-actions.closed {
    overflow: hidden; /* so body content doesn't peek */
    padding-bottom: max(
      8px,
      env(safe-area-inset-bottom)
    ); /* breathing around grabber */
  }
  aside.panel.has-actions.closed h1,
  aside.panel.has-actions.closed .box-title,
  aside.panel.has-actions.closed .grabber {
    opacity: 1;
    pointer-events: auto;
  }
}
.leaflet-top.leaflet-right .leaflet-control-zoom {
  margin: 12px 12px 0 0; /* petit padding du bord */
  border-radius: 12px; /* coins arrondis */
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.leaflet-control-zoom a {
  background: var(--card, #fff);
  color: var(--text, #111);
  border: 1px solid var(--line, #ccc);
  font-weight: 600;
  width: 36px;
  height: 36px;
  line-height: 34px;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}

.leaflet-control-zoom a:hover {
  background: var(--brand, #ff9900);
  color: #fff;
}

.grabber::before {
  background: #ff9900 !important;
  content: "";
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: var(--sa-border, #e5e7eb);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.2px;
  color: var(--text);
}

.brand .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand, #ff9900);
  box-shadow: 0 0 6px rgba(255, 153, 0, 0.6);
}

.brand span {
  white-space: nowrap;
}
