:root {
  --bg: #ffffff;
  --panel: #f8f9fa;
  --line: #e3e6ea;
  --text: #202124;
  --muted: #5f6368;
  --accent: #1a73e8;
  --accent-dark: #1666cc;
  --chip: #f1f3f4;
  --shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15);
  --shadow-lg: 0 2px 6px rgba(60,64,67,.3), 0 8px 24px rgba(60,64,67,.2);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: Roboto, -apple-system, "Segoe UI", system-ui, sans-serif; color: var(--text); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; background: #e8eaed; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* ---- Pile flottante haut-gauche : recherche → My lists → catégories ---- */
/* Largeur calée sur le plus large des trois (≈ la barre de catégories) → la recherche
   ne dépasse plus les catégories ; tout est aligné. */
#topstack {
  position: absolute; top: 12px; left: 12px; z-index: 20;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  width: fit-content; max-width: calc(100vw - 24px);
}

/* ---- Barre de recherche (mêmes bords arrondis « pilule » que les catégories) ---- */
#searchbar {
  position: relative;            /* contexte d'ancrage du menu de suggestions */
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; padding: 0 8px 0 14px;
}

/* ---- My lists (raccourci page principale) : mêmes pastilles que les catégories ---- */
#mylists { display: flex; gap: 8px; }
#mylists:empty { display: none; }
#mylists .listpill { flex: 0 0 auto; box-shadow: var(--shadow); padding: 7px 13px; font-size: 13px; }
#searchbar .s-icon { color: var(--muted); font-size: 18px; }
#search { flex: 1; border: none; outline: none; padding: 13px 8px; font-size: 15px; background: transparent; }
.s-clear { border: none; background: transparent; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; padding: 0 6px; }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff;
  border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; max-height: 60vh; overflow-y: auto;
}
.suggest .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px 14px 4px; }
.suggest .item { padding: 9px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.suggest .item:hover, .suggest .item.active { background: var(--chip); }
.suggest .item .ic { width: 18px; text-align: center; color: var(--muted); }
.suggest .item .t { font-size: 14px; }
.suggest .item .sub { font-size: 12px; color: var(--muted); }
.suggest .item .meta { margin-left: auto; }

/* ---- Barre de catégories (sous My lists) : filtre principal de la carte ---- */
#catbar { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
#catbar::-webkit-scrollbar { display: none; }
#catbar:empty { display: none; }
/* Éteinte = version pâle (fanée) de la couleur de la catégorie ; active = pleine couleur. */
.catchip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 20px; box-shadow: var(--shadow); padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .12s;
  border: 1px solid color-mix(in srgb, var(--cat) 32%, #fff);
  background: color-mix(in srgb, var(--cat) 13%, #fff);
  color: color-mix(in srgb, var(--cat) 78%, #444); }
.catchip:hover { background: color-mix(in srgb, var(--cat) 22%, #fff); }
.catchip .catdot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; opacity: .55; }
.catchip .catn { font-size: 11px; opacity: .65; }
/* Active : remplie à la couleur de la catégorie, texte blanc → état « on » sans ambiguïté. */
/* Sélectionnée : couleur pleine + liseret (fin liseré blanc puis anneau coloré) pour bien la détacher. */
.catchip.on { background: var(--cat); border-color: #fff; color: #fff; box-shadow: 0 0 0 2px var(--cat), var(--shadow); }
.catchip.on .catdot { background: #fff !important; opacity: 1; }
.catchip.on .catn { color: #fff; opacity: .85; }

/* ---- Contrôles carte (zoom +/- et géoloc) : coins bien arrondis, façon pilule ---- */
.maplibregl-ctrl-group { border-radius: 22px !important; overflow: hidden; box-shadow: var(--shadow); border: none; background: #fff; }
.maplibregl-ctrl-group button { width: 36px; height: 36px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }

/* ---- Compte ---- */
.account { position: absolute; top: 12px; right: 12px; z-index: 20; }
.account-btn { background: #fff; border: none; border-radius: 24px; box-shadow: var(--shadow); padding: 10px 16px; font-size: 14px; cursor: pointer; font-weight: 500; }
.account-btn:hover { background: var(--chip); }
.account-menu { position: absolute; top: calc(100% + 6px); right: 0; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 200px; padding: 8px; }
.account-menu .who { padding: 8px 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-menu button, .account-menu .account-link { display: block; width: 100%; box-sizing: border-box; text-align: left; border: none; background: transparent; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); text-decoration: none; }
.account-menu button:hover, .account-menu .account-link:hover { background: var(--chip); }

/* ---- Bascule du panneau + panneau ---- */
.panel-toggle { position: absolute; left: 12px; bottom: 28px; z-index: 18; background: #fff; border: none; border-radius: 24px; box-shadow: var(--shadow); padding: 11px 18px; font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.panel-toggle .funnel, .panel-head h1 .funnel { display: block; }
.panel-toggle:hover { background: var(--chip); }
.panel {
  position: absolute; top: 0; left: 0; z-index: 25; width: 320px; max-width: 92vw; height: 100%;
  background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow-y: auto;
  transform: translateX(-105%); transition: transform .22s ease;
}
.panel.open { transform: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px; }
.panel-head h1 { font-size: 17px; margin: 0; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.panel-close { border: none; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; }
.block { padding: 8px 16px 12px; border-top: 1px solid var(--line); }
.block h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 10px 0 8px; }

/* ---- Calques ---- */
.layers { display: flex; flex-direction: column; gap: 4px; }
/* « My lists » compact : 3 pastilles toggle sur une ligne (--lc = couleur de la liste) */
.listrow { display: flex; gap: 5px; }
/* Même système que les catégories : éteinte = fond pâle teinté (couleur de la liste),
   active = couleur pleine. (--lc = couleur de la liste) */
.listpill { flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; border-radius: 20px; cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--lc) 32%, #fff);
  background: color-mix(in srgb, var(--lc) 14%, #fff);
  color: color-mix(in srgb, var(--lc) 80%, #333); }
.listpill .li { font-size: 13px; line-height: 1; flex: none; }
.listpill .nm { overflow: hidden; text-overflow: ellipsis; }
.listpill .n { font-size: 11px; font-weight: 500; opacity: .7; flex: none; }
.listpill:hover { background: color-mix(in srgb, var(--lc) 24%, #fff); }
/* Sélectionnée : couleur pleine + liseret (liseré blanc + anneau coloré) pour bien la détacher. */
.listpill.on { background: var(--lc); border-color: #fff; color: #fff; box-shadow: 0 0 0 2px var(--lc); }
.listpill.on .n { color: #fff; opacity: .9; }
/* Sur la page principale, on conserve aussi l'ombre flottante en plus du liseret. */
#mylists .listpill.on { box-shadow: 0 0 0 2px var(--lc), var(--shadow); }
.layer { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.layer:hover { background: var(--chip); }
.layer .dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.layer .nm { font-size: 14px; flex: 1; }
.layer .n { font-size: 11px; color: var(--muted); }
.layer .sw { width: 34px; height: 20px; border-radius: 12px; background: #cfd4da; position: relative; transition: background .15s; flex: 0 0 34px; }
.layer .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.layer.on .sw { background: var(--accent); }
.layer.on .sw::after { transform: translateX(14px); }

/* ---- Puces / filtres ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* Sous-en-tête de catégorie dans un filtre (ex. Vibe groupé F&B / Hotels) */
.filtersub { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 10px 0 6px; }
.filtersub:first-of-type { margin-top: 4px; }
.chip { border: 1px solid var(--line); background: var(--chip); border-radius: 16px; padding: 5px 11px; font-size: 13px; cursor: pointer; user-select: none; white-space: nowrap; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .n { opacity: .65; font-size: 11px; margin-left: 4px; }
.tag-filter { position: relative; }
.tag-search { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.tag-selected { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.tag-token { background: var(--accent); color: #fff; border-radius: 14px; padding: 3px 8px; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.tag-token b { cursor: pointer; font-weight: 700; }
.tag-list { max-height: 170px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; display: none; }
.tag-list.open { display: block; }
.tag-opt { padding: 6px 10px; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; }
.tag-opt:hover { background: var(--chip); }
.tag-opt .n { color: var(--muted); font-size: 11px; }

.panel-actions { padding: 14px 16px; display: flex; gap: 8px; border-top: 1px solid var(--line); margin-top: auto; }
.btn { flex: 1; padding: 10px; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; cursor: pointer; }
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: var(--chip); color: var(--text); }
.btn.ghost:hover { background: #e6e8ea; }
.btn.danger { background: #d93025; }
.btn.danger:hover { background: #b3271c; }
.count { padding: 0 16px 16px; color: var(--muted); font-size: 13px; }

.add-hint { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 9px 18px; border-radius: 20px; box-shadow: var(--shadow); font-size: 14px; z-index: 22; }

/* ---- Panneau de détail ---- */
.detail { position: absolute; top: 0; right: 0; width: 380px; max-width: 94vw; height: 100%; background: #fff; box-shadow: var(--shadow-lg); overflow-y: auto; z-index: 30; }
.detail .d-head { position: relative; }
.detail .d-photo { width: 100%; height: 170px; object-fit: cover; background: #ddd; display: block; }
.detail .d-nophoto { height: 64px; }
.detail .d-close { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.94); border: none; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; cursor: pointer; box-shadow: var(--shadow); }
.detail .d-body { padding: 16px 18px 48px; }
.detail h2 { margin: 0 0 2px; font-size: 22px; font-weight: 500; }
.detail .d-type { color: var(--muted); font-size: 13px; text-transform: capitalize; }
.detail .d-price { display: inline-block; margin-top: 6px; font-weight: 600; color: #137333; }
.detail .row { margin: 12px 0; font-size: 14px; line-height: 1.45; }
.detail .row .lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 3px; }
.detail a { color: var(--accent); text-decoration: none; }
.detail a:hover { text-decoration: underline; }
/* « Directions » : bouton stylé comme un lien, ouvre l'action sheet */
.dir-btn { padding: 0; border: none; background: none; font: inherit; color: var(--accent); cursor: pointer; }
.dir-btn:hover { text-decoration: underline; }
/* Action sheet « Directions » (réutilise .modal / .modal-card) */
.dir-card { width: 320px; padding: 22px 20px 20px; }
.dir-title { margin: 0 0 2px; font-size: 17px; }
.dir-sub { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.dir-list { display: flex; flex-direction: column; gap: 8px; }
.dir-opt { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 14.5px; font-weight: 500; text-decoration: none; }
.dir-opt:hover { border-color: var(--accent); background: var(--panel); text-decoration: none; }
.dir-arr { color: var(--muted); }
.d-actions { display: flex; gap: 6px; margin: 12px 0; }
/* Trois petits boutons-listes (Like / My picks / To try). --lc = couleur de la liste. */
.list-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: all .12s; }
.list-btn .li { font-size: 13px; line-height: 1; opacity: .8; }
.list-btn:hover { border-color: var(--lc); color: var(--lc); }
.list-btn.on { background: var(--lc); border-color: var(--lc); color: #fff; }
.list-btn.on .li { opacity: 1; }
.taggroup { margin: 12px 0; }
.taggroup .gtitle { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 5px; }
.taglist { display: flex; flex-wrap: wrap; gap: 6px; }
/* Case commentaire (présente sur toutes les fiches) */
.d-comment { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; font-size: 13px;
  line-height: 1.45; color: inherit; background: var(--chip); border: 1px solid transparent;
  border-radius: 10px; padding: 8px 10px; }
.d-comment:focus { outline: none; border-color: #1a73e8; background: #fff; }
.d-comment::placeholder { color: var(--muted); }
.d-comment-ro { font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.d-comment-hint { height: 14px; margin-top: 3px; font-size: 11px; color: var(--muted); }
.tagpill { background: var(--chip); border-radius: 14px; padding: 4px 10px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.tagpill.wish { background: #e8f0fe; color: #1a4ea8; }
.tagpill.plus { background: #e6f4ea; color: #137333; }
.tagpill.src { background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 500; }
.tagpill.src:hover { background: var(--chip); }
.tagpill b { cursor: pointer; opacity: .6; }
.tagpill b:hover { opacity: 1; }
.editbar { display: flex; gap: 8px; margin: 14px 0; }
.editbar input, .editbar select, .field-edit input, .field-edit select, .field-edit textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.field-edit { margin: 10px 0; }
.field-edit label { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; letter-spacing: .5px; }
.add-row { display: flex; gap: 6px; margin-top: 6px; }
.add-row input { flex: 1; }
.add-row button { padding: 6px 12px; border: none; border-radius: 8px; background: var(--chip); cursor: pointer; }

/* ---- Fenêtre d'authentification ---- */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(32,33,36,.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { position: relative; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 360px; max-width: 100%; padding: 26px 24px 24px; }
.modal-close { position: absolute; top: 12px; right: 12px; border: none; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; }
.fld { display: block; margin-bottom: 12px; }
.fld span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.fld input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.auth-error { background: #fce8e6; color: #c5221f; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.auth-intro { display: flex; flex-direction: column; gap: 3px; margin-bottom: 16px; }
.auth-intro strong { font-size: 16px; }
.auth-intro span { font-size: 13px; color: var(--muted); }
.fld span small { font-weight: 400; color: var(--muted); }
.fld-row { display: flex; gap: 10px; }
.fld-row .fld { flex: 1; }

/* Connexion avec Google */
/* Hôte du bouton Google officiel (GSI) : Google rend son propre bouton dedans, on ne
   fait que le centrer. L'ancien bouton maison (.google-btn) n'est plus utilisé. */
.google-host { display: flex; justify-content: center; margin-bottom: 12px; min-height: 40px; }
.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #3c4043; font-size: 14px; font-weight: 500; cursor: pointer; }
.google-btn:hover { background: #f7f8f8; }
.auth-sep { display: flex; align-items: center; text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0 14px; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-sep span { padding: 0 10px; }

.auth-extra { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.auth-link { font-size: 13px; color: var(--accent); text-decoration: none; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-info { background: #e6f4ea; color: #137333; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.auth-switch { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.auth-switch .auth-link { color: var(--muted); }
.auth-switch .auth-link strong { color: var(--accent); font-weight: 600; }
body.locked .google-btn { background: #fff; }

/* Instance privée, non connecté : masque la carte derrière le mur de connexion (opaque). */
body.locked .modal { background: #1f2933; }
body.locked #map { filter: blur(10px); pointer-events: none; }
body.locked #searchbar, body.locked #panel, body.locked #panel-toggle, body.locked .maplibregl-ctrl, body.locked #account, body.locked #detail { display: none !important; }
#auth-submit { width: 100%; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #202124; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.muted { color: var(--muted); }

/* Marqueur MapLibre pour l'adresse sélectionnée/géocodée */
.maplibregl-popup { max-width: 240px; font: inherit; }


/* variantes de pastilles pour les 4 champs de taxonomie */
.tagpill.type { background: #fef0e6; color: #b3470c; }
.tagpill.vibe { background: #f3e8fd; color: #6b21a8; }
.src-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.src-count { display: inline-block; min-width: 16px; padding: 0 5px; height: 16px; line-height: 16px; border-radius: 8px; background: #202124; color: #fff; font-size: 10px; font-weight: 700; text-align: center; vertical-align: middle; }
.filtersub-sub { margin-left: 14px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.d-price-raw { font-weight: 400; color: var(--muted); }

/* éditeur piloté par la taxonomie */
.edit-box { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.edit-field { margin: 0 0 12px; }
.edit-field label { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; letter-spacing: .5px; }
.edit-field input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.edit-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.echip { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.echip:hover { border-color: var(--accent); }
.echip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.echip.on .src-dot { box-shadow: 0 0 0 1.5px #fff; }

/* édition inline par catégorie : × sur les pastilles, bouton « + Ajouter » + picker de valeurs */
.tagpill .rm { border: none; background: none; cursor: pointer; padding: 0 0 0 2px; margin-left: 2px; font-size: 14px; line-height: 1; color: inherit; opacity: .55; }
.tagpill .rm:hover { opacity: 1; }
.tagpill.src a { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.addtag { border: 1px dashed var(--line); background: #fff; color: var(--muted); border-radius: 14px; padding: 4px 10px; font-size: 12px; cursor: pointer; line-height: 1.2; }
.addtag:hover { border-color: var(--accent); color: var(--accent); }
.addpicker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.addpicker.hidden { display: none; }
.pick { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.pick:hover { border-color: var(--accent); color: var(--accent); }
.pick.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pick.on:hover { color: #fff; }
.pick.on .src-dot { box-shadow: 0 0 0 1.5px #fff; }
/* Picker « Recommandé par » groupé par catégorie maître */
.pickgroup { flex: 1 1 100%; }
.pickgroup + .pickgroup { margin-top: 8px; }
.pickgroup-h { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 0 0 6px; }
.pickgroup-items { display: flex; flex-wrap: wrap; gap: 6px; }
/* Création de valeur réservée à l'admin (input inline dans le picker) */
.newval { flex: 1 1 100%; display: flex; gap: 6px; align-items: center; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--line); }
.newval-in { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line); border-radius: 16px; padding: 5px 11px; font-size: 12.5px; font-family: inherit; background: #fff; }
.newval-in:focus { outline: none; border-color: var(--accent); }
.pick.newbtn { flex: 0 0 auto; border-style: dashed; color: var(--accent); }
.price-pills { gap: 6px; }
.price-pills .echip[data-act="set-price"] { cursor: pointer; }

/* aperçu du brouillon d'adresse avant ajout */
.d-draft { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #1a73e8; font-weight: 700; margin-bottom: 4px; }
.draft-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* Écran étroit : on réserve à droite la place du bouton compte et la barre de recherche
   s'ancre entre la gauche et cette zone → plus de chevauchement « recherche / pseudo ».
   Le pseudo trop long est tronqué (…) pour ne pas déborder. */
@media (max-width: 720px) {
  #topstack { right: 140px; width: auto; max-width: none; }
  .account-btn.is-user { max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 560px) {
  .detail { width: 100%; }
}

/* ============================================================= back-office /admin === */
.admin-body { background: var(--panel); height: auto; min-height: 100%; }

/* Écran d'accès refusé */
.admin-gate { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--panel); z-index: 60; }
.admin-gate-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: 28px 26px; text-align: center; max-width: 360px; }
.admin-gate-card strong { font-size: 16px; }
.admin-gate-card p { color: var(--muted); font-size: 14px; margin: 12px 0 20px; }
.admin-gate-card .btn { display: inline-block; text-decoration: none; padding: 10px 18px; }

/* Coquille : barre latérale fixe + zone principale défilante */
.admin-shell { display: flex; min-height: 100vh; align-items: stretch; }

.admin-sidebar { flex: 0 0 232px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.admin-brand { padding: 20px 20px 16px; }
.admin-brand-name { display: block; font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.admin-brand-sub { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-item:hover { background: var(--chip); }
.nav-item.active { background: #e8f0fe; color: var(--accent); }
.nav-ic { font-size: 16px; width: 20px; text-align: center; }
.admin-sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.admin-who { color: var(--muted); font-size: 13px; }
.nav-foot { color: var(--muted); font-size: 13px; text-decoration: none; text-align: left; }
.nav-foot:hover { color: var(--accent); }
.nav-foot.as-btn { border: none; background: transparent; cursor: pointer; padding: 0; font: inherit; }

.admin-main { flex: 1; min-width: 0; padding: 22px 28px 60px; max-width: 1280px; }
.view-head { margin-bottom: 18px; }
.view-head h1 { font-size: 22px; margin: 0 0 4px; }
.view-sub { color: var(--muted); font-size: 14px; margin: 0; }

/* Utilisateurs : badges & statut */
.ubadge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; background: var(--chip); color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.ubadge.admin { background: #e8f0fe; color: var(--accent); }
.ustatus { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.ustatus::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ustatus.on { color: #137333; }
.ustatus.off { color: #d93025; }
.admin-table tr.row-off td { opacity: .55; }
.admin-table .u-email { color: var(--muted); }

/* Accès : carte + interrupteur */

/* ---- Validation des inscriptions ---- */
.users-pending { background: #fef7e0; border: 1px solid #f0d68a; color: #7a5a00; border-radius: 10px;
  padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; }
.ustatus.pending { color: #8a6100; }
.admin-table tr.row-pending td { background: #fffdf5; }

/* ---- Settings : fréquence de rafraîchissement par source ---- */
.sched-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; max-width: 720px; }
.sched-list { display: flex; flex-direction: column; gap: 2px; }
.sched-row { display: grid; grid-template-columns: 1fr auto auto 150px auto; align-items: center; gap: 14px;
  padding: 12px 2px; border-top: 1px solid var(--line); }
.sched-row:first-child { border-top: 0; }
.sched-name { font-weight: 600; font-size: 14.5px; }
.sched-last { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sched-pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600;
  letter-spacing: .02em; background: #eef0f3; color: #5a6472; white-space: nowrap; }
.sched-pill.ok  { background: #e6f4ea; color: #137333; }
.sched-pill.due { background: #fef7e0; color: #8a6100; }
.sched-pill.run { background: #e8f0fe; color: #1a4ea8; }
.sched-pill.wait{ background: #f1f3f4; color: #5a6472; }
.sched-pill.err { background: #fce8e6; color: #b3261e; }
.sched-freq { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; background: #fff; }
.sched-run { white-space: nowrap; }
.sched-run[disabled] { opacity: .45; cursor: default; }
@media (max-width: 700px) {
  .sched-row { grid-template-columns: 1fr auto; row-gap: 8px; }
  .sched-last, .sched-state { grid-column: 1; }
  .sched-freq { grid-column: 1; width: auto; }
}
.acces-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; max-width: 560px; }
.acces-explain { font-size: 14px; line-height: 1.5; color: var(--text); margin: 0 0 18px; }
.acces-fld { display: block; margin-bottom: 16px; }
.acces-fld > span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 6px; }
.acces-fld input { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; font-size: 18px; font-weight: 600; letter-spacing: 1px; font-family: inherit; }
.acces-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.acces-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.acces-toggle .switch { position: relative; width: 40px; height: 22px; background: #c8ccd1; border-radius: 11px; transition: background .15s; flex: 0 0 auto; }
.acces-toggle .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.acces-toggle input:checked + .switch { background: var(--accent); }
.acces-toggle input:checked + .switch::after { transform: translateX(18px); }
.acces-toggle-lbl { font-size: 14px; }
.acces-hint { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.acces-actions { margin-top: 20px; }
.acces-actions .btn { flex: 0 0 auto; padding: 10px 22px; }

@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { flex: none; width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); }
  .admin-brand { padding: 14px 16px 8px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; flex: none; }
  .admin-sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .admin-main { padding: 18px 16px 60px; }
}

/* Barre d'outils */
.admin-toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.admin-fld { display: flex; flex-direction: column; gap: 5px; }
.admin-fld.grow { flex: 1; min-width: 200px; }
.admin-fld > span { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.admin-fld select, .admin-fld input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; }
.admin-fld.grow input { width: 100%; box-sizing: border-box; }
.admin-toolbar #btn-add { flex: 0 0 auto; align-self: flex-end; padding: 9px 16px; }

/* Méta + pagination */
.admin-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 2px; flex-wrap: wrap; }
.admin-count { font-size: 14px; font-weight: 500; }
.admin-pager { display: flex; align-items: center; gap: 10px; }
.admin-pager #pg-info { font-size: 13px; color: var(--muted); white-space: nowrap; }
.admin-pager .btn { flex: 0 0 auto; padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }

/* Boutons compacts */
.btn.sm { flex: 0 0 auto; padding: 6px 10px; font-size: 13px; }

/* Tableau */
.admin-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--panel); position: sticky; top: 0; z-index: 1; }
.admin-table th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.admin-table th[data-sort]:hover { color: var(--text); }
.admin-table th[data-sort].sorted { color: var(--accent); }
.admin-table th[data-sort].sorted[data-dir="asc"]::after { content: " ▲"; font-size: 9px; }
.admin-table th[data-sort].sorted[data-dir="desc"]::after { content: " ▼"; font-size: 9px; }
.admin-table tbody tr:hover { background: #fafbfc; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table td input, .admin-table td select { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-family: inherit; }
.admin-table .c-actions { white-space: nowrap; text-align: right; display: flex; gap: 6px; justify-content: flex-end; }
.admin-table .c-website a { color: var(--accent); text-decoration: none; }
.admin-table .c-website a:hover { text-decoration: underline; }
.admin-empty { text-align: center; color: var(--muted); padding: 28px 0; }

/* Puces de source */
.src-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); border-radius: 12px; padding: 2px 4px 2px 9px; font-size: 12px; margin: 2px 3px 2px 0; }
.src-x { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; border-radius: 50%; }
.src-x:hover { color: #d93025; background: #fde8e6; }
.src-none { color: var(--muted); }

/* ===== Back-office · vue Critères (taxonomie éditable) ===================== */
.criteres-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; align-items: start; }
.crit-field { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; }
.crit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.crit-head h2 { font-size: 15px; margin: 0; }
.crit-meta { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.crit-values { list-style: none; margin: 0 0 12px; padding: 0; }
.crit-values li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.crit-values li:last-child { border-bottom: none; }
.crit-empty { color: var(--muted); justify-content: center; }
.crit-move { display: inline-flex; flex-direction: column; gap: 1px; flex: 0 0 auto; width: 20px; }
.crit-mv { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; line-height: 1; padding: 1px; border-radius: 3px; }
.crit-mv:hover:not(:disabled) { color: var(--accent); background: var(--chip); }
.crit-mv:disabled { opacity: .25; cursor: default; }
.crit-body { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.crit-name { font-size: 14px; }
.crit-swatch { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.15); }
.crit-kind-lbl, .crit-hint { font-size: 11px; color: var(--muted); }
.crit-flag { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #b06000; background: #fff3e0; padding: 1px 6px; border-radius: 8px; }
.crit-count { flex: 0 0 auto; min-width: 26px; text-align: center; font-size: 12px; color: var(--muted); background: var(--chip); border-radius: 10px; padding: 1px 7px; }
.crit-acts { flex: 0 0 auto; display: flex; gap: 5px; }
.crit-acts .btn.sm { padding: 5px 8px; font-size: 12px; }
.crit-in { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-family: inherit; background: #fff; min-width: 0; }
.crit-in.sm { width: 64px; flex: 0 0 auto; }
.crit-in.xs { width: 46px; flex: 0 0 auto; text-align: center; }
.crit-body .crit-in:not(.sm):not(.xs) { flex: 1 1 90px; }
.crit-color { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; flex: 0 0 auto; }
.crit-editing { background: #fafbfc; }
.crit-add { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.crit-add .crit-in:not(.sm):not(.xs) { flex: 1 1 110px; }
.crit-add .btn.sm { flex: 0 0 auto; }
