/* 3.00 (25/10) Salvati con le raccolte (templates/profilo_salvati.html, profilo_raccolta.html, static/salvati.js).
   Anteprima approvata: https://claude.ai/artifact/UcaWVbq5vYgdZQjJgANZ35, blocco 1. */

/* colori che cambiano con l'aspetto (Chiaro, Scuro, Come il telefono) */
:root { --sv-ac: #0000F6; --sv-ev: #C2410C; --sv-lo: #0000F6; --sv-po: #0F766E; }
:root[data-theme="scuro"] { --sv-ac: #9AA6FF; --sv-ev: #FFB86B; --sv-lo: #9AA6FF; --sv-po: #5EEAD4; }
@media (prefers-color-scheme: dark) { :root[data-theme="sistema"] { --sv-ac: #9AA6FF; --sv-ev: #FFB86B; --sv-lo: #9AA6FF; --sv-po: #5EEAD4; } }

/* il segnalibro nella barra in alto delle schede */
.sv-btn { cursor: pointer; display: grid; place-items: center; }
.sv-btn:not(.p-glassbtn) { border: 0; background: none; color: var(--p-ink); }
.p-bar .sv-btn { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; }
.p-bar .sv-btn[aria-pressed="true"] { color: var(--sv-ac); }
.sv-btn:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }
.sv-btn.is-pop svg { animation: sv-pop .32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes sv-pop { 0% { transform: scale(.7); } 100% { transform: scale(1); } }

/* la pagina Salvati: le raccolte con la copertina a mosaico */
.sv-head { display: flex; align-items: center; gap: 12px; }
.sv-head h1 { margin: 0; }
.sv-head .p-btn { margin-left: auto; flex: none; }
.sv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; margin-top: 16px; }
@media (min-width: 640px) { .sv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .sv-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px 16px; } }
.sv-coll { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: inherit; text-decoration: none; border: 0; background: none;
  padding: 0; font: inherit; text-align: left; cursor: pointer; }
.sv-coll b { font-size: 15px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-coll small { font-size: 12.5px; color: var(--p-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-mosaic { position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; display: grid; gap: 2px;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; background: var(--p-bg2); transition: transform .2s ease; }
.sv-coll:active .sv-mosaic { transform: scale(.97); }
.sv-mosaic i { display: block; background: var(--p-bg2) center / cover no-repeat; }
.sv-mosaic.n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.sv-mosaic.n2 { grid-template-rows: 1fr; }
.sv-mosaic.n3 i:first-child { grid-row: span 2; }
.sv-mosaic.n0, .sv-coll.is-add .sv-mosaic { grid-template-columns: 1fr; grid-template-rows: 1fr; place-items: center; color: var(--p-muted); }
.sv-mosaic.n0::before { content: ""; position: absolute; inset: 0; background: var(--p-tile-a); opacity: .12; }
.sv-tag { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .5); color: #FFFFFF; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sv-shared { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .5); color: #FFFFFF; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sv-coll.is-add .sv-mosaic { background: transparent; border: 1.5px dashed var(--sv-ac); color: var(--sv-ac); place-items: center; }
.sv-new { display: flex; gap: 8px; margin-top: 16px; }
.sv-new[hidden] { display: none; }
.sv-new input { flex: 1; min-width: 0; }
.sv-more { margin-top: 18px; }

/* una raccolta */
.sv-cover { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; height: 170px; border-radius: 22px; overflow: hidden; }
.sv-cover i { display: block; background: var(--p-bg2) center / cover no-repeat; }
.sv-cover i:first-child { grid-row: span 2; }
.sv-cover.n1 { grid-template-columns: 1fr; }
.sv-cover.n2 i:first-child { grid-row: span 2; }
@media (min-width: 768px) { .sv-cover { height: 240px; } }
.sv-meta { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 13px; color: var(--p-muted); }
.sv-ppl { display: flex; margin-left: auto; }
.sv-ppl span { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--p-bg); margin-left: -7px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #FFFFFF; background: #3B50FF center / cover no-repeat; }
.sv-ppl span:first-child { margin-left: 0; }
.sv-ppl .t1 { background-color: #E8442E; } .sv-ppl .t2 { background-color: #0E9F6E; } .sv-ppl .t3 { background-color: #B9741C; }
.sv-ppl .t4 { background-color: #8B5CF6; } .sv-ppl .t5 { background-color: #DB2777; }
.sv-btns { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sv-btns > * { flex: 1 1 0; min-width: 120px; }
.sv-btns form { display: contents; }
.sv-list { padding: 4px 14px; }
.sv-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--p-line); }
.sv-row:first-child { border-top: 0; }
.sv-row > a { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.sv-row.is-past { opacity: .45; }
.sv-thumb { width: 54px; height: 54px; border-radius: 14px; flex: none; position: relative; overflow: hidden; background: var(--p-bg2) center / cover no-repeat;
  display: grid; place-items: center; color: #FFFFFF; font-weight: 800; font-size: 20px; }
.sv-thumb .d { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9.5px; font-weight: 800; text-align: center; letter-spacing: .02em;
  background: rgba(0, 0, 0, .58); color: #FFFFFF; padding: 2px 0; }
.sv-t { flex: 1; min-width: 0; }
.sv-t b { display: block; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-t small { display: block; font-size: 12.5px; color: var(--p-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-kind { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--p-bg2); white-space: nowrap; flex: none; }
.sv-kind.k-evento { color: var(--sv-ev); } .sv-kind.k-locale { color: var(--sv-lo); } .sv-kind.k-posto { color: var(--sv-po); }
.sv-x { border: 0; background: none; color: var(--p-muted); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.sv-x:hover { background: var(--p-bg2); }
.sv-empty { text-align: center; padding: 28px 12px; color: var(--p-muted); }
.sv-empty b { display: block; color: var(--p-ink); font-size: 16px; margin-bottom: 4px; }
.sv-manage { margin-top: 22px; display: grid; gap: 14px; }
.sv-manage h2 { font-size: 15px; margin: 0; }
.sv-friend { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--p-line); }
.sv-friend:first-of-type { border-top: 0; }
.sv-friend .sv-t { font-size: 14.5px; font-weight: 600; }
.sv-friend form { margin: 0; }
.sv-small-btn { border: 0; border-radius: 999px; padding: 7px 14px; font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; background: var(--p-bg2); color: var(--p-ink); }
.sv-small-btn.is-pri { background: var(--p-accent); color: var(--p-on-accent); }
.sv-danger, .p-btn.sv-danger { color: var(--p-danger); }

/* il foglio «Aggiungi a una raccolta» */
.sv-dim { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .25s ease; }
.sv-dim.is-on { opacity: 1; }
.sv-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; margin: 0 auto; max-width: 520px; max-height: 82svh; overflow: auto;
  border-radius: 26px 26px 0 0; background: var(--p-solid); color: var(--p-ink); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px;
  transform: translateY(105%); transition: transform .34s cubic-bezier(.2, .9, .25, 1); overscroll-behavior: contain; }
.sv-sheet.is-on { transform: none; }
@media (min-width: 768px) { .sv-sheet { bottom: 50%; border-radius: 26px; transform: translateY(60%) scale(.96); opacity: 0;
  transition: transform .28s ease, opacity .2s ease; } .sv-sheet.is-on { transform: translateY(50%); opacity: 1; } }
.sv-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--p-line2); justify-self: center; }
.sv-saved { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--p-ok-bg); color: var(--p-ok-ink);
  font-size: 14px; font-weight: 600; }
.sv-saved .ico { width: 28px; height: 28px; border-radius: 9px; background: #34C759; color: #FFFFFF; display: grid; place-items: center; flex: none; }
.sv-saved button { margin-left: auto; border: 0; background: none; color: inherit; font: 600 13px Inter, system-ui, sans-serif; text-decoration: underline; cursor: pointer; padding: 4px; }
.sv-sheet h2 { margin: 2px 2px 0; font-size: 16px; }
.sv-picks { display: grid; }
.sv-pick { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border: 0; border-top: 1px solid var(--p-line); background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; width: 100%; }
.sv-pick:first-child { border-top: 0; }
.sv-pick:disabled { cursor: default; }
.sv-pick .mini { width: 42px; height: 42px; border-radius: 12px; flex: none; background: var(--p-bg2) center / cover no-repeat; display: grid; place-items: center; color: var(--p-muted); }
.sv-pick .mini.is-new { background: transparent; border: 1.5px dashed var(--sv-ac); color: var(--sv-ac); }
.sv-pick .t { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; }
.sv-pick .t small { display: block; font-size: 12px; color: var(--p-muted); font-weight: 500; }
.sv-chk { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--p-line2); display: grid; place-items: center; flex: none; color: transparent; }
.sv-pick[aria-pressed="true"] .sv-chk { background: var(--p-accent); border-color: var(--p-accent); color: #FFFFFF; }
.sv-sheet form { display: flex; gap: 8px; }
.sv-sheet form input { flex: 1; min-width: 0; font: 400 16px Inter, system-ui, sans-serif; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--p-line2);
  background: var(--p-bg); color: var(--p-ink); }
.sv-done { justify-self: stretch; }
@media (prefers-reduced-motion: reduce) { .sv-sheet, .sv-dim, .sv-mosaic { transition: none; } .sv-btn.is-pop svg { animation: none; } }
