/* ==========================================================================
   Garde-manger — feuille de style
   Principe : look "appli iPhone" sobre (police système, listes groupées),
   un seul élément signature : la pastille de fraîcheur colorée, façon Yuka.
   ========================================================================== */

/* --- Couleurs (clair / sombre) ------------------------------------------ */
:root {
  --bg: #f2f4f3;          /* fond général, gris légèrement vert */
  --surface: #ffffff;     /* listes, fenêtres */
  --ink: #1b1f1d;         /* texte principal */
  --muted: #6b736f;       /* texte secondaire */
  --line: #e3e7e5;        /* séparateurs */
  --leaf: #1f9d55;        /* couleur principale : frais / entrée */
  --leaf-soft: #e3f4ea;
  --amber: #e8930c;       /* à consommer vite / sortie */
  --amber-soft: #fdf0dc;
  --tomato: #e04a3b;      /* périmé / suppression */
  --tomato-soft: #fbe5e2;
  --radius: 14px;
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101312;
    --surface: #1a1e1c;
    --ink: #eef2f0;
    --muted: #98a19c;
    --line: #2a302d;
    --leaf: #34c477;
    --leaf-soft: #17321f;
    --amber: #f2a93b;
    --amber-soft: #3a2a10;
    --tomato: #f26657;
    --tomato-soft: #3d1a16;
    color-scheme: dark;
  }
}

/* --- Base ---------------------------------------------------------------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--leaf); text-decoration: none; }
img { display: block; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.view {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--tabbar-h) + var(--safe-bottom) + 32px);
  min-height: 100vh;
}

/* --- Titres (style "grand titre" iOS) ------------------------------------ */
.page-title { font-size: 32px; line-height: 1.15; font-weight: 750; letter-spacing: -0.02em; margin: 8px 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 20px; }
.section-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 28px 0 10px; }
.topbar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.back { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; padding: 8px 8px 8px 0; background: none; border: 0; color: var(--leaf); cursor: pointer; }
.back svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.2; }

/* --- Listes groupées (le cœur visuel) ------------------------------------ */
.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; margin: 0; padding: 0; list-style: none; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; min-height: 64px;
  color: inherit; position: relative; cursor: pointer;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 82px; right: 0; border-top: 1px solid var(--line); }
.row.compact { min-height: 52px; }
.row.compact + .row.compact::before { left: 14px; }
.row:active { background: var(--bg); }

/* Balayer vers la gauche pour supprimer (voir js/swipe.js) */
.swipe { position: relative; overflow: hidden; transition: height .24s ease; }
.swipe.swiping { background: var(--tomato); }
.swipe.collapsing { opacity: 0; transition: height .24s ease, opacity .2s; }
.swipe-row { position: relative; z-index: 1; background: var(--surface); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.swipe-del {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 20px; border: 0; background: var(--tomato); color: #fff; font: inherit; font-weight: 650; cursor: pointer;
}
.swipe + .swipe .row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--line); }
.swipe-tip { font-size: 13px; color: var(--muted); margin: 6px 4px 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; flex-shrink: 0; }
.qty { font-weight: 700; font-size: 17px; }
.qty small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 2px; }

/* Vignette produit : fond blanc car les photos OFF sont détourées sur blanc */
.thumb {
  width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
  background: #fff; border: 1px solid var(--line);
  object-fit: contain; padding: 3px;
}
.thumb.sm { width: 40px; height: 40px; border-radius: 10px; }
.thumb-empty { display: grid; place-items: center; font-size: 24px; font-weight: 700; color: var(--leaf); background: var(--leaf-soft); border-color: transparent; }
.thumb-empty.sm { font-size: 17px; }

