/* CM MAPA — la DA de MAPA (README : noir #0B0B0C, graphite #1C1D1F, blanc cassé #E9E6DF, gris pierre #8A8A86,
   bleu-gris #6F8494 ; Unbounded pour les titres, Geist pour le texte, Geist Mono pour les étiquettes) et les Standards
   Atlas : rien ne zoome, un écran = une idée, une matière brillante jamais plate, la fiche monte du bas, jamais kitsch. */
:root {
  --noir: #0B0B0C; --graphite: #1C1D1F; --graphite-2: #26272A; --creme: #E9E6DF; --creme-2: #CFCBC3; --pierre: #8A8A86;
  --bleu: #6F8494; --bleu-clair: #93A8B8; --ok: #8FB39A; --alerte: #D8B46A; --danger: #D27C6E;
  --r: 18px; --r-s: 12px; --pill: 999px;
  --titre: 'Unbounded', system-ui, sans-serif; --texte: 'Geist', system-ui, -apple-system, sans-serif; --mono: 'Geist Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1); --ressort: cubic-bezier(.34, 1.56, .64, 1);
  --bas: env(safe-area-inset-bottom, 0px); --haut: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: var(--noir); }
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden; background: var(--noir); color: var(--creme);
  font: 400 16px/1.5 var(--texte); -webkit-font-smoothing: antialiased; touch-action: manipulation;
}
/* Les lignes d'empreinte du loup, très discrètes, en fond. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(111, 132, 148, .16), transparent 60%),
    repeating-radial-gradient(circle at 85% -10%, transparent 0 22px, rgba(233, 230, 223, .025) 22px 23px);
}
h1, h2, h3, p { margin: 0; }
h1 { font: 500 30px/1.1 var(--titre); letter-spacing: -.02em; }
h2 { font: 500 19px/1.2 var(--titre); letter-spacing: -.01em; }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea { font-size: 16px; }   /* 16 px : Safari ne zoome pas au toucher d'un champ */
button { cursor: pointer; }
img, video, canvas { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--bleu-clair); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.lab { font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--pierre); }
.lab b { color: var(--bleu-clair); font-weight: 500; }
.muted { color: var(--pierre); }
.petit { font-size: 14px; }

/* ───── En-tête ───── */
.tete { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--haut)) 18px 12px;
  background: linear-gradient(var(--noir) 60%, rgba(11, 11, 12, 0)); }
.tete__loup { width: 34px; height: 34px; }
.tete__titre { display: flex; align-items: baseline; gap: 8px; }
.tete__nom { height: 17px; width: auto; }
.tete__cm { font: 500 11px/1 var(--mono); letter-spacing: .24em; color: var(--bleu-clair); }
.tete__etat { margin-left: auto; font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 7px 10px; border-radius: var(--pill);
  background: rgba(216, 180, 106, .12); color: var(--alerte); }

.page { max-width: 640px; margin: 0 auto; padding: 6px 16px calc(110px + var(--bas)); display: flex; flex-direction: column; gap: 18px; outline: none; }
.intro { display: flex; flex-direction: column; gap: 8px; padding: 6px 2px 0; }
.intro p { color: var(--creme-2); }

/* ───── La matière : surfaces et boutons brillants (reflet immobile, arête lumineuse, léger relief, ombre douce) ───── */
.surface {
  position: relative; border-radius: var(--r); background: linear-gradient(180deg, #212225, #18191B);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 0 0 1px rgba(255, 255, 255, .04), 0 10px 30px rgba(0, 0, 0, .35);
}
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: var(--pill); font: 600 15px/1 var(--texte); color: var(--creme); text-decoration: none; overflow: hidden;
  background: linear-gradient(180deg, #2C2D31, #1E1F22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -1px 0 rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .06), 0 6px 16px rgba(0, 0, 0, .35);
  transition: transform .18s var(--ease), filter .18s;
}
.btn::after { content: ''; position: absolute; inset: 0 0 50% 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0)); }
.btn:active { transform: scale(.97); filter: brightness(1.1); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn--plein { color: #0B0B0C; background: linear-gradient(180deg, #F3F1EC, #D9D5CC);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(0, 0, 0, .12), 0 8px 22px rgba(0, 0, 0, .45); }
.btn--bleu { color: #0B0B0C; background: linear-gradient(180deg, #A9BCCA, #7E93A3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(0, 0, 0, .15), 0 8px 22px rgba(111, 132, 148, .28); }
.btn--fantome { background: transparent; box-shadow: inset 0 0 0 1px rgba(233, 230, 223, .16); }
.btn--fantome::after { display: none; }
.btn--danger { color: var(--danger); }
.btn--large { width: 100%; }
.btn--petit { min-height: 38px; padding: 0 14px; font-size: 13px; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rangee > .btn { flex: 1 1 0; }

/* Le gros bouton de dépôt */
.deposer {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 190px; padding: 28px;
  border-radius: 26px; text-align: center; cursor: pointer; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, rgba(111, 132, 148, .22), transparent 60%), linear-gradient(180deg, #202125, #151618);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 0 1px rgba(147, 168, 184, .18), 0 18px 40px rgba(0, 0, 0, .45);
  transition: transform .2s var(--ease);
}
.deposer:active { transform: scale(.985); }
.deposer svg { width: 44px; height: 44px; stroke: var(--bleu-clair); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.deposer strong { font: 500 20px/1.2 var(--titre); }
.deposer span { color: var(--pierre); font-size: 14px; }
.deposer input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vign { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-s); overflow: hidden; background: var(--graphite); border: 0; padding: 0; }
.vign img, .vign video { width: 100%; height: 100%; object-fit: cover; }
.vign__type { position: absolute; left: 6px; bottom: 6px; font: 500 10px/1 var(--mono); letter-spacing: .1em; padding: 5px 7px; border-radius: var(--pill); background: rgba(11, 11, 12, .7); }
.vign__note { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--bleu); color: var(--noir); font: 700 12px/22px var(--texte); text-align: center; }
.vign__x { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(11, 11, 12, .75); color: var(--creme); font-size: 15px; line-height: 28px; }
.vign__ph { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--pierre); font: 500 11px var(--mono); letter-spacing: .12em; }
.vign--progres::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p, 0%); background: var(--bleu-clair); transition: width .2s; }

