/*
===============================================
🛍️ Personal Shopper — UI (PSHY)
- Larghezza: 100% (si appoggia al container globale del tema .contenitore)
- No toggle multi-round (sempre ON)
- ADV placeholder max 460px
Data: 2026-02-10
===============================================
*/

.vsps-app{
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Layout: sidebar + main */
.vsps-shell{
  display:flex;
  gap:16px;
  align-items: stretch;
}

.vsps-sidebar{
  width: 260px;
  flex: 0 0 260px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.vsps-sidebar-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.vsps-sidebar-title{
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}

.vsps-new{
  border:0;
  background:#111;
  color:#fff;
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  font-size:12px;
}

.vsps-history{
  display:flex;
  flex-direction:column;
  gap:8px;
  overflow:auto;
  max-height:560px;
  padding-right:4px;
}

.vsps-thread-row{
  display:flex;
  gap:8px;
  align-items:stretch;
  margin-bottom:8px;
}

.vsps-thread{
  width:100%;
  border:1px solid rgba(0,0,0,.12);
  background:#f7f7f7;
  border-radius:14px;
  padding:10px;
  text-align:left;
  cursor:pointer;
}
.vsps-thread:hover{ border-color: rgba(0,0,0,.25); }

.vsps-thread--active{
  background:#111;
  color:#fff;
  border-color:#111;
}

.vsps-thread-title{
  font-size:13px;
  font-weight:700;
  line-height:1.25;
}
.vsps-thread-meta{
  margin-top:4px;
  font-size:11px;
  opacity:.75;
}

.vsps-thread-del{
  width:44px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  border-radius:14px;
  cursor:pointer;
  font-size:18px;
  line-height:1;
}
.vsps-thread-del:hover{ border-color: rgba(0,0,0,.25); }

/* ADV placeholder */
.vsps-adv-slot{
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,.10);
  width: 100%;
  max-width: 460px;
}

.vsps-adv-label{
  font-size: 11px;
  letter-spacing: .06em;
  opacity: .65;
  margin-bottom: 8px;
}

.vsps-adv-card{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  padding: 10px;
}

.vsps-adv-media{
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  background: #f2f2f2;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.vsps-adv-media--ph{
  background-image: linear-gradient(135deg, rgba(0,0,0,.06), rgba(0,0,0,.02));
}

.vsps-adv-title{
  font-weight: 800;
  font-size: 16px;
  margin-top: 10px;
  line-height: 1.2;
}
.vsps-adv-meta{
  margin-top: 6px;
  font-size: 12px;
  opacity: .75;
}
.vsps-adv-cta{
  margin-top: 10px;
  width: 100%;
  border: 1px solid rgba(0,0,0,.35);
  background: #fff;
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Main */
.vsps-main{ flex:1; min-width:0; }

.vsps-hint{
  font-size:14px;
  opacity:.85;
  line-height:1.3;
}

/* Chat */
.vsps-chat{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  padding: 12px;
  background:#fff;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height: 360px;
  overflow:auto;
  margin: 12px 0 14px 0;
}

.vsps-msg{
  max-width: 100%;
  width: fit-content;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.4;
  font-size: 14px;
  white-space: pre-wrap;
}
.vsps-msg--user{ align-self:flex-end; background:#111; color:#fff; }
.vsps-msg--ai{ align-self:flex-start; background:#f6f6f6; color:#111; }
.vsps-msg--ai{
  align-self: stretch;     /* riempie la colonna chat */
  width: 100%;
}

/* Loader dots + label */
.vsps-thinking{
  display:flex;
  align-items:center;
  gap:10px;
}
.vsps-thinking-label{
  font-size:14px;
  opacity:.75;
}
.vsps-dots{
  display:inline-flex;
  gap:4px;
  align-items:center;
}
.vsps-dots i{
  width:6px;
  height:6px;
  border-radius:50%;
  background: currentColor;
  opacity:.35;
  animation: vspsDot 1.1s infinite ease-in-out;
}
.vsps-dots i:nth-child(2){ animation-delay:.15s; }
.vsps-dots i:nth-child(3){ animation-delay:.30s; }
@keyframes vspsDot{
  0%,80%,100%{ transform: translateY(0); opacity:.35; }
  40%{ transform: translateY(-3px); opacity:.9; }
}

/* Composer */
.vsps-composer{
  position: sticky;
  bottom: 0;
  margin-top: 14px;
  padding: 12px 0 0 0;
  border-top: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
}

.vsps-input{
  width: 100%;
  border: 2px solid rgba(0,0,0,.18);
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 15px;
  line-height: 1.4;
  min-height: 52px;
  resize: none;
  background: #fff;
}
.vsps-input:focus{
  outline:none;
  border-color: rgba(0,0,0,.38);
}

.vsps-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top: 8px;
}
.vsps-send{
  border:0;
  background:#111;
  color:#fff;
  border-radius:14px;
  padding:10px 14px;
  cursor:pointer;
  font-size:13px;
}

/* Pills / routes */
.vsps-pills, .vsps-routes{
  display:none;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.vsps-pill, .vsps-route{
  border:1px solid rgba(0,0,0,.12);
  background:#f7f7f7;
  border-radius:999px;
  padding:7px 10px;
  font-size:12px;
  cursor:pointer;
}

/* Grid cards */
.vsps-grid{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(240px, 1fr);
  gap:12px;
  overflow-x:auto;
  padding-bottom:6px;
  scroll-snap-type:x mandatory;
}

@media (min-width: 1024px){
  .vsps-grid{
    grid-auto-flow: initial;
    grid-template-columns: repeat(3, minmax(0,1fr));
    overflow: visible;
  }
}

.vsps-card{
  display:grid;
  grid-template-columns:88px 1fr;
  gap:10px;
  padding:10px;
  background:#fff;
  border:1px solid rgba(0,0,0,.10);
  border-radius:16px;
  text-decoration:none;
  color:inherit;
  scroll-snap-align:start;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.vsps-card:hover{
  border-color: rgba(0,0,0,.25);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.vsps-img{
  width:88px;
  height:88px;
  border-radius:12px;
  background:#f2f2f2;
  background-size:cover;
  background-position:center;
}
/* Brand logos: niente border radius (spesso hanno già cornice) */
.vsps-card.is-brand .vsps-img{
  border-radius: 0;
}

.vsps-tag{
  font-size:11px;
  letter-spacing:.06em;
  opacity:.65;
  margin-bottom:4px;
}
.vsps-title{
  font-size:13px;
  font-weight:800;
  line-height:1.2;
}
.vsps-meta{
  margin-top:6px;
  font-size:12px;
  opacity:.75;
}

/* Responsive: sidebar top on small */
@media (max-width: 940px){
  .vsps-shell{ flex-direction: column; }
  .vsps-sidebar{ width:auto; flex:0 0 auto; max-width: 100%; }
  .vsps-history{
    flex-direction: row;
    max-height:none;
    overflow-x:auto;
    overflow-y:hidden;
  }
  .vsps-thread{ min-width:220px; }
  .vsps-adv-slot{ max-width: 460px; }
}

/* ===============================================
   PSRAG — In-bubble layout finale (Approfondisci + refine)
   Data: 2026-02-13
   =============================================== */

/* Titolo blocco evidenze dentro bubble */
.vsps-evidence{
  margin-top: 10px;
}
.vsps-evidence-title{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  opacity: .75;
  margin-bottom: 8px;
}

/* ✅ Refine pills DENTRO bubble: visibili (override display:none globale) */
.vsps-msg--ai .vsps-routes{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Mantieni i profile pills in alto (già inline) */
.vsps-pills{ display:flex; }

/* ✅ Grid cards inside bubble: 1 col mobile / 2 col desktop, no carousel */
.vsps-msg--ai .vsps-grid{
  display: grid;
  grid-auto-flow: initial;
  grid-auto-columns: initial;
  grid-template-columns: 1fr;
  overflow: visible;
  scroll-snap-type: none;
  padding-bottom: 0;
  gap: 10px;
}

@media (min-width: 900px){
  .vsps-msg--ai .vsps-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Card: un filo più compatta dentro bubble */
.vsps-msg--ai .vsps-card{
  grid-template-columns: 76px 1fr;
  border-radius: 14px;
  padding: 10px;
}
.vsps-msg--ai .vsps-img{
  width: 76px;
  height: 76px;
  border-radius: 12px;
}

/* Evita che link shop dentro card “si mangi” click area */
.vsps-card .vsps-meta a{
  text-decoration: underline;
}
/* ===========================
   STABLE UI — latest area
   =========================== */
.vsps-pills{ display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.vsps-pill.is-active{ background:#111; color:#fff; border-color:#111; }

.vsps-latest{ margin-top: 12px; }
.vsps-evidence-title{
  font-size:12px;
  font-weight:800;
  letter-spacing:.02em;
  opacity:.75;
  margin: 10px 0 8px;
}

.vsps-routes{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

/* Latest grid: 1 col mobile, 3 col desktop (stabile, no carousel) */
.vsps-grid--latest{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
  overflow: visible;
  padding-bottom: 0;
}

@media (min-width: 980px){
  .vsps-grid--latest{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* ===============================================
🛍️ VSPSRAG UI — Polish (Stable UI)
Data: 2026-02-13
=============================================== */

/* Shell */
.vsps-app{ width:100%; }
.vsps-main{ min-width:0; }

/* Chat container */
.vsps-chat{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 18px;
  background:#fff;
  padding: 14px;
  max-height: 460px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Messages */
.vsps-msg{
  font-size:14px;
  line-height:1.55;
  padding: 10px 12px;
  border-radius: 16px;
  white-space: pre-wrap;
}

.vsps-msg--user{
  align-self:flex-end;
  background:#111;
  color:#fff;
  border-top-right-radius: 8px;
  max-width: 84%;
}

.vsps-msg--ai{
  align-self:flex-start;
  background:#f6f6f6;
  color:#111;
  border-top-left-radius: 8px;
  max-width: 92%;
}

/* Composer */
.vsps-composer{
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  margin-top: 14px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(0,0,0,.08);
}

.vsps-input{
  width:100%;
  border: 2px solid rgba(0,0,0,.16);
  border-radius: 16px;
  padding: 12px 12px;
  font-size: 15px;
  line-height: 1.4;
  min-height: 54px;
  resize:none;
  background:#fff;
}
.vsps-input:focus{ outline:none; border-color: rgba(0,0,0,.38); }

.vsps-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top: 10px;
}

.vsps-send{
  border:0;
  background:#111;
  color:#fff;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  cursor:pointer;
}

/* Refine pills (latest) */
.vsps-routes{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top: 10px;
}

.vsps-route{
  border:1px solid rgba(0,0,0,.12);
  background:#f7f7f7;
  border-radius:999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor:pointer;
}
.vsps-route:hover{ border-color: rgba(0,0,0,.26); }

/* Evidence title */
.vsps-evidence-title{
  margin-top: 14px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  opacity: .65;
  text-transform: uppercase;
}

/* Evidence grid (latest) */
.vsps-grid--latest{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 860px){
  .vsps-grid--latest{
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

/* Evidence card */
.vsps-card{
  display:grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  background:#fff;
  text-decoration:none;
  color:inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.vsps-card:hover{
  border-color: rgba(0,0,0,.22);
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}

.vsps-img{
  width:78px;
  height:78px;
  border-radius: 14px;
  background:#f1f1f1;
  background-size: cover;
  background-position:center;
}

.vsps-tag{
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  opacity: .55;
  margin-bottom: 4px;
}

.vsps-title{
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.vsps-meta{
  font-size: 12px;
  opacity: .78;
  margin-top: 6px;
}

/* ===============================================
🧩 VSPS — Evidence grid: 3 colonne desktop + swipe mobile
=============================================== */

/* Mobile-first: cards in scroll orizzontale */
.vsps-grid--latest{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.vsps-grid--latest::-webkit-scrollbar{ height: 8px; }
.vsps-grid--latest::-webkit-scrollbar-thumb{ background: rgba(0,0,0,.12); border-radius: 999px; }
.vsps-grid--latest::-webkit-scrollbar-track{ background: transparent; }

.vsps-grid--latest .vsps-card{
  scroll-snap-align: start;
}

/* Desktop: 3 colonne, niente scroll */
@media (min-width: 1024px){
  .vsps-grid--latest{
    grid-auto-flow: initial;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }
}

/* Piccolo tweak: su mobile immagine un filo più grande */
@media (max-width: 480px){
  .vsps-card{ grid-template-columns: 84px 1fr; }
  .vsps-img{ width:84px; height:84px; }
}

/* =========================
   Approfondisci Grid
   ========================= */

.vsps-grid--latest {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

/* Tablet */
@media (max-width: 1200px) {
  .vsps-grid--latest {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 640px) {
  .vsps-grid--latest {
    grid-template-columns: 1fr;
  }
}