  :root{
    --ink:#F2EEE3;
    --panel:#ECE6D6;
    --panel-2:#E4DCC5;
    --line: rgba(36,31,26,0.18);
    --paper:#241F1A;
    --paper-dim:#6b6a63;
    --brass:#B8863F;
    --brass-soft: rgba(184,134,63,0.14);
    --moss:#1F4E4A;
    --coral-off:#8C4A3A;
    --danger:#8C4A3A;
  }
  *{box-sizing:border-box;}
  html,body{height:100%;margin:0;background:var(--ink);color:var(--paper);font-family:'Archivo',sans-serif;overflow:hidden;}
  #map{position:absolute;inset:0;}

  .leaflet-container{background:#E4DCC5;}
  .leaflet-control-attribution{background:rgba(242,238,227,0.75)!important;color:var(--paper-dim)!important;font-size:9px;}
  .leaflet-control-attribution a{color:var(--brass)!important;}
  .leaflet-control-zoom{display:none;}

  /* top bar */
  .topbar{
    position:absolute; top:0; left:0; right:0; z-index:500;
    padding: 14px 14px 10px;
    background: linear-gradient(180deg, rgba(242,238,227,0.75) 0%, rgba(242,238,227,0.45) 70%, transparent 100%);
    pointer-events:none;
  }
  .topbar-inner{ pointer-events:auto; }
  .brand{
    display:flex; align-items:baseline; gap:8px; margin-bottom:10px;
  }
  .brand .mark{
    font-family:'Fraunces', serif; font-weight:700; font-size:21px; letter-spacing:0.3px; color:var(--paper);
  }
  .brand .mark em{ color:var(--brass); font-style:normal; }
  .brand .count{
    font-family:'JetBrains Mono', monospace; font-size:11px; color:var(--paper-dim);
  }
  .chips{ display:flex; gap:7px; overflow-x:auto; padding-bottom:2px; -ms-overflow-style:none; scrollbar-width:none; }
  .chips::-webkit-scrollbar{display:none;}

  .searchbar{ display:flex; gap:8px; margin-bottom:10px; }
  .searchbar form{ flex:1; display:flex; align-items:center; gap:8px;
    background: rgba(236,230,214,0.92); border:1px solid var(--line); border-radius:100px;
    padding:9px 14px; backdrop-filter: blur(6px); }
  .searchbar input{ flex:1; background:transparent; border:none; outline:none; color:var(--paper);
    font-family:inherit; font-size:13.5px; }
  .searchbar input::placeholder{ color:var(--paper-dim); }
  .searchbar .icon-btn{ width:38px; height:38px; border-radius:50%; border:1px solid var(--line);
    background: rgba(236,230,214,0.92); color:var(--paper-dim); display:flex; align-items:center; justify-content:center;
    cursor:pointer; flex:0 0 auto; font-size:15px; backdrop-filter: blur(6px); }
  .searchbar .icon-btn.on{ background:var(--brass); color:#1a1408; border-color:var(--brass); }

  .layer-switch{ position:relative; }
  .layer-menu{ position:absolute; top:46px; right:0; background:var(--panel); border:1px solid var(--line);
    border-radius:12px; padding:6px; display:none; flex-direction:column; gap:4px; min-width:160px;
    box-shadow:0 8px 24px rgba(0,0,0,0.45); z-index:530; }
  .layer-menu.show{ display:flex; }
  .layer-opt{ padding:9px 11px; border-radius:8px; font-size:12.5px; color:var(--paper); cursor:pointer; display:flex; align-items:center; justify-content:space-between; }
  .layer-opt:hover{ background:var(--panel-2); }
  .layer-opt.sel{ color:var(--brass); font-weight:600; }
  .searchbar button[type="submit"]{ background:none; border:none; color:var(--paper-dim); font-size:14px; cursor:pointer; padding:0; }
  .chip{
    flex:0 0 auto; padding:7px 13px; border-radius:100px; font-size:12.5px; font-weight:500;
    background: rgba(236,230,214,0.88); border:1px solid var(--line); color:var(--paper-dim);
    cursor:pointer; white-space:nowrap; transition: all .15s ease; backdrop-filter: blur(6px);
  }
  .chip.active{ background:var(--brass); color:#1a1408; border-color:var(--brass); font-weight:600; }
  .chip .dot{ display:inline-block; width:7px;height:7px;border-radius:50%; margin-right:6px; vertical-align:middle; }

  /* custom pin */
  .pin{ width:19px; height:19px; border-radius:50%;
    border:2.5px solid #F2EEE3; box-shadow:0 1px 4px rgba(36,31,26,0.5); transition: transform .15s ease; }
  .pin.new-pending{ animation:pulse 1.1s infinite; }
  @keyframes pulse{ 0%{transform:scale(1);} 50%{transform:scale(1.35);} 100%{transform:scale(1);} }
  body.zoom-far .pin{ transform: scale(0.8); }
  body.zoom-mid .pin{ transform: scale(0.92); }

  .user-dot{ width:16px; height:16px; border-radius:50%; background:#1F4E4A; border:3px solid rgba(242,238,227,0.95);
    box-shadow:0 0 0 6px rgba(31,78,74,0.2); }

  .search-marker{ position:relative; width:44px; height:44px; display:flex; align-items:center; justify-content:center; }
  .search-marker .halo{ position:absolute; width:44px; height:44px; border-radius:50%;
    border:1.5px solid var(--coral-off); opacity:0.55; animation:searchHalo 1.8s ease-out infinite; }
  .search-marker svg{ position:relative; width:34px; height:34px; filter:drop-shadow(0 2px 4px rgba(36,31,26,0.55)); }
  @keyframes searchHalo{
    0%{ transform:scale(0.4); opacity:0.7; }
    100%{ transform:scale(1.5); opacity:0; }
  }

  /* bottom sheet */
  .sheet-backdrop{ position:absolute; inset:0; background:rgba(10,15,13,0.5); z-index:600; opacity:0; pointer-events:none; transition:opacity .2s ease;}
  .sheet-backdrop.show{ opacity:1; pointer-events:auto; }
  .sheet{
    position:absolute; left:0; right:0; bottom:0; z-index:601;
    background:var(--panel); border-radius:20px 20px 0 0; border-top:1px solid var(--line);
    transform:translateY(100%); transition:transform .28s cubic-bezier(.32,.72,0,1);
    max-height:min(62vh, 520px); overflow-y:auto; padding-bottom:18px;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.45);
  }
  .sheet.show{ transform:translateY(0); }
  .sheet-handle{ width:36px; height:4px; background:var(--line); border-radius:4px; margin:10px auto 4px; }
  .sheet-photo-wrap{ width:100%; height:130px; background:#0b1210; display:flex; align-items:center; justify-content:center; overflow:hidden; cursor:zoom-in; position:relative; }
  #sEmbedWrap{ width:100%; overflow:hidden; background:#0b1210; display:flex; justify-content:center; align-items:flex-start; padding:0; position:relative; }
  #sEmbedWrap.ig-embed .instagram-media{ transform-origin: top center !important; }
  #sEmbedWrap.yt-embed, #sEmbedWrap.map-embed{ padding:8px 0; align-items:center; }
  #sEmbedWrap .link-card{ padding:20px 18px; text-align:center; }
  #sEmbedWrap .link-card .host{ font-family:'JetBrains Mono', monospace; font-size:11.5px; color:var(--paper-dim); margin-bottom:6px; }
  #sEmbedWrap .link-card a{ color:var(--brass); font-weight:600; font-size:13px; word-break:break-all; }
  #sEmbedWrap iframe{ width:100%; aspect-ratio:16/9; border:0; display:block; }
  #sEmbedWrap .instagram-media{ margin:0 auto !important; width:100% !important; min-width:0 !important; }
  #sEmbedWrap .embed-fallback{ padding:26px 18px; text-align:center; color:var(--paper-dim); font-size:12.5px; }
  #sEmbedWrap .embed-fallback a{ color:var(--brass); font-weight:600; }
  .photo-placeholder{ display:none; align-items:center; justify-content:center; width:100%; height:100%;
    color:var(--paper-dim); font-size:11.5px; font-style:italic; font-family:'Fraunces',serif; text-align:center; padding:0 20px; }
  .sheet-photo{ max-width:100%; max-height:100%; object-fit:contain; }
  .carousel-arrow{ position:absolute; top:50%; transform:translateY(-50%); width:28px; height:28px; border-radius:50%;
    background:rgba(18,29,26,0.65); color:#fff; display:flex; align-items:center; justify-content:center;
    font-size:14px; cursor:pointer; z-index:5; }
  .carousel-arrow.prev{ left:8px; } .carousel-arrow.next{ right:8px; }
  .carousel-dots{ position:absolute; bottom:8px; left:0; right:0; display:flex; justify-content:center; gap:5px; z-index:5; }
  .carousel-dots span{ width:5px; height:5px; border-radius:50%; background:rgba(255,255,255,0.4); }
  .carousel-dots span.on{ background:#fff; }

  .lightbox{ position:fixed; inset:0; z-index:1000; background:rgba(36,31,26,0.92);
    display:none; align-items:center; justify-content:center; padding:24px; }
  .lightbox.show{ display:flex; }
  .lightbox img{ max-width:100%; max-height:100%; object-fit:contain; border-radius:6px; }
  .lightbox-close{ position:absolute; top:18px; right:18px; width:40px; height:40px; border-radius:50%;
    background:var(--panel); border:1px solid var(--line); color:var(--paper); font-size:18px;
    display:flex; align-items:center; justify-content:center; cursor:pointer; }
  .sheet-body{ padding:14px 18px 4px; }
  .sheet-toprow{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:6px; }
  .sheet-tag{ display:inline-flex; align-items:center; gap:6px; font-size:11px; letter-spacing:0.4px; text-transform:uppercase;
    color:var(--brass); font-weight:600; margin-bottom:0; }
  .sheet-tag .dot{ width:7px;height:7px;border-radius:50%; }
  .btn-go-top{ flex:0 0 auto; background:var(--brass); color:#1a1408; border:none; border-radius:100px;
    padding:7px 13px; font-size:11.5px; font-weight:700; cursor:pointer; white-space:nowrap; }
  .sheet-title{ font-family:'Fraunces', serif; font-size:19px; font-weight:600; line-height:1.15; margin:0 0 8px; }
  .sheet-note{ font-size:13.5px; line-height:1.5; color:var(--paper); opacity:0.92; margin:0 0 12px; }
  .sheet-source{ display:flex; align-items:center; justify-content:space-between; padding:9px 12px; background:var(--panel-2);
    border-radius:12px; margin-bottom:9px; border:1px solid var(--line); }
  .sheet-source .who{ font-size:12.5px; }
  .sheet-source .who b{ display:block; font-size:13px; }
  .sheet-source .who span{ color:var(--paper-dim); font-size:11px; }
  .sheet-source a{ color:var(--brass); font-size:12px; text-decoration:none; font-weight:600; }
  .sheet-coords{ font-family:'JetBrains Mono', monospace; font-size:10.5px; color:var(--paper-dim); margin-bottom:12px; }
  .sheet-travel{ display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--moss); margin-bottom:12px; font-weight:600; }
  .sheet-actions{ display:flex; gap:8px; }
  .btn{ border:none; border-radius:11px; padding:10px 14px; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; }
  .btn-ghost{ background:transparent; border:1px solid var(--line); color:var(--paper); flex:1; }
  .btn-danger{ background:rgba(192,90,77,0.15); color:#e5978a; border:1px solid rgba(192,90,77,0.3); }
  .btn-brass{ background:var(--brass); color:#1a1408; flex:1; }

  /* panneau latéral sur écran large, à la place du tiroir bas d'écran */
  @media (min-width: 760px){
    .sheet{
      left:auto; right:16px; bottom:16px; top:110px;
      width:340px; border-radius:16px; max-height:none; height:auto;
      transform:translateX(120%);
    }
    .sheet.show{ transform:translateX(0); }
    .sheet-handle{ display:none; }
    .sheet-photo-wrap{ height:150px; border-radius:16px 16px 0 0; }
  }

  /* admin fab */
  .fab-stack{ position:absolute; right:16px; bottom:22px; z-index:520; display:flex; flex-direction:column; gap:10px; align-items:flex-end; }
  .fab{ width:52px; height:52px; border-radius:50%; border:none; cursor:pointer;
    display:flex; align-items:center; justify-content:center; box-shadow:0 6px 18px rgba(0,0,0,0.45); }
  .fab-admin{ background:var(--panel); border:1px solid var(--line); color:var(--paper-dim); font-size:18px; }
  .fab-admin.on{ background:var(--brass); color:#1a1408; border-color:var(--brass); }
  .fab-add{ background:var(--brass); color:#1a1408; font-size:24px; font-weight:600; display:none; }
  .fab-add.show{ display:flex; }

  .layer-switch-bl{ position:absolute; left:16px; bottom:22px; z-index:520; }
  .layer-switch-bl .icon-btn{ width:48px; height:48px; border-radius:50%; font-size:18px;
    background:var(--panel); border:1px solid var(--line); box-shadow:0 6px 18px rgba(0,0,0,0.45);
    display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--paper-dim); }
  .layer-switch-bl .layer-menu{ position:absolute; bottom:56px; top:auto; left:0; min-width:170px; }

  .search-suggestions{ position:relative; margin-top:-6px; margin-bottom:2px; }
  .search-suggestions .sugg-item{ background:rgba(236,230,214,0.97); border:1px solid var(--line); border-top:none;
    padding:9px 14px; font-size:12.5px; color:var(--paper); cursor:pointer; backdrop-filter: blur(6px); }
  .search-suggestions .sugg-item:first-child{ border-top:1px solid var(--line); border-radius:10px 10px 0 0; }
  .search-suggestions .sugg-item:last-child{ border-radius:0 0 10px 10px; }
  .search-suggestions .sugg-item:hover{ background:rgba(201,160,78,0.15); }

  .banner{ position:absolute; top:0; left:0; right:0; z-index:700; padding:10px 16px; text-align:center;
    font-size:12.5px; font-weight:600; background:var(--brass); color:#1a1408; transform:translateY(-100%);
    transition:transform .25s ease; }
  .banner.show{ transform:translateY(0); }

  /* form sheet */
  .form-row{ margin-bottom:12px; }
  .form-row label{ display:block; font-size:11.5px; text-transform:uppercase; letter-spacing:0.4px; color:var(--paper-dim); margin-bottom:6px; font-weight:600; }
  .form-row input, .form-row textarea, .form-row select{
    width:100%; background:var(--panel-2); border:1px solid var(--line); border-radius:10px; padding:10px 12px;
    color:var(--paper); font-family:inherit; font-size:14px;
  }
  .form-row textarea{ resize:vertical; min-height:64px; }
  .cat-picker{ display:flex; gap:8px; flex-wrap:wrap; }
  .cat-opt{ padding:8px 12px; border-radius:100px; border:1px solid var(--line); background:var(--panel-2); font-size:12.5px; cursor:pointer; display:flex; align-items:center; gap:6px;}
  .cat-opt.sel{ border-color:var(--brass); background:var(--brass-soft); color:var(--brass); font-weight:600;}
  .cat-opt .dot{ width:7px;height:7px;border-radius:50%; }
  .hint{ font-size:12px; color:var(--paper-dim); padding:0 18px 6px; line-height:1.5; }
  .photo-thumbs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
  .photo-thumb{ position:relative; width:64px; height:64px; border-radius:8px; overflow:hidden; }
  .photo-thumb img{ width:100%; height:100%; object-fit:cover; }
  .photo-thumb .rm{ position:absolute; top:2px; right:2px; width:18px; height:18px; border-radius:50%;
    background:rgba(10,15,13,0.8); color:#fff; font-size:11px; display:flex; align-items:center; justify-content:center; cursor:pointer; }
  .empty-state{ position:absolute; inset:0; display:none; align-items:center; justify-content:center; z-index:510; pointer-events:none; text-align:center; padding:0 40px;}
  .empty-state.show{ display:flex; }
  .empty-state p{ color:var(--paper-dim); font-size:13.5px; font-family:'Fraunces', serif; font-style:italic; }

  .compass-btn{ position:absolute; z-index:520; top:172px; right:14px; width:42px; height:42px; border-radius:50%;
    background:var(--panel); border:1px solid var(--line); display:flex; align-items:center; justify-content:center;
    cursor:pointer; box-shadow:0 4px 14px rgba(0,0,0,0.35); }
  .compass-btn svg{ width:22px; height:22px; }

  .confirm-bar{ position:fixed; left:14px; right:14px; bottom:22px; z-index:900; background:var(--panel);
    border:1px solid var(--brass); border-radius:14px; padding:12px 14px; display:none; flex-direction:column; gap:10px;
    box-shadow:0 8px 26px rgba(0,0,0,0.5); }
  .confirm-bar.show{ display:flex; }
  .confirm-bar span{ font-size:12.5px; color:var(--paper); }
  .confirm-bar-actions{ display:flex; gap:8px; }
  .confirm-bar-actions .btn{ flex:1; }

  .list-toggle{ margin-left:auto; font-size:12px; color:var(--paper-dim); border:1px solid var(--line);
    padding:6px 11px; border-radius:100px; cursor:pointer; background:rgba(236,230,214,0.88); white-space:nowrap; }
  .list-toggle:hover{ color:var(--brass); border-color:var(--brass); }

  .list-panel{ position:absolute; inset:0; z-index:800; background:var(--ink); display:none; flex-direction:column; }
  .list-panel.show{ display:flex; }
  .list-panel-header{ padding:16px 16px 8px; border-bottom:1px solid var(--line); flex:0 0 auto; }
  .list-panel-title{ font-family:'Fraunces',serif; font-size:19px; font-weight:600; margin-bottom:12px;
    display:flex; justify-content:space-between; align-items:center; }
  .list-panel-title span{ font-family:'Archivo',sans-serif; font-size:16px; color:var(--paper-dim); cursor:pointer; font-weight:400; }
  .list-panel-header input{ width:100%; background:var(--panel-2); border:1px solid var(--line); border-radius:10px;
    padding:9px 12px; color:var(--paper); font-family:inherit; font-size:13.5px; margin-bottom:10px; }
  .list-panel-header .chips{ margin-bottom:8px; }
  .list-panel-body{ flex:1; overflow-y:auto; padding:8px 16px 24px; }
  .list-row{ display:flex; align-items:center; gap:10px; padding:10px 4px; border-bottom:1px solid var(--line); }
  .list-row.hidden-row{ opacity:0.45; }
  .list-row .dot{ width:9px; height:9px; border-radius:50%; flex:0 0 auto; }
  .list-row .info{ flex:1; min-width:0; cursor:pointer; }
  .list-row .info .nm{ font-size:13.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .list-row .info .src{ font-size:11px; color:var(--paper-dim); }
  .list-row .row-actions{ display:flex; gap:6px; flex:0 0 auto; }
  .list-row .row-btn{ width:30px; height:30px; border-radius:8px; background:var(--panel-2); border:1px solid var(--line);
    display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:13px; color:var(--paper-dim); }
  .list-empty{ color:var(--paper-dim); font-style:italic; font-family:'Fraunces',serif; text-align:center; padding:30px 10px; font-size:13px; }
  .list-result-bar{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:6px; flex-wrap:wrap; }
  .list-result-count{ font-family:'JetBrains Mono', monospace; font-size:11.5px; color:var(--paper-dim); }
  .list-bulk-actions{ display:flex; gap:6px; }
  .list-bulk-actions .btn{ padding:6px 10px; font-size:11.5px; }

  .map-toggle{ font-size:12px; color:var(--paper-dim); border:1px solid var(--line);
    padding:6px 11px; border-radius:100px; cursor:pointer; background:rgba(236,230,214,0.88);
    white-space:nowrap; margin-left:8px; max-width:190px; overflow:hidden; text-overflow:ellipsis; }
  .map-toggle:hover{ color:var(--brass); border-color:var(--brass); }
  .list-row.current-map{ background:rgba(184,134,63,0.10); }
  .badge{ display:inline-block; font-family:'JetBrains Mono', monospace; font-size:10px;
    padding:1px 6px; border-radius:100px; border:1px solid var(--line); color:var(--paper-dim); margin-right:5px; }
  .badge.own{ border-color:var(--brass); color:var(--brass); }
  .visibility-picker, .role-picker{ display:flex; gap:6px; margin-bottom:10px; }
  .visibility-opt, .role-opt{ flex:1; text-align:center; font-size:11.5px; padding:7px 4px; border-radius:9px;
    border:1px solid var(--line); background:var(--panel-2); color:var(--paper-dim); cursor:pointer; }
  .visibility-opt.on, .role-opt.on{ border-color:var(--brass); color:var(--brass); }
  .share-row{ display:flex; align-items:center; gap:8px; padding:8px 2px; border-bottom:1px solid var(--line); }
  .share-row .who{ flex:1; min-width:0; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .share-row .role-picker{ flex:0 0 auto; width:150px; margin-bottom:0; }
  .share-row .row-btn{ width:30px; height:30px; border-radius:8px; background:var(--panel-2); border:1px solid var(--line);
    display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:13px; color:var(--paper-dim); flex:0 0 auto; }