.champ { display: flex; flex-direction: column; gap: 8px; }
.champ textarea, .champ input {
  width: 100%; border: 0; border-radius: var(--r-s); padding: 14px 16px; background: #141517; color: var(--creme); resize: vertical;
  box-shadow: inset 0 0 0 1px rgba(233, 230, 223, .1), inset 0 2px 6px rgba(0, 0, 0, .4); line-height: 1.5;
}
.champ textarea { min-height: 120px; }
.champ textarea:focus, .champ input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--bleu), inset 0 2px 6px rgba(0, 0, 0, .4); }
.champ small { color: var(--pierre); font-size: 13px; }

/* Dépôts récents */
.depot { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.depot__haut { display: flex; align-items: center; gap: 10px; }
.depot__mini { display: flex; gap: 4px; }
.depot__mini img, .depot__mini .mini-ph { width: 38px; height: 46px; object-fit: cover; border-radius: 7px; background: var(--graphite-2); }
.depot__note { color: var(--creme-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bref { font-size: 14px; color: var(--creme-2); padding-left: 10px; border-left: 2px solid var(--bleu); white-space: pre-line; }
.bref b { color: var(--creme); font-weight: 600; }
.puce { margin-left: auto; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 6px 9px; border-radius: var(--pill); background: rgba(233, 230, 223, .08); color: var(--creme-2); white-space: nowrap; }
.puce--ok { background: rgba(143, 179, 154, .14); color: var(--ok); }
.puce--attente { background: rgba(147, 168, 184, .14); color: var(--bleu-clair); }
.puce--err { background: rgba(210, 124, 110, .14); color: var(--danger); }
.puce--alerte { background: rgba(216, 180, 106, .14); color: var(--alerte); }
.tourne { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tourne .8s linear infinite; vertical-align: -2px; }
@keyframes tourne { to { transform: rotate(1turn); } }

/* ───── Propositions ───── */
.filtres { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.filtre { flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--pill); background: rgba(233, 230, 223, .06); color: var(--creme-2); font: 600 13px var(--texte);
  box-shadow: inset 0 0 0 1px rgba(233, 230, 223, .08); }
.filtre[aria-pressed='true'] { background: var(--creme); color: var(--noir); }
.carte { padding: 16px; display: flex; flex-direction: column; gap: 14px; animation: entre .45s var(--ease) both; }
@keyframes entre { from { opacity: 0; transform: translateY(12px); } }
.carte__haut { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 6px 9px; border-radius: var(--pill); background: rgba(233, 230, 223, .08); }
.tag--x { background: var(--creme); color: var(--noir); }
.tag--insta { background: linear-gradient(180deg, #A9BCCA, #7E93A3); color: var(--noir); }
.carte__titre { font: 500 17px/1.25 var(--titre); }
.carte__v { margin-left: auto; color: var(--pierre); font: 500 10px var(--mono); }

/* Aperçu X */
.tweet { padding: 14px; border-radius: 16px; background: #000; box-shadow: inset 0 0 0 1px #2F3336; display: flex; gap: 10px; }
.tweet + .tweet { margin-top: -6px; }
.tweet__av { width: 38px; height: 38px; border-radius: 50%; background: #0B0B0C url('/brand/loup.svg') center / 80% no-repeat; flex: none; box-shadow: inset 0 0 0 1px #2F3336; }
.tweet__corps { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.tweet__qui { font-size: 14px; } .tweet__qui b { font-weight: 700; } .tweet__qui span { color: #71767B; }
.tweet__texte { white-space: pre-wrap; word-wrap: break-word; font-size: 15px; line-height: 1.42; color: #E7E9EA; }
.tweet__medias { display: grid; gap: 2px; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px #2F3336; }
.tweet__medias.n2, .tweet__medias.n3, .tweet__medias.n4 { grid-template-columns: 1fr 1fr; }
.tweet__medias img, .tweet__medias video { width: 100%; height: 100%; max-height: 420px; object-fit: cover; }
.compte { font: 500 11px var(--mono); color: #71767B; text-align: right; }
.compte--trop { color: var(--danger); }

/* Aperçu Insta : carrousel, post, story, reel */
.defile { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.defile::-webkit-scrollbar { display: none; }
.ecran { flex: none; width: 78%; scroll-snap-align: center; display: flex; flex-direction: column; gap: 8px; }
.ecran canvas, .ecran video, .ecran img { width: 100%; border-radius: 14px; background: var(--graphite); }
.ecran--story { width: 58%; }
.ecran__taper { font-size: 14px; padding: 10px 12px; border-radius: var(--r-s); background: rgba(147, 168, 184, .1); color: var(--creme); white-space: pre-wrap; }
.ecran__taper i { display: block; font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; font-style: normal; color: var(--bleu-clair); margin-bottom: 6px; }
.ecran__coupe { font: 500 11px var(--mono); color: var(--bleu-clair); }
.legende { white-space: pre-wrap; font-size: 15px; color: var(--creme-2); }
.legende b { color: var(--creme); }

.avalider { padding: 12px 14px; border-radius: var(--r-s); background: rgba(216, 180, 106, .08); box-shadow: inset 0 0 0 1px rgba(216, 180, 106, .2); font-size: 14px; }
.avalider ul { margin: 6px 0 0; padding-left: 18px; color: var(--creme-2); }
.pourquoi { font-size: 14px; color: var(--creme-2); }
details.plus { font-size: 13px; color: var(--pierre); }
details.plus summary { cursor: pointer; list-style: none; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
details.plus summary::-webkit-details-marker { display: none; }
details.plus p { margin-top: 8px; white-space: pre-wrap; }

.vide { text-align: center; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--pierre); }
.vide img { width: 74px; opacity: .5; }

/* ───── Barre d'onglets en bas ───── */
.onglets {
  position: fixed; left: 50%; bottom: calc(12px + var(--bas)); transform: translateX(-50%); z-index: 30; display: flex; gap: 4px; padding: 6px;
  border-radius: 26px; width: min(420px, calc(100% - 28px));
  background: linear-gradient(180deg, rgba(38, 39, 42, .82), rgba(24, 25, 27, .86)); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 1px rgba(255, 255, 255, .06), 0 14px 34px rgba(0, 0, 0, .5);
}
.onglet { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 8px; border-radius: 20px;
  color: var(--pierre); text-decoration: none; font: 600 11px/1 var(--texte); transition: color .2s, background .2s; }
.onglet svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ressort); }
.onglet[aria-current='page'] { color: var(--creme); background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.onglet[aria-current='page'] svg { transform: translateY(-1px) scale(1.06); stroke: var(--bleu-clair); }
.pastille { position: absolute; top: 4px; right: calc(50% - 26px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bleu); color: var(--noir); font: 700 10px/18px var(--texte); text-align: center; }

/* ───── La feuille qui monte du bas ───── */
.voile { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); animation: fondu .25s both; }
@keyframes fondu { from { opacity: 0; } }
.feuille {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 auto; max-width: 640px; padding: 8px 18px calc(22px + var(--bas)); border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #232427, #18191B); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 -18px 50px rgba(0, 0, 0, .5);
  animation: monte .38s var(--ease) both; display: flex; flex-direction: column;
}
@keyframes monte { from { transform: translateY(100%); } }
.feuille__poignee { width: 40px; height: 5px; border-radius: 3px; background: rgba(233, 230, 223, .2); margin: 4px auto 14px; flex: none; }
#feuille-corps { display: flex; flex-direction: column; gap: 14px; }
.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.ecran-edit { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: start; }
.ecran-edit img { width: 84px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; }
.ecran-edit .champ textarea { min-height: 84px; }
.mini-choix { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-choix .filtre { min-height: 30px; font-size: 12px; padding: 0 10px; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--bas)); transform: translateX(-50%); z-index: 60; padding: 12px 18px; border-radius: var(--pill);
  background: var(--creme); color: var(--noir); font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: entre .3s var(--ease) both; max-width: calc(100% - 32px); text-align: center; }
.toast--err { background: var(--danger); color: #fff; }
.confettis { position: fixed; inset: 0; z-index: 70; pointer-events: none; width: 100%; height: 100%; }

.connexion { margin-top: 12vh; padding: 24px; display: flex; flex-direction: column; gap: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
