/* Ripetute: social (profili, post, follower), come Instagram.
   Solo i colori del tema (chiaro e scuro). Prefisso so-: le classi s-<sport> sono già i colori degli sport. */

/* ---------- pagine del social: intestazione ferma in alto mentre si scorre ---------- */
.so-page .sh-head { position: sticky; top: 0; z-index: 4; }
.so-page .sh-top h2 { min-width: 0; }
.so-hacts { display: flex; align-items: center; gap: 2px; margin: -4px -6px -4px auto; }
.so-hacts + .sh-close, .so-pubbtn + .sh-close { margin-left: 6px; }
.so-hbtn { position: relative; width: 40px; height: 40px; color: var(--ink); }
.so-hbtn svg { width: 24px; height: 24px; }
.so-hbtn[aria-expanded="true"] { color: var(--accent); }
.so-cnt {
  position: absolute; top: 2px; right: 0; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px var(--surface);
  font: 700 10.5px/1 var(--f-body); font-variant-numeric: tabular-nums;
}
.so-sub { color: var(--muted); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ricerca sotto l'intestazione */
.so-search { display: flex; align-items: center; gap: 6px; }
.so-search input {
  flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 15px;
}
.so-search input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
.so-results { max-width: 560px; margin: 8px auto 0; }
.so-results > .so-h:first-child { margin-top: 14px; }
.so-results > .loading { padding: 12px 0; }

/* ---------- avatar, nomi ---------- */
.so-av {
  position: relative; flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%;
  background: color-mix(in srgb, var(--av, var(--accent)) 20%, var(--surface));
  color: color-mix(in srgb, var(--av, var(--accent)) 78%, var(--ink));
  font-family: var(--f-display); font-weight: 700; line-height: 1;
}
.so-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.so-av img:not([src]) { visibility: hidden; }
.so-nm { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.so-nmb { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- home ---------- */
/* home e pagina del post: le schede stanno su un fondo appena diverso, così si vedono come carte */
#socialDlg, #spostDlg { background: var(--bg); }
.so-feed { display: flex; flex-direction: column; gap: 12px; max-width: 540px; margin: 12px auto 0; }
.so-morebox { display: flex; justify-content: center; padding: 14px 0 6px; }
.so-morebox:empty { padding: 0; }
.so-reqrow {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 540px; margin: 12px auto 0; padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.so-reqrow b { flex: 1 1 auto; min-width: 0; font-size: 14.5px; font-weight: 600; }
.so-reqic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); }
.so-reqic svg { width: 19px; height: 19px; }
.so-reqch { flex: none; color: var(--muted); }
.so-reqch svg { width: 18px; height: 18px; }
.so-prof .so-reqrow { margin-top: 12px; }
.so-state { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 420px; margin: 36px auto; text-align: center; color: var(--muted); line-height: 1.5; }
.so-state p { margin: 0; }
.so-state .loading { padding: 0; }
.so-empty { padding: 4px 0 8px; }
.so-empty-t { margin: 32px auto 4px; max-width: 30ch; text-align: center; color: var(--muted); line-height: 1.5; }
.so-h { margin: 20px 0 6px; font: 600 13px/1 var(--f-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.so-none { margin: 0; padding: 28px 0; text-align: center; color: var(--muted); }
.so-none.so-left { padding: 2px 0; text-align: left; font-size: 13px; }

/* ---------- scheda del post: una carta vera (bordo, angoli tondi), anche sul telefono ----------
   foto e video vanno da bordo a bordo dentro la carta: stanno sempre tra l'intestazione e le azioni, quindi niente angoli da arrotondare */
.so-post {
  min-width: 0; padding-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent);
}
.so-ph { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 6px 10px 12px; }
.so-who { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.so-whot { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.so-whot .so-nm { font-size: 14.5px; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
.so-when { color: var(--muted); font-size: 12.5px; line-height: 1.2; white-space: nowrap; }
.so-more { flex: none; width: 40px; height: 40px; margin-left: auto; border-radius: 50%; color: var(--ink); }
.so-more svg { width: 22px; height: 22px; }
.so-more[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 8%, transparent); }

/* menu «⋯»: piccolo riquadro sotto il tasto */
.so-pop {
  position: absolute; top: calc(100% - 8px); right: 8px; z-index: 3; display: flex; flex-direction: column; gap: 2px;
  min-width: 210px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
  transform-origin: top right; animation: so-pop-in .14s ease-out;
}
@keyframes so-pop-in { from { opacity: 0; scale: .94; } }
.so-pop button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer;
}
.so-pop button svg { flex: none; width: 20px; height: 20px; }
.so-pop button:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.so-pop button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.so-pop .is-danger { color: var(--missed); }
.so-pop button.is-armed { justify-content: center; background: color-mix(in srgb, var(--missed) 14%, transparent); color: var(--missed); }
.so-pop button:disabled { opacity: .6; cursor: default; }

/* foto e video: proporzioni del primo (aspect-ratio nel codice), carosello che scorre solo dentro il riquadro */
.so-media { position: relative; overflow: hidden; background: var(--surface-2); -webkit-user-select: none; user-select: none; }
.so-track {
  display: flex; height: 100%; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
.so-track::-webkit-scrollbar { display: none; }
.so-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.so-slide img, .so-slide video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.so-slide img { -webkit-user-drag: none; }
.so-count {
  position: absolute; top: 10px; right: 10px; padding: 3px 8px; border-radius: 99px; pointer-events: none;
  background: color-mix(in srgb, var(--ink) 72%, transparent); color: var(--bg); font-size: 12px; font-weight: 600;
}
.so-nav {
  position: absolute; top: 50%; translate: 0 -50%; display: none; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
}
.so-nav svg { width: 18px; height: 18px; }
.so-nav.is-prev { left: 8px; }
.so-nav.is-next { right: 8px; }
@media (hover: hover) and (pointer: fine) {
  .so-media:hover .so-nav:not(:disabled) { display: grid; }
}
/* video: partono da soli senza audio (social-core.js). Play al centro solo da fermi (toccati, risparmio dati);
   altoparlante in basso a destra (44 px da toccare, cerchio piccolo) */
.so-vid { position: relative; }
.so-vplay {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: grid; place-items: center; width: 64px; height: 64px; padding: 0 0 0 4px;
  border: 0; border-radius: 50%; background: color-mix(in srgb, var(--ink) 55%, transparent); color: var(--bg); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.so-vplay svg { width: 30px; height: 30px; }
.so-vid.is-tap .so-vplay { opacity: 1; pointer-events: auto; }
.so-vplay:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
.so-snd { position: absolute; right: 2px; bottom: 2px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--bg); cursor: pointer; }
.so-snd > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 60%, transparent); }
.so-snd i { display: grid; }
.so-snd svg { width: 17px; height: 17px; }
.so-snd .i-on, .so-vid.is-snd .so-snd .i-off { display: none; }
.so-vid.is-snd .so-snd .i-on { display: grid; }
.so-snd:focus-visible { outline: none; }
.so-snd:focus-visible > span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* cuore del doppio tocco */
.so-burst { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; translate: -50% -50%; color: var(--missed); opacity: 0; pointer-events: none; }
.so-burst svg { width: 100%; height: 100%; fill: currentColor; stroke: none; filter: drop-shadow(0 2px 10px rgb(0 0 0 / .3)); }
.so-media.is-burst .so-burst { animation: so-burst .85s ease-out; }
@keyframes so-burst {
  0% { opacity: 0; scale: .3; }
  15% { opacity: .95; scale: 1.12; }
  30% { scale: .94; }
  70% { opacity: .95; scale: 1; }
  100% { opacity: 0; scale: .9; }
}

/* Mi piace, Commenta, Condividi (44 px da toccare); i puntini del carosello al centro */
.so-acts { position: relative; display: flex; align-items: center; min-height: 50px; padding: 3px 4px 0; }
.so-act { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.so-act svg { width: 25px; height: 25px; }
.so-act:active { scale: .9; }
.so-like[aria-pressed="true"] { color: var(--missed); }
.so-like[aria-pressed="true"] svg { fill: currentColor; }
.so-like.is-pop svg { animation: so-pop .35s ease-out; }
@keyframes so-pop { 40% { scale: 1.25; } }
.so-dots { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: flex; gap: 4px; pointer-events: none; }
.so-dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 22%, transparent); transition: background .15s; }
.so-dots i.is-on { background: var(--accent); }

/* «N Mi piace»: apre l'elenco di chi l'ha messo */
.so-likes {
  display: block; min-height: 30px; margin: 0; padding: 0 14px; border: 0; background: none; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer;
}
.so-likes[hidden] { display: none; }
.so-likes:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
/* didascalia e allenamento */
.so-pbody { display: flex; flex-direction: column; min-width: 0; }
.so-pbody:empty { display: none; }
.so-cap { margin: 6px 0 0; padding: 0 14px; font-size: 14px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.so-cap.is-fold { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.so-capmore { align-self: flex-start; margin: 2px 14px 0; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.so-wk { min-width: 0; margin: 10px 12px 0; }
/* lo spazio intorno alla scheda dell'allenamento lo decide la carta del post */
.so-wk > .so-wo, .so-wk > .swk-card { width: 100%; margin: 0; }
.so-allc { display: block; margin: 4px 0 0; padding: 4px 14px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.so-date { margin: 8px 0 0; padding: 0 14px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }

/* post senza foto: il testo (più grande) e l'allenamento sono il contenuto, le azioni vengono dopo una riga sottile */
.so-post.is-text .so-cap { margin-top: 0; font-size: 15.5px; line-height: 1.5; }
.so-post.is-text .so-cap.is-fold { -webkit-line-clamp: 6; }
.so-post.is-text .so-pbody > .so-wk:first-child { margin-top: 0; }
.so-post.is-text .so-acts { margin-top: 12px; border-top: 1px solid var(--line); }

/* allenamento allegato: riga semplice (se manca la scheda di social-workout.js) */
.so-wo {
  display: flex; align-items: center; gap: 10px; margin: 8px 14px 0; padding: 9px 11px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); background: color-mix(in srgb, var(--c) 9%, var(--surface));
}
.so-wo .c-ico, .so-woopt .c-ico { flex: none; width: 32px; height: 32px; border-radius: 8px; }
.so-wo .c-ico svg, .so-woopt .c-ico svg { width: 20px; height: 20px; }
.so-wo-t { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.so-wo-t b { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.so-wo-t small { font-size: 12px; color: var(--muted); }
.so-wo-f { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 0 10px; max-width: 46%; }
.so-wo-f b { font: 700 16px/1.25 var(--f-display); letter-spacing: .01em; white-space: nowrap; color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.so-wo-x { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- pagina del post: commenti e campo in fondo ---------- */
.so-col { display: flex; flex-direction: column; min-height: 100%; }
.so-col > .sh-body { flex: 1 0 auto; }
.so-one { max-width: 540px; margin: 12px auto 0; }
.so-cms { display: flex; flex-direction: column; gap: 14px; max-width: 540px; margin: 0 auto; padding: 16px 0 12px; list-style: none; }
.so-cms > .loading { padding: 12px 0; }
.so-cm { display: flex; align-items: flex-start; gap: 10px; }
.so-cm-av { flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.so-cm-b { flex: 1 1 auto; min-width: 0; }
.so-cm-b p { margin: 0; font-size: 14px; line-height: 1.42; white-space: pre-line; overflow-wrap: anywhere; }
.so-cm-m { display: flex; align-items: center; gap: 14px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.so-cm-del { min-height: 28px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.so-cm-del.is-armed { color: var(--missed); }
.so-cform {
  position: sticky; bottom: 0; z-index: 3; display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface);
}
.so-cform > .so-av { margin-bottom: 4px; }
.so-cform textarea {
  flex: 1 1 auto; width: auto; min-width: 0; max-height: 124px; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2); color: var(--ink);
  resize: none; font-size: 14px; line-height: 1.35;
}
.so-cform textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
.so-cpub { flex: none; min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; }
.so-cpub:disabled { opacity: .4; cursor: default; }
body.is-typing .so-cform { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
dialog.sheet:modal .so-cform { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }

/* ---------- elenchi di persone ---------- */
.so-list { display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: 4px 0; list-style: none; }
.so-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 0; }
.so-rowmain { display: flex; flex: 1 1 auto; align-items: center; gap: 12px; min-width: 0; padding: 4px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.so-rowt { display: flex; flex-direction: column; min-width: 0; }
.so-rowt .so-nm, .so-rowt small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
.so-rowt small { font-size: 13px; color: var(--muted); }
.so-rlock { flex: none; color: var(--muted); }
.so-rlock svg { width: 15px; height: 15px; }
.so-rowbtns { display: flex; flex: none; gap: 6px; }
.so-row > .btn, .so-rowbtns .btn { flex: none; justify-content: center; }
.so-follow { justify-content: center; }

/* ---------- profilo ---------- */
.so-ptitle { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.so-plock { display: inline-grid; flex: none; color: var(--muted); }
.so-plock svg { width: 18px; height: 18px; }
.so-prof { max-width: 560px; margin: 0 auto; padding-top: 16px; }
.so-ptop { display: flex; align-items: center; gap: 16px; }
.so-stats { display: grid; flex: 1 1 auto; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
.so-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding: 6px 2px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; }
button.so-stat { cursor: pointer; }
button.so-stat:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.so-stat b { font-size: 18px; font-weight: 700; line-height: 1.15; }
.so-stat span { font-size: 13px; }
.so-pname { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 12px 0 0; }
.so-pname b { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.so-badge {
  padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: color-mix(in srgb, var(--accent) 80%, var(--ink));
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.so-bio { margin: 4px 0 0; font-size: 14px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.so-coaches { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.so-chip { min-height: 30px; max-width: 100%; padding: 0 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 13px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-chip:hover { border-color: var(--accent); color: var(--accent); }
.so-pbtns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-top: 14px; }
.so-pbtns .btn { justify-content: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.so-private { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 560px; margin: 18px auto 0; padding: 26px 16px; border-top: 1px solid var(--line); text-align: center; }
.so-private b { font-size: 15px; }
.so-private p { margin: 0; color: var(--muted); font-size: 14px; }
.so-lock { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 4px; border: 2px solid var(--ink); border-radius: 50%; }
.so-lock svg { width: 28px; height: 28px; }
.so-gridnone { margin-top: 16px; border-top: 1px solid var(--line); }

/* griglia dei post: 3 colonne, quadrati */
.so-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; max-width: 560px; margin: 16px auto 0; }
.so-cell { position: relative; aspect-ratio: 1; padding: 0; border: 0; overflow: hidden; background: var(--surface-2); color: var(--ink); cursor: pointer; }
.so-cell img, .so-cell video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.so-cell:active { opacity: .8; }
.so-cbadge {
  position: absolute; top: 5px; right: 5px; display: grid; place-items: center; padding: 3px; border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 55%, transparent); color: var(--bg); pointer-events: none;
}
.so-cbadge svg { width: 14px; height: 14px; }
/* post senza foto: icona dello sport in alto, il numero più importante e il titolo in basso; solo testo: le prime parole */
.so-gtxt {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; width: 100%; height: 100%; padding: 9px;
  background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--surface)); font-size: 12px; line-height: 1.3; text-align: left; overflow: hidden;
}
.so-gtxt .c-ico { width: 26px; height: 26px; margin-bottom: auto; border-radius: 7px; }
.so-gtxt .c-ico svg { width: 16px; height: 16px; }
.so-gbig { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 21px/1 var(--f-display); color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.so-gcap { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.so-gtxt.is-quote { justify-content: center; }
.so-gtxt.is-quote .so-gcap { -webkit-line-clamp: 5; font-size: 13px; font-weight: 500; }

/* ---------- modifica profilo ---------- */
.so-ed { max-width: 560px; }
.so-ed-ph { display: flex; align-items: center; gap: 16px; padding-top: 16px; }
.so-ed-phb { display: flex; flex-wrap: wrap; gap: 6px; }
.so-ed .fld { margin-top: 14px; }
.so-ed .fld input { padding: 9px 10px; font-size: 15px; }
.so-ed .f-err { margin-top: 6px; font-size: 13px; }
.so-cnt-t { margin: 4px 0 0; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.so-sw { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.so-sw-t { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
.so-sw-t b { font-size: 15px; font-weight: 600; }
.so-sw-t small { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.so-sw .sw { flex: none; min-height: 0; }

/* ---------- nuovo post ---------- */
.so-pubbtn { margin-left: auto; }
.so-cp-st { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); font-weight: 600; font-size: 13.5px; }
.so-cp-st.is-err { background: color-mix(in srgb, var(--missed) 10%, var(--surface)); color: var(--missed); }
.so-cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; max-width: 560px; }
.so-cp-tile, .so-cp-add { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--surface-2); }
.so-cp-tile img, .so-cp-tile video { display: block; width: 100%; height: 100%; object-fit: cover; }
.so-cp-tile.is-busy { display: grid; place-items: center; }
.so-cp-rm {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 65%, transparent); color: var(--bg); cursor: pointer;
}
.so-cp-rm svg { width: 16px; height: 16px; }
.so-cp-rm:disabled { display: none; }
.so-cp-tile .so-cbadge { top: auto; right: auto; bottom: 5px; left: 5px; }
.so-cp-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 25%, var(--line)); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: center; cursor: pointer;
}
.so-cp-add svg { width: 26px; height: 26px; }
.so-cp-add:hover { border-color: var(--accent); color: var(--accent); }
/* avviso sotto le foto: i video tengono il luogo in cui sono stati girati */
.so-cp-vnote { max-width: 560px; margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.so-cp .so-wk, .so-cp .so-wo { margin: 0; max-width: 560px; }
/* «Mostra i dettagli» sotto la scheda dell'allenamento */
.so-cp .so-det { max-width: 560px; margin-top: 10px; }
.so-spin { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--ink) 16%, transparent); border-top-color: var(--accent); animation: so-spin .8s linear infinite; }
@keyframes so-spin { to { rotate: 360deg; } }
.so-wopick summary { list-style: none; cursor: pointer; }
.so-wopick summary::-webkit-details-marker { display: none; }
.so-wolist { display: flex; flex-direction: column; gap: 6px; max-width: 560px; margin: 8px 0 0; padding: 0; list-style: none; }
.so-woopt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 8px 12px 8px 10px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); background: color-mix(in srgb, var(--c) 6%, var(--surface));
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.so-woopt:hover { border-color: var(--c); }
.so-woopt .so-wo-t b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
.so-woopt-f { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 42%; text-align: right; }
.so-woopt-f b { font: 700 18px/1.05 var(--f-display); letter-spacing: .01em; white-space: nowrap; color: color-mix(in srgb, var(--c) 72%, var(--ink)); }
.so-woopt-f small { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Profilo (scheda in basso): la riga del profilo social ---------- */
.so-merow { margin-top: 12px; }
.so-merow .pr-row > .so-av { margin-inline: -1px; }

/* ---------- telefono ---------- */
@media (max-width: 820px) {
  /* le carte dei post a 10 px dai bordi dello schermo; la griglia del profilo da bordo a bordo */
  .so-feed, .so-one { margin-inline: -4px; max-width: none; }
  #soFeedBox > .so-reqrow { width: auto; max-width: none; margin-inline: -4px; }
  .so-grid { margin-inline: -14px; max-width: none; }
  /* niente zoom automatico di iPhone sui campi */
  .so-search input, .so-cform textarea, .so-ed .fld input { font-size: 16px; }
  .so-cform { padding-inline: 14px; }
  .so-hbtn { width: 40px; height: 40px; }
}
@media (max-width: 380px) {
  .so-ptop { gap: 10px; }
  .so-ptop > .so-av { width: 72px !important; height: 72px !important; font-size: 30px !important; }
  .so-stat b { font-size: 16px; }
  .so-stat span { font-size: 12px; }
  .so-wo-f { max-width: 40%; }
  .so-wo-f b { font-size: 15px; }
  .so-rowbtns { gap: 4px; }
  .so-rowbtns .btn { padding-inline: 8px; }
  .so-woopt-f b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .so-pop { animation: none; }
  .so-vplay { transition: none; }
}

/* foto profilo: tocco = anteprima grande */
.so-avbtn { flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: zoom-in; }
.so-avbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.so-avzoom {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: so-avin .16s ease-out; cursor: zoom-out;
}
.so-avzoom img {
  width: min(78vw, 340px); aspect-ratio: 1; object-fit: cover; border-radius: 50%;
  box-shadow: 0 12px 40px color-mix(in srgb, var(--ink) 30%, transparent);
}
@keyframes so-avin { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .so-avzoom { animation: none; } }
/* mio profilo senza foto: il «+» per aggiungerla */
.so-avbtn.is-add { position: relative; cursor: pointer; }
.so-avplus {
  position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 26px; height: 26px;
  border: 2px solid var(--bg); border-radius: 50%; background: var(--accent); color: var(--accent-ink);
}
.so-avplus svg { width: 14px; height: 14px; }

/* ---------- Blocca e Segnala (supabase/blocchi.sql) ---------- */
/* «⋯» in alto nel profilo di un altro: il menu (.so-pop) si apre sotto il tasto */
.so-ptitle + .so-hacts { position: relative; }
/* Modifica profilo: la riga «Persone bloccate», grande come quella di «Profilo privato» */
.so-edrow {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.so-edrow > svg { flex: none; width: 20px; height: 20px; color: var(--muted); }
.so-edrow b { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 600; }
.so-edrow small { flex: none; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.so-edch { display: grid; flex: none; color: var(--muted); }
.so-edch svg { width: 18px; height: 18px; }
/* pagina Segnala: chi è segnalato, i motivi (chip grandi da toccare), il testo facoltativo, Invia */
.so-rp { max-width: 560px; }
.so-rpwho { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; min-width: 0; }
.so-rpwho .so-nm { font-size: 15px; }
.so-rpwhy { gap: 8px; margin-top: 16px; }
.so-rpwhy .chip-opt span { padding: 10px 14px; font-size: 14.5px; }
.so-rp .fld { margin-top: 16px; }
.so-rp .f-err { margin: 10px 0 0; font-size: 13px; }
.so-rpsend { width: 100%; justify-content: center; min-height: 46px; margin-top: 16px; }
/* inviata: la spunta, il grazie, «Blocca anche» e «Fine» */
.so-rpdone b { color: var(--ink); font-size: 16px; }
.so-rpdone .btn { width: min(100%, 300px); justify-content: center; min-height: 46px; }
.so-rpok { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.so-rpok svg { width: 28px; height: 28px; }

/* ---------- KPI e suggerimenti (js/kpi.js): la scheda «Segnalazioni» ---------- */
/* tre schede: larghe quanto il testo, così stanno anche sul telefono */
.seg.kp-tabs.is-3 { max-width: 520px; }
.kp-tabs.is-3 button { flex: 1 1 auto; padding-inline: 8px; }
.kp-rep.is-done { opacity: .6; }
/* il testo segnalato (bio, didascalia o commento) com'era quando è stato segnalato */
.kp-rq {
  margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid color-mix(in srgb, var(--missed) 45%, var(--line));
  background: var(--surface); border-radius: 0 8px 8px 0; font-size: 13.5px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden;
}
.kp-rep .kp-fa .btn { min-height: 36px; }
.kp-rep .kp-fa .btn.primary { margin-left: auto; }