/* --- Pastille de fraîcheur (l'élément signature) ------------------------- */
.fresh { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.fresh::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.fresh.ok      { color: var(--leaf); }
.fresh.soon    { color: var(--amber); }
.fresh.expired { color: var(--tomato); }
.fresh.none::before { background: var(--line); }

/* --- Accueil -------------------------------------------------------------- */
.hero-line { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; margin: 4px 0 18px; }
.hero-line .n-soon { color: var(--amber); }
.hero-line .n-exp { color: var(--tomato); }
.hero-line .n-ok { color: var(--leaf); }
.chips-stats { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.chips-stats::-webkit-scrollbar { display: none; }
.stat {
  flex-shrink: 0; background: var(--surface); border-radius: 999px; padding: 8px 14px;
  display: inline-flex; gap: 6px; align-items: baseline; color: var(--ink); border: 0; cursor: pointer;
}
.stat b { font-size: 17px; }
.stat span { color: var(--muted); font-size: 14px; }
.empty {
  text-align: center; padding: 36px 20px; background: var(--surface); border-radius: var(--radius);
}
.empty .big { font-size: 44px; margin-bottom: 8px; }
.empty p { color: var(--muted); margin: 6px 0 18px; }

/* --- Boutons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: 14px; border: 0;
  background: var(--leaf); color: #fff; font-weight: 650; font-size: 17px; cursor: pointer;
  width: 100%;
}
.btn:disabled { opacity: .5; }
.btn.amber { background: var(--amber); }
.btn.ghost { background: var(--surface); color: var(--ink); }
.btn.danger { background: var(--tomato-soft); color: var(--tomato); }
.btn.small { min-height: 38px; font-size: 15px; width: auto; padding: 0 14px; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.link-btn { background: none; border: 0; color: var(--leaf); font-weight: 600; padding: 10px 0; cursor: pointer; }

/* --- Champs de formulaire ------------------------------------------------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); font-size: 17px;
}
.input:focus { border-color: var(--leaf); outline: none; }
.search { position: relative; margin-bottom: 12px; }
.search .input { padding-left: 40px; background: var(--surface); border-color: transparent; }
.search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; }

/* Pastilles de choix (emplacement, motif, unité...) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 15px; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
/* Filtre par famille (onglet Stock) : en vert pour le distinguer des emplacements */
.chips.family-filter { margin-bottom: 8px; }
.family-filter .chip[aria-pressed="true"] { background: var(--leaf); border-color: var(--leaf); color: #fff; }

/* Compteur − 1 + */
.stepper { display: flex; align-items: center; background: var(--surface); border-radius: 14px; overflow: hidden; }
.sheet .stepper { background: var(--bg); }
.stepper button { width: 56px; height: 52px; border: 0; background: none; font-size: 26px; font-weight: 500; cursor: pointer; color: var(--ink); }
.stepper input { flex: 1; min-width: 0; text-align: center; border: 0; background: none; font-size: 22px; font-weight: 700; height: 52px; }
.stepper input:focus { outline: none; }
.stepper .unit { padding-right: 12px; color: var(--muted); }

/* Raccourcis de DLC (+3 j, +1 sem...) */
.quick-dates { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick-dates button { border: 0; background: var(--bg); border-radius: 8px; padding: 6px 10px; font-size: 14px; cursor: pointer; }

/* Sélecteur Entrée / Sortie */
.segmented { display: inline-flex; background: rgba(255,255,255,.16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 999px; padding: 4px; }
.segmented button { border: 0; background: none; color: #fff; padding: 8px 18px; border-radius: 999px; font-weight: 650; cursor: pointer; font-size: 15px; }
.segmented button[aria-pressed="true"].in  { background: var(--leaf); }
.segmented button[aria-pressed="true"].out { background: var(--amber); }

/* Version claire, dans les fenêtres : Ajouter / Retirer */
.seg-light { display: flex; background: var(--bg); border-radius: 12px; padding: 3px; margin-bottom: 16px; }
.seg-light button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg-light button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* --- Écran de scan -------------------------------------------------------- */
body.scanning { background: #000; }
body.scanning .view { padding: 0; max-width: none; }
.scan {
  position: fixed; inset: 0; overflow: hidden; /* plein écran, comme Yuka */
  background: #000; color: #fff; display: flex; flex-direction: column;
}
/* La vidéo de Safari reste invisible : elle ne sert que de source d'images.
   (Sur iPhone, l'afficher directement donne un démarrage "petit + bandes noires
   puis saut plein écran".) L'image est dessinée sur le canvas ci-dessous. */
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
/* Surface d'affichage plein écran : apparaît en fondu à la première vraie image */
.scan-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity .25s ease-out;
}
.scan-canvas.live { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .scan-canvas { transition: none; } }
.scan { background: radial-gradient(120% 80% at 50% 45%, #1c2420 0%, #000 70%); }
.scan-top {
  position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
}
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.icon-btn[aria-pressed="true"] { background: #fff; color: #000; }

/* Viseur : 4 coins dont la couleur suit le mode (vert = entrée, ambre = sortie) */
.viewfinder {
  position: relative; z-index: 1; margin: auto; width: min(78vw, 340px); aspect-ratio: 16 / 10;
  --c: var(--leaf);
}
.scan.out .viewfinder { --c: var(--amber); }
.viewfinder i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--c); }
.viewfinder i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.viewfinder i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.viewfinder i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.viewfinder::after {
  content: ""; position: absolute; left: 10%; right: 10%; top: 50%; height: 2px;
  background: var(--c); box-shadow: 0 0 12px var(--c); opacity: .85;
  animation: sweep 1.8s ease-in-out infinite alternate;
}
.viewfinder.busy::after { animation-play-state: paused; opacity: .3; }
@keyframes sweep { from { translate: 0 -38px; } to { translate: 0 38px; } }
@media (prefers-reduced-motion: reduce) { .viewfinder::after { animation: none; } }

.scan-hint { position: relative; z-index: 2; text-align: center; font-weight: 600; text-shadow: 0 1px 8px rgba(0,0,0,.85), 0 0 2px rgba(0,0,0,.6); margin: 8px 16px 0; }
.scan-bottom {
  position: relative; z-index: 2; display: grid; gap: 6px;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 14px); /* au-dessus de la barre d'onglets */
}
.scan-bottom .link-btn { text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.scan-bottom form { display: flex; gap: 8px; }
.scan-bottom .input { background: rgba(255,255,255,.14); border: 0; color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.scan-bottom .input::placeholder { color: rgba(255,255,255,.7); }
.scan-bottom .btn.small { min-height: 48px; }
.scan-bottom .link-btn { color: #fff; text-align: center; }
.scan-error { position: relative; z-index: 2; margin: auto 24px; text-align: center; background: rgba(255,255,255,.1); padding: 20px; border-radius: var(--radius); line-height: 1.5; }
.scan-error h2 { margin: 0 0 8px; font-size: 19px; }

/* Mode photo (adresse http) : gros déclencheur au centre de l'écran */
.photo-scan { position: relative; z-index: 2; margin: auto 24px; display: grid; justify-items: center; gap: 6px; text-align: center; }
.photo-shutter {
  width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--leaf); color: #fff; box-shadow: 0 0 0 10px rgba(255,255,255,.12); margin-bottom: 14px;
}
.scan.out .photo-shutter { background: var(--amber); }
.photo-shutter svg { width: 54px; height: 54px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.photo-scan.busy .photo-shutter { opacity: .45; pointer-events: none; }
.photo-status { font-weight: 650; font-size: 17px; margin: 0; }
.photo-hint { color: rgba(255,255,255,.72); margin: 0; max-width: 300px; font-size: 15px; }

/* --- Fenêtre du bas (bottom sheet) --------------------------------------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 640px; margin: 0 auto; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(var(--safe-bottom) + 18px);
  animation: rise .28s cubic-bezier(.2,.9,.3,1);
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 21px; margin: 0 0 14px; letter-spacing: -0.01em; }
@keyframes rise { from { translate: 0 100%; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { animation: none; } }

/* En-tête produit dans la fenêtre de scan */
.ph { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.ph .thumb { width: 84px; height: 84px; border-radius: 16px; }
.ph-name { font-size: 19px; font-weight: 700; line-height: 1.25; }
.ph-sub { color: var(--muted); font-size: 15px; }
.ph-stock { font-size: 14px; margin-top: 4px; }

/* Badges Nutri-Score / NOVA (simple rappel d'info, pas le logo officiel) */
.badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg); padding: 3px 8px 3px 3px; border-radius: 999px; }
.badge b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 12px; text-transform: uppercase; }
.ns-a { background: #038141; } .ns-b { background: #85bb2f; } .ns-c { background: #e5b700; } .ns-d { background: #ee8100; } .ns-e { background: #e63e11; }
.nova { background: var(--muted); }

/* --- Fiche produit -------------------------------------------------------- */
.product-hero { background: var(--surface); border-radius: var(--radius); padding: 18px; display: grid; justify-items: center; text-align: center; gap: 6px; }
.product-hero .photo { width: 100%; max-width: 200px; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 14px; }
.product-hero .photo.placeholder { display: grid; place-items: center; font-size: 80px; font-weight: 750; color: var(--leaf); background: var(--leaf-soft); }
.product-hero h1 { font-size: 24px; line-height: 1.2; margin: 8px 0 0; letter-spacing: -0.015em; }
.product-hero .sub { color: var(--muted); }
.family-pill { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.stock-big { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; }
.stock-big .n { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; }
.stock-big .n small { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.attribution { font-size: 12px; color: var(--muted); text-align: center; margin-top: 18px; }
.attribution a { color: inherit; text-decoration: underline; }

/* Historique */
.mv-in { color: var(--leaf); }
.mv-out { color: var(--amber); }
.mv-adjust { color: var(--muted); }
.day { font-size: 15px; font-weight: 650; color: var(--muted); margin: 22px 4px 8px; }

/* --- Écran de connexion ---------------------------------------------------- */
body.auth .tabbar { display: none; }
.auth-screen { max-width: 400px; margin: 8vh auto 0; }
.auth-logo { border-radius: 20px; margin-bottom: 8px; }
.auth-error { color: var(--tomato); font-weight: 600; min-height: 1.4em; margin: 0 0 10px; }

/* --- Barre d'onglets ------------------------------------------------------ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  display: flex; justify-content: space-around; align-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; padding: 6px 0; }
.tabbar a svg { width: 25px; height: 25px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--leaf); }
.tabbar .tab-scan { flex: 0 0 auto; width: 62px; height: 62px; border-radius: 50%; background: var(--leaf); color: #fff; place-items: center; margin-top: -26px; box-shadow: 0 6px 18px color-mix(in srgb, var(--leaf) 45%, transparent); }
.tabbar .tab-scan svg { width: 30px; height: 30px; stroke-width: 2; }
.tabbar .tab-scan.active { color: #fff; }

/* Pendant le scan : barre d'onglets en verre fumé au-dessus de la caméra */
body.scanning .tabbar { background: rgba(0,0,0,.28); border-top-color: transparent; }
body.scanning .tabbar a { color: rgba(255,255,255,.82); }
body.scanning .tabbar a.active { color: #fff; }

/* Barre d'état iPhone (heure, batterie) : l'appli dessine sous elle
   (mode "black-translucent"). Sur les écrans normaux on y met une bande verte
   pour que l'heure, écrite en blanc, reste lisible ; pendant le scan on la
   retire pour que la caméra remplisse tout l'écran. */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--safe-top);
  background: var(--leaf); z-index: 35; pointer-events: none;
}
body.scanning::before { display: none; }

/* --- Toast ---------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-top) + 12px); z-index: 60;
  translate: -50% -20px; opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 14px;
  font-weight: 600; font-size: 15px; max-width: calc(100vw - 32px); width: max-content;
  transition: opacity .2s, translate .2s;
}
body.scanning .toast { top: calc(var(--safe-top) + 120px); }
.toast.show { opacity: 1; translate: -50% 0; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast.error { background: var(--tomato); color: #fff; }

/* Petits utilitaires */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 16px; }
.stack > * + * { margin-top: 12px; }
.photo-pick {
  width: 120px; height: 120px; border-radius: 18px; border: 2px dashed var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--muted); font-size: 14px; cursor: pointer; overflow: hidden; margin: 0 auto 16px; text-align: center;
}
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--leaf); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { rotate: 360deg; } }

@media (min-width: 700px) {
  .view { padding-top: 32px; }
}

/* Choix de l'icône d'un emplacement (Réglages) */
.loc-head { display: flex; gap: 12px; align-items: flex-end; }
.loc-head .field { flex: 1; }
.emoji-preview {
  width: 56px; height: 56px; flex-shrink: 0; margin-bottom: 14px; border-radius: 14px;
  background: var(--bg); display: grid; place-items: center; font-size: 32px;
}
.chips.emoji-tabs { margin-bottom: 10px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; min-height: 150px; align-content: start; }
.emoji-btn {
  height: 46px; border-radius: 12px; border: 0; background: var(--bg); font-size: 24px; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.emoji-btn[aria-pressed="true"] { background: var(--leaf-soft); box-shadow: inset 0 0 0 2px var(--leaf); }
.emoji-input { font-size: 22px; }
