/* Stories : « + » à côté des favoris ; panneau qui descend au milieu de la page sur fond flou ; visionneur et éditeur plein écran */
.stbtn{position:relative;flex:none;width:40px;height:40px;border:0;background:transparent;padding:0;cursor:pointer;display:grid;place-items:center;border-radius:50%;color:var(--ink,#1b1640)}
.stbtn:focus-visible{outline:3px solid color-mix(in srgb,var(--mc,#5b3df5) 55%,transparent);outline-offset:2px}
.stb-ic{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,var(--v,#5b3df5),var(--p,#d6457a));box-shadow:0 6px 14px -6px color-mix(in srgb,var(--v,#5b3df5) 70%,transparent);transition:transform .25s ease,box-shadow .25s ease}
.stb-ic svg{width:19px;height:19px;fill:none;stroke:#fff;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}
.stbtn:hover .stb-ic,.stbtn:focus-visible .stb-ic{transform:scale(1.07)}
@media (prefers-reduced-motion:reduce){.stb-ic{transition:none}}
.stbtn.has::after{content:"";position:absolute;top:6px;right:6px;width:9px;height:9px;border-radius:50%;background:#e5484d;box-shadow:0 0 0 2px var(--card,#fff)}

/* ---- visionneur : la photo remplit l'écran ---- */
.stv{position:fixed;inset:0;z-index:600;background:#0b0716;color:#fff;overflow:hidden;touch-action:manipulation;user-select:none}
.stv-stage{position:absolute;inset:0;z-index:1;overflow:hidden}
.stv-m{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.stv-stage .stlay{position:absolute;inset:0}
.stv-t{position:absolute;margin:0;transform:translate(-50%,-50%);width:max-content;max-width:80%;padding:0;text-align:center;font-weight:700;font-size:clamp(26px,6vw,40px);line-height:1.2;text-shadow:0 2px 14px rgba(0,0,0,.6);white-space:pre-wrap;overflow-wrap:anywhere;z-index:2}
.stv-bars{position:absolute;top:10px;left:12px;right:12px;display:flex;gap:4px;z-index:3}
.stv-bars i{flex:1;height:3px;border-radius:3px;background:rgba(255,255,255,.3);overflow:hidden}
.stv-bars b{display:block;height:100%;width:0;background:#fff}
.stv-hd{position:absolute;top:22px;left:12px;right:12px;display:flex;align-items:center;justify-content:space-between;z-index:3}
.stv-who{display:flex;align-items:center;gap:10px;font:600 14px/1.2 'DM Sans',system-ui,sans-serif;min-width:0;text-shadow:0 1px 8px rgba(0,0,0,.5)}
.stv-who>*:first-child{width:36px;height:36px;flex:none}
.stv-who>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stv-x{border:0;background:rgba(0,0,0,.35);color:#fff;width:36px;height:36px;border-radius:50%;font-size:22px;line-height:1;cursor:pointer;flex:none}
.stv-z{position:absolute;top:70px;bottom:50px;width:34%;border:0;background:transparent;cursor:pointer;z-index:2}
.stv-z.l{left:0}.stv-z.r{right:0}
.stv-del{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:4;border:0;border-radius:999px;background:rgba(0,0,0,.45);color:#fff;padding:9px 16px;font:600 13px/1 'DM Sans',system-ui,sans-serif;cursor:pointer}
.stv-bars .run{animation:none}

/* ---- éditeur : photo plein écran, texte sur la photo, outils à droite ---- */
.stedit{position:fixed;inset:0;z-index:650;background:#0b0716;color:#fff;overflow:hidden}
.stedit-top{position:absolute;top:0;left:0;right:0;display:flex;align-items:center;gap:12px;padding:14px 14px 34px;z-index:4;background:linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,0))}
.stedit-top b{flex:1;text-align:center;font:700 16px/1 'DM Sans',system-ui,sans-serif;text-shadow:0 1px 8px rgba(0,0,0,.5)}
.st-x2{border:0;background:rgba(0,0,0,.35);color:#fff;width:36px;height:36px;border-radius:50%;font-size:22px;line-height:1;cursor:pointer}
.stedit-go{border:0;border-radius:999px;background:linear-gradient(100deg,#7c5cff,#e5488d);color:#fff;padding:9px 18px;font:700 14px/1 'DM Sans',system-ui,sans-serif;cursor:pointer}
.stedit-go:disabled{opacity:.45;cursor:default}
.stedit-stage{position:absolute;inset:0;overflow:hidden;display:grid;place-items:center}
.stedit-empty{text-align:center;padding:20px;font:500 15px/1.5 'DM Sans',system-ui,sans-serif;color:rgba(255,255,255,.8)}
.stedit-pick{margin-top:12px;border:0;border-radius:999px;background:#fff;color:#1b1640;padding:12px 20px;font:700 15px/1 'DM Sans',system-ui,sans-serif;cursor:pointer}
.stedit-m{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover}
.stedit-cell{display:grid;place-items:center;width:100%;height:100%;min-width:0;min-height:0;border:0;margin:0;background:rgba(255,255,255,.07);color:rgba(255,255,255,.85);font:300 44px/1 'DM Sans',system-ui,sans-serif;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(255,255,255,.2)}
.stedit-cell:focus-visible{outline:3px solid rgba(255,255,255,.7);outline-offset:-4px}
/* modèles à plusieurs cases : une grille plein écran, séparée par un trait sombre (éditeur et visionneur) */
.stlay{position:absolute;inset:0;display:grid;gap:4px;background:#0b0716;overflow:hidden}
.stlay>img,.stlay>video{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;margin:0}
.stlay.duo{grid-template-columns:1fr 1fr}
.stlay.pile{grid-template-rows:1fr 1fr}
.stlay.trio{grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr}
.stlay.trio>:first-child{grid-row:span 2}
.stlay.quatre{grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr}
.stedit-lay{display:flex;flex-direction:column;align-items:center;gap:6px;width:58px;border:0;background:none;color:#fff;cursor:pointer;font:600 10.5px/1.15 'DM Sans',system-ui,sans-serif;padding:0;text-align:center}
.stedit-lay .ico{display:grid;place-items:center;width:52px;height:52px;border-radius:14px;background:rgba(255,255,255,.14)}
.stedit-lay.on .ico{background:#fff;color:#1b1640}
.stedit-lay small{opacity:.9}
.stedit-chip{align-self:center;border:0;border-radius:999px;background:rgba(255,255,255,.14);color:#fff;padding:9px 16px;font:600 12px/1 'DM Sans',system-ui,sans-serif;cursor:pointer}
.stedit-chip.on{background:#fff;color:#1b1640}
/* texte sur bulle : un fond sombre et doux derrière le texte */
.stv-t.pill,.stedit-t.pill{background:rgba(0,0,0,.45);border-radius:14px;padding:6px 14px;text-shadow:none;box-shadow:0 8px 24px rgba(0,0,0,.25)}
.stedit-t{position:absolute;margin:0;transform:translate(-50%,-50%);width:max-content;max-width:80%;padding:6px 10px;border-radius:12px;text-align:center;font-weight:700;font-size:clamp(26px,6vw,40px);line-height:1.2;text-shadow:0 2px 14px rgba(0,0,0,.6);white-space:pre-wrap;overflow-wrap:anywhere;z-index:2;cursor:grab;touch-action:none;user-select:none;outline:none}
.stedit-t[hidden]{display:none}
.stedit-t[contenteditable="true"]{cursor:text;user-select:text;background:rgba(0,0,0,.3);box-shadow:0 0 0 2px rgba(255,255,255,.75)}
.stedit-t[contenteditable="true"]:empty::before{content:attr(data-ph);opacity:.6}
.stedit-side{position:absolute;right:12px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:12px;z-index:5}
.stedit-side[hidden]{display:none}
.stedit-ico{width:46px;height:46px;border:0;border-radius:50%;background:rgba(20,12,40,.55);color:#fff;display:grid;place-items:center;cursor:pointer;font:700 17px/1 'DM Sans',system-ui,sans-serif;padding:0;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.stedit-ico.on{background:#fff;color:#1b1640}
.stedit-pop{position:absolute;left:50%;bottom:22px;transform:translateX(-50%);width:min(420px,calc(100% - 24px));box-sizing:border-box;display:none;flex-direction:column;align-items:center;gap:12px;padding:14px;border-radius:18px;background:rgba(20,12,40,.8);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:0 10px 30px rgba(0,0,0,.35);z-index:6}
.stedit-pop.open{display:flex}
.stedit-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:center}
.stedit-font{width:40px;height:40px;border:0;border-radius:10px;background:rgba(255,255,255,.14);color:#fff;font-size:19px;line-height:1;cursor:pointer;padding:0;flex:none}
.stedit-font.on{background:#fff;color:#1b1640}
.stedit-col{width:26px;height:26px;border-radius:50%;border:2px solid rgba(255,255,255,.45);cursor:pointer;padding:0;flex:none}
.stedit-col.on{border:3px solid #fff;box-shadow:0 0 0 2px rgba(0,0,0,.6) inset}
.stedit-filters{display:flex;flex-wrap:wrap;justify-content:center;gap:10px 8px}
.stedit-filt{width:58px;display:flex;flex-direction:column;align-items:center;gap:4px;border:0;background:none;color:#fff;cursor:pointer;font:600 10px/1 'DM Sans',system-ui,sans-serif;padding:0}
.stedit-thumb{display:block;width:50px;height:50px;border-radius:10px;background:rgba(255,255,255,.16) center/cover no-repeat;box-shadow:0 0 0 2px transparent}
.stedit-filt.on .stedit-thumb{box-shadow:0 0 0 2px rgba(20,12,40,.9),0 0 0 4px #fff}
.stedit-filt small{opacity:.85}
.stedit-top button:focus-visible,.stedit-side button:focus-visible,.stv button:focus-visible,.stsheet button:focus-visible{outline:3px solid rgba(255,255,255,.7);outline-offset:2px}

/* ---- panneau des stories : fond flou teint aux couleurs du site ; à gauche mon profil et les boutons, à droite les contacts qui se chevauchent à l'horizontale ---- */
html.st-lock,html.st-lock body{overflow:hidden;overscroll-behavior:none}
.stpanel{position:fixed;inset:0;z-index:400;background:linear-gradient(135deg,rgba(91,61,245,.5),rgba(229,72,141,.42));backdrop-filter:blur(14px) saturate(1.05);-webkit-backdrop-filter:blur(14px) saturate(1.05);animation:stfade .35s ease both}
.stpanel.closing{animation:stfadeout .6s ease .3s forwards}
.stsheet{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:20px;max-width:calc(100vw - 24px);box-sizing:border-box}
.st-line{display:flex;align-items:center;gap:14px;min-width:0}
.st-ctrl{display:flex;flex-direction:column;gap:10px}
.st-row{display:flex;align-items:center;min-width:0;max-width:min(62vw,560px);overflow-x:auto;overflow-y:hidden;padding:18px 18px 48px 6px;margin:-18px -18px -48px -6px;scrollbar-width:none}
.st-row::-webkit-scrollbar{display:none}
.st-row .st-item{margin-left:-18px}
.st-row .st-item:first-child{margin-left:0}
.st-item{position:relative;flex:none;display:flex;align-items:center;animation:stfall .85s cubic-bezier(.2,.95,.3,1.06) both;animation-delay:calc(var(--i,0) * 110ms)}
.st-item.out{animation:stlift .55s cubic-bezier(.5,0,.75,0) both;animation-delay:calc(var(--j,0) * 70ms)}
.st-item:hover,.st-item:focus-within{z-index:20}
.st-c{position:relative;display:block;border:0;background:none;padding:0;cursor:pointer;color:#fff;font:600 12px/1.2 'DM Sans',system-ui,sans-serif;transition:transform .25s cubic-bezier(.2,.9,.25,1)}
.st-c:hover,.st-c:focus-visible{transform:scale(1.14)}
.st-c:focus-visible{outline:3px solid rgba(255,255,255,.75);outline-offset:4px;border-radius:50%}
.st-av{position:relative;display:grid;place-items:center;width:62px;height:62px;border-radius:50%;padding:3px;background:#cfcadf;box-shadow:0 8px 20px rgba(20,8,60,.3)}
.st-av>*{width:100%;height:100%;border-radius:50%;box-shadow:0 0 0 2px #1b1338}
.st-c.new .st-av{background:linear-gradient(135deg,#f2b036,#e5484d,#a24bd6)}
.st-c.seen .st-av{background:#6d6684;filter:grayscale(.5)}
.st-c.mine .st-av{background:linear-gradient(135deg,#5b3df5,#e5488d)}
.st-c.seen.mine .st-av{background:linear-gradient(135deg,#8a80b8,#c08fb8)}
.st-lbl{position:absolute;left:50%;top:calc(100% + 8px);transform:translate(-50%,-4px);white-space:nowrap;max-width:150px;overflow:hidden;text-overflow:ellipsis;padding:5px 10px;border-radius:999px;background:rgba(20,12,40,.8);color:#fff;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
.st-c:hover .st-lbl,.st-c:focus-visible .st-lbl{opacity:1;transform:translate(-50%,0)}
.st-c.mine .st-lbl{opacity:1;transform:translate(-50%,0);background:none;padding:0;text-shadow:0 1px 10px rgba(0,0,0,.55)}
.st-x3{position:fixed;top:14px;right:14px;border:0;background:rgba(20,12,40,.5);color:#fff;width:38px;height:38px;border-radius:50%;font-size:22px;line-height:1;cursor:pointer;z-index:2}
.st-act{width:42px;height:42px;flex:none;border:0;border-radius:50%;background:rgba(20,12,40,.5);color:#fff;display:grid;place-items:center;cursor:pointer;padding:0;box-shadow:0 6px 16px rgba(20,8,60,.25);transition:transform .2s,background .2s}
.st-act:hover{transform:scale(1.08)}
.st-plus{background:linear-gradient(135deg,#5b3df5,#e5488d)}
.st-plus{font:400 26px/1 'DM Sans',system-ui,sans-serif;padding:0 0 3px;box-shadow:0 6px 18px rgba(229,72,141,.35)}
.st-act:focus-visible,.st-all:focus-visible{outline:3px solid rgba(255,255,255,.75);outline-offset:2px}
.st-all{border:0;border-radius:999px;background:rgba(20,12,40,.55);color:#fff;padding:10px 18px;font:600 13px/1 'DM Sans',system-ui,sans-serif;cursor:pointer}
@media (max-width:520px){.st-av{width:56px;height:56px}.st-row .st-item{margin-left:-16px}.st-line{gap:10px}.st-act{width:38px;height:38px}}
@keyframes stfade{from{opacity:0}to{opacity:1}}
@keyframes stfadeout{from{opacity:1}to{opacity:0}}
@keyframes stfall{from{opacity:0;transform:translateY(-100vh)}to{opacity:1;transform:none}}
@keyframes stlift{from{opacity:1;transform:none}to{opacity:0;transform:translateY(-100vh)}}
@media (prefers-reduced-motion:reduce){.stpanel,.st-item{animation:none}.stpanel.closing{animation:none;opacity:0}}

/* sur ordinateur : la story garde une taille de téléphone (8 pouces), centrée, le reste de la page reste visible derrière */
@media (min-width:761px) and (pointer:fine){.stv{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);width:min(390px,calc(100vw - 48px));height:min(760px,calc(100vh - 48px));border-radius:22px;box-shadow:0 0 0 100vmax rgba(10,6,22,.72),0 30px 80px rgba(0,0,0,.5)}}
/* ⋮ en haut : trois points qui s'affichent un par un puis disparaissent ; le menu s'ouvre au toucher */
.stv-more{width:36px;height:36px;border:0;padding:0;margin:0;background:none;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;flex:none;filter:drop-shadow(0 1px 3px rgba(0,0,0,.55))}
.stv-more i{width:4px;height:4px;border-radius:50%;background:#fff;opacity:0;animation:stdot 2.8s ease infinite both}
.stv-more i:nth-child(2){animation-delay:.25s}.stv-more i:nth-child(3){animation-delay:.5s}
@keyframes stdot{0%{opacity:0}12%{opacity:1}60%{opacity:1}100%{opacity:0}}
@media (prefers-reduced-motion:reduce){.stv-more i{animation:none;opacity:.9}}
.stv-menu{display:none;position:absolute;top:58px;right:12px;z-index:6;background:#fff;border-radius:12px;padding:6px;box-shadow:0 10px 30px rgba(0,0,0,.35)}.stv-menu.on{display:block}
.stv-menu .stv-del{position:static;transform:none;display:block;border:0;background:none;color:#c0392b;font:600 14px/1.2 'DM Sans',system-ui,sans-serif;padding:10px 14px;cursor:pointer;white-space:nowrap}

.stv-acts{display:flex;align-items:center;gap:6px;flex:none}

/* répondre à une story : une ligne en bas du visionneur ; la story s'arrête pendant qu'on écrit */
.stv-reply{position:absolute;left:12px;right:12px;bottom:14px;z-index:5;display:flex;align-items:center;gap:8px;margin:0}
.stv-rin{flex:1;min-width:0;height:44px;border-radius:999px;border:1px solid rgba(255,255,255,.4);background:rgba(12,8,24,.42);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);color:#fff;padding:0 16px;font:500 15px/1 'DM Sans',system-ui,sans-serif;user-select:text;-webkit-user-select:text;outline:none}
.stv-rin::placeholder{color:rgba(255,255,255,.78)}
.stv-rin:focus{border-color:#fff;background:rgba(12,8,24,.62)}
.stv-rsend{flex:none;width:44px;height:44px;border:0;border-radius:50%;display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,var(--v,#7c5cff),var(--p,#ff5d8f));cursor:pointer;transition:transform .2s ease,opacity .2s ease}
.stv-rsend:disabled{opacity:.45;cursor:default}
.stv-rsend:not(:disabled):hover{transform:scale(1.06)}
.stv-rin:focus-visible,.stv-rsend:focus-visible{outline:2px solid #fff;outline-offset:2px}

/* sur ordinateur, l'éditeur de story tient dans un cadre à la taille d'un téléphone, au centre de l'écran (sur téléphone : plein écran) */
@media (min-width:700px) and (pointer:fine){
  .stedit{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);width:min(390px,calc(100vw - 40px));height:min(760px,calc(100vh - 40px));border-radius:22px;overflow:hidden;box-shadow:0 0 0 100vmax rgba(8,5,18,.8),0 30px 80px rgba(0,0,0,.5)}
}

/* une seule photo : elle apparaît en entier dans le cadre (bandes noires si besoin), pas rognée */
.stlay.solo .stedit-m{object-fit:contain}

/* plusieurs textes : taille au curseur, fond coloré, sélection */
.stedit-stage,.stv-stage{container-type:inline-size}
.stedit-t.sel{box-shadow:0 0 0 2px rgba(255,255,255,.85)}
.stedit-t.bgc,.stv-t.bgc{padding:6px 12px;border-radius:12px;text-shadow:none}
.stedit-t[hidden]{display:none}
.stedit-hint{margin:0;font:500 13px/1.4 'DM Sans',system-ui,sans-serif;color:rgba(255,255,255,.85);text-align:center}
.stedit-hint[hidden],.stedit-acts[hidden],.stedit-sizerow[hidden]{display:none}
.stedit-sizerow{display:flex;align-items:center;gap:12px;width:100%;box-sizing:border-box;font:600 12px/1 'DM Sans',system-ui,sans-serif;color:#fff}
.stedit-size{flex:1;min-width:0;accent-color:#fff}
.stedit-acts{display:flex;gap:10px}
.stedit-act2{border:0;border-radius:999px;background:rgba(255,255,255,.16);color:#fff;padding:9px 16px;font:600 13px/1 'DM Sans',system-ui,sans-serif;cursor:pointer}
.stedit-act2.dng{background:rgba(229,72,141,.85)}
.stedit-bgnone{background:rgba(255,255,255,.14) linear-gradient(to top right,transparent calc(50% - 1.5px),#e5488d 50%,transparent calc(50% + 1.5px))}
.stedit-bgnone.on{box-shadow:0 0 0 2px #fff}
.stedit-phint{position:absolute;left:50%;top:96px;transform:translateX(-50%);z-index:6;margin:0;padding:8px 14px;border-radius:999px;background:rgba(0,0,0,.55);color:#fff;font:600 13px/1.3 'DM Sans',system-ui,sans-serif;white-space:nowrap;pointer-events:none;box-shadow:0 8px 24px rgba(0,0,0,.25)}
.stedit-phint[hidden]{display:none}
.stedit-stage.placing{cursor:crosshair}
