/* Storie della community: barra di cerchi, editor e visualizzatore a schermo intero (storie.js) */
.st-bar{display:flex;gap:14px;overflow-x:auto;scrollbar-width:none;padding:4px 2px 12px;margin:0 0 18px;-webkit-overflow-scrolling:touch}
.st-bar::-webkit-scrollbar{display:none}
.st-bar:empty{display:none}
.st-c{flex:none;width:72px;display:flex;flex-direction:column;align-items:center;gap:6px;background:none;border:0;padding:0;font:inherit;color:#172033;cursor:pointer;text-decoration:none}
.st-c small{font-size:12px;max-width:72px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.st-ring{position:relative;width:66px;height:66px;border-radius:50%;padding:3px;background:#d0d5dd}
.st-ring.new{background:conic-gradient(from 210deg,#6FFFE9,#5BC0BE,#1d3b8f,#d6457a,#ffb703,#6FFFE9)}
.st-av{width:100%;height:100%;border-radius:50%;border:3px solid #fff;background:#0B132B center/cover no-repeat;color:#6FFFE9;display:flex;align-items:center;justify-content:center;font-weight:900;font-size:24px;overflow:hidden}
.st-plus{position:absolute;right:-1px;bottom:-1px;width:24px;height:24px;border-radius:50%;background:#0B132B;color:#6FFFE9;border:2px solid #fff;display:flex;align-items:center;justify-content:center;font-size:17px;font-weight:900;line-height:1}
.st-add .st-ring{background:none;border:2px dashed #98a2b3}
.st-add .st-av{background:#effafa;color:#0B132B;border-color:transparent;font-size:30px}
.st-hint{align-self:center;font-size:13px;color:#667085;max-width:220px;line-height:1.3}

/* visualizzatore */
.st-view{position:fixed;inset:0;z-index:300;background:#000;color:#fff;display:flex;align-items:center;justify-content:center;touch-action:none;user-select:none;-webkit-user-select:none}
.st-stage{position:relative;width:100%;height:100%;max-width:520px;overflow:hidden;background:#000}
.st-img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;transition:opacity .2s}
.st-img.loading{opacity:0}
.st-top{position:absolute;left:0;right:0;top:0;padding:calc(10px + env(safe-area-inset-top)) 12px 28px;background:linear-gradient(rgba(0,0,0,.55),transparent);z-index:2}
.st-bars{display:flex;gap:4px}
.st-bars span{flex:1;height:3px;border-radius:3px;background:rgba(255,255,255,.35);overflow:hidden}
.st-bars i{display:block;height:100%;width:0;background:#fff}
.st-who{display:flex;align-items:center;gap:10px;margin-top:10px}
.st-who .st-av{width:34px;height:34px;border-width:0;font-size:15px;flex:none}
.st-who b{font-size:15px}.st-who time{font-size:13px;opacity:.75}
.st-btns{margin-left:auto;display:flex;gap:4px}
.st-btns button{background:none;border:0;color:#fff;font-size:24px;line-height:1;width:40px;height:40px;cursor:pointer;border-radius:50%}
.st-btns button:focus-visible{outline:2px solid #6FFFE9}
.st-text{position:absolute;left:16px;right:16px;bottom:calc(28px + env(safe-area-inset-bottom));z-index:2;text-align:center;font-size:18px;font-weight:700;line-height:1.35;padding:10px 14px;border-radius:14px;background:rgba(0,0,0,.45);overflow-wrap:anywhere}
.st-text:empty{display:none}
.st-paused{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:44px;opacity:0;transition:opacity .15s;z-index:2;pointer-events:none}
.st-view.paused .st-paused{opacity:.8}
.st-sheet{position:absolute;left:0;right:0;bottom:0;z-index:4;background:#fff;color:#172033;border-radius:20px 20px 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom));display:grid;gap:8px;animation:st-up .2s ease-out}
.st-sheet p{margin:0 0 4px;font-weight:800}
.st-sheet button{font:inherit;font-weight:700;padding:13px;border-radius:12px;border:1px solid #e3eaea;background:#f6fbfb;color:#172033;cursor:pointer;text-align:left}
.st-sheet button.danger{color:#b42318}
.st-sheet button.cancel{text-align:center;background:none;border:0;color:#667085}
.st-toast{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:5;background:rgba(0,0,0,.8);color:#fff;padding:12px 18px;border-radius:12px;font-weight:700;text-align:center;max-width:80%}
@keyframes st-up{from{transform:translateY(100%)}to{transform:none}}

/* nuova storia */
.st-new{position:fixed;inset:0;z-index:300;background:#000;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom))}
.st-new .st-prev{position:relative;flex:1;width:100%;max-width:520px;min-height:0;border-radius:16px;overflow:hidden;background:#111}
.st-new .st-prev img{width:100%;height:100%;object-fit:contain}
.st-new form{width:100%;max-width:520px;display:grid;gap:10px;margin-top:12px}
.st-new input[type=text]{font:inherit;font-size:16px;padding:13px 14px;border-radius:12px;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.08);color:#fff}
.st-new .row{display:flex;gap:10px}
.st-new .row button{flex:1;font:inherit;font-weight:800;padding:13px;border-radius:999px;border:0;cursor:pointer}
.st-new .pub{background:#6FFFE9;color:#0B132B}
.st-new .ann{background:rgba(255,255,255,.12);color:#fff}
.st-new .msg{color:#ffb3a7;font-size:14px;margin:0;min-height:1em}
.st-new .note{color:rgba(255,255,255,.6);font-size:12px;margin:0}

html[data-tema=scuro] .st-c{color:#e7ecf3}
html[data-tema=scuro] .st-av{border-color:#0b132b}
html[data-tema=scuro] .st-ring{background:#344054}
html[data-tema=scuro] .st-ring.new{background:conic-gradient(from 210deg,#6FFFE9,#5BC0BE,#1d3b8f,#d6457a,#ffb703,#6FFFE9)}
html[data-tema=scuro] .st-add .st-ring{background:none;border-color:#475467}
html[data-tema=scuro] .st-add .st-av{background:rgba(111,255,233,.09);color:#6FFFE9}
html[data-tema=scuro] .st-plus{border-color:#0b132b}
html[data-tema=scuro] .st-hint{color:#9aa7bd}
html[data-tema=scuro] .st-sheet{background:#172033;color:#e7ecf3}
html[data-tema=scuro] .st-sheet button{background:rgba(255,255,255,.05);border-color:rgba(111,255,233,.14);color:#e7ecf3}
@media(prefers-reduced-motion:reduce){.st-img{transition:none}.st-sheet{animation:none}}

/* visualizzazioni della mia storia: in basso, si aprono scorrendo in su */
.st-views{position:absolute;left:50%;bottom:calc(18px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:3;display:flex;flex-direction:column;align-items:center;gap:0;background:rgba(0,0,0,.45);color:#fff;border:0;border-radius:16px;padding:6px 16px 8px;font:inherit;font-size:14px;cursor:pointer;transition:transform .15s}
.st-views .st-up{font-size:16px;line-height:1;opacity:.8;animation:st-nudge 1.6s ease-in-out infinite}
@keyframes st-nudge{50%{transform:translateY(-4px)}}
.st-seen{max-height:70%;grid-template-rows:auto 1fr auto}
.st-seen-list{overflow:auto;display:grid;gap:4px;align-content:start}
.st-seen-row{display:flex;align-items:center;gap:10px;padding:6px 2px}
.st-seen-row img,.st-seen-av{width:36px;height:36px;border-radius:50%;object-fit:cover;flex:none}
.st-seen-av{display:grid;place-items:center;background:#0B132B;color:#6FFFE9;font-weight:800}
.st-seen-row time{margin-left:auto;font-size:13px;color:#667085}
@media(prefers-reduced-motion:reduce){.st-views .st-up{animation:none}}

/* reazioni rapide e risposta sulle storie degli altri */
.st-stage.has-bar .st-text{bottom:calc(118px + env(safe-area-inset-bottom))}
.st-react{position:absolute;left:0;right:0;bottom:0;z-index:3;padding:10px 12px calc(12px + env(safe-area-inset-bottom));background:linear-gradient(transparent,rgba(0,0,0,.6) 35%);display:grid;gap:8px}
.st-emo{display:flex;justify-content:center;gap:6px}
.st-emo button{font-size:26px;line-height:1;width:46px;height:46px;border-radius:50%;border:0;background:rgba(255,255,255,.12);cursor:pointer;transition:transform .12s}
.st-emo button[aria-pressed=true]{background:rgba(111,255,233,.35);box-shadow:0 0 0 2px #6FFFE9;transform:scale(1.08)}
.st-emo button:active{transform:scale(.9)}
.st-reply{display:flex;gap:8px}
.st-reply input{flex:1;min-width:0;font:inherit;font-size:16px;color:#fff;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.45);border-radius:999px;padding:11px 16px}
.st-reply input::placeholder{color:rgba(255,255,255,.75)}
.st-reply input:focus{outline:none;border-color:#6FFFE9;background:rgba(0,0,0,.5)}
.st-reply button{flex:none;width:46px;height:46px;border-radius:50%;border:0;background:#6FFFE9;color:#0B132B;font-size:18px;cursor:pointer}
.st-reply button:disabled{opacity:.6}
.st-fly{position:absolute;left:50%;bottom:150px;z-index:4;font-size:64px;pointer-events:none;animation:st-fly .9s ease-out forwards}
@keyframes st-fly{0%{transform:translate(-50%,0) scale(.6);opacity:0}25%{opacity:1;transform:translate(-50%,-30px) scale(1.15)}100%{transform:translate(-50%,-180px) scale(1);opacity:0}}
/* pannello dell'autore: reazione e risposte accanto a chi ha visto */
.st-seen-who{display:grid;gap:3px;min-width:0}
.st-seen-who q{display:block;font-size:14px;color:#344054;background:#f2f7f7;border-radius:12px;padding:6px 10px;quotes:none;overflow-wrap:anywhere}
.st-seen-r{font-size:22px;margin-left:auto}
.st-seen-r+time{margin-left:8px}
.st-seen-row{align-items:flex-start}
html[data-tema=scuro] .st-seen-who q{background:rgba(255,255,255,.06);color:#e7ecf3}
@media(prefers-reduced-motion:reduce){.st-emo button{transition:none}.st-fly{display:none}}
