.v2-scene {
  --v2-surface: rgba(24, 24, 27, 0.62);
  --v2-surface-strong: #18181b;
  --v2-border: rgba(244, 244, 245, 0.1);
  --v2-border-soft: rgba(244, 244, 245, 0.07);
  --v2-text: #e4e4e7;
  --v2-muted: rgba(161, 161, 170, 0.8);
  --v2-subtle: rgba(161, 161, 170, 0.58);
  --v2-accent: #0081f1;
  --v2-accent-soft: rgba(0, 129, 241, 0.09);
  --v2-accent-border: rgba(0, 129, 241, 0.3);
  --v2-warning: #d6b967;
  --v2-warning-border: rgba(251, 191, 36, 0.2);
  --v2-warning-soft: rgba(251, 191, 36, 0.045);
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  padding: 22px 26px 12px;
  color: var(--v2-text);
  font-family: inherit;
}

.v2-scene *,
.v2-scene *::before,
.v2-scene *::after {
  box-sizing: border-box;
}

.v2-stage {
  width: 100%;
  min-height: 218px;
}

.v2-panel {
  width: 100%;
  padding: 20px;
  border: 1px solid var(--v2-border);
  border-radius: 12px;
  background: var(--v2-surface);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.v2-eyebrow {
  display: block;
  color: var(--v2-subtle);
  font-size: 10px;
  font-weight: 550;
}

.v2-head__copy {
  min-width: 0;
}

.v2-head__copy .v2-eyebrow {
  margin-bottom: 4px;
}

.v2-head__title {
  display: block;
  overflow: hidden;
  color: var(--v2-text);
  font-size: 15px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Messaggi clienti: conversazione chat ---------- */

.v2-chat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  max-width: 560px;
}

.v2-chat__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v2-chat__group--in {
  align-items: flex-start;
}

.v2-chat__group--out {
  align-items: flex-end;
  gap: 10px;
}

.v2-chat__meta {
  padding-left: 2px;
  color: var(--v2-subtle);
  font-size: 10px;
  font-weight: 550;
}

.v2-bubble {
  max-width: 76%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.45;
}

.v2-bubble--in {
  border: 1px solid var(--v2-border-soft);
  border-bottom-left-radius: 5px;
  background: rgba(39, 39, 42, 0.85);
  color: var(--v2-text);
  font-size: 15px;
  font-weight: 600;
}

.v2-bubble--out {
  border-bottom-right-radius: 5px;
  background: var(--v2-accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 129, 241, 0.16);
}

.v2-chat__slot {
  display: flex;
  position: relative;
  justify-content: flex-end;
  width: 100%;
}

.v2-typing {
  display: flex;
  position: absolute;
  right: 0;
  bottom: 0;
  align-items: center;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid var(--v2-border-soft);
  border-radius: 16px;
  border-bottom-right-radius: 5px;
  background: rgba(39, 39, 42, 0.85);
  opacity: 0;
}

.v2-typing i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(161, 161, 170, 0.9);
}

.v2-typing.is-typing i {
  animation: v2TypingDot 0.9s ease-in-out infinite;
}

.v2-typing.is-typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.v2-typing.is-typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes v2TypingDot {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

/* ---------- Ordini e tracking: timeline di spedizione ---------- */

.v2-order {
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-panel--order {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  max-width: 430px;
  min-height: 218px;
}

.v2-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.v2-icon {
  display: inline-flex;
  position: relative;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--v2-border);
  border-radius: 10px;
  background: rgba(39, 39, 42, 0.62);
}

.v2-icon--package::before {
  width: 19px;
  height: 18px;
  border: 1px solid rgba(161, 161, 170, 0.52);
  border-radius: 4px;
  background: rgba(161, 161, 170, 0.07);
  content: "";
}

.v2-icon--package::after {
  position: absolute;
  top: 11px;
  width: 7px;
  height: 4px;
  border-right: 1px solid rgba(161, 161, 170, 0.5);
  border-left: 1px solid rgba(161, 161, 170, 0.5);
  content: "";
}

.v2-timeline {
  display: flex;
  flex-direction: column;
  align-self: center;
  gap: 11px;
  width: 100%;
}

.v2-timeline__track {
  display: block;
  position: relative;
  height: 4px;
  margin: 0 5px;
  border-radius: 999px;
  background: rgba(161, 161, 170, 0.16);
}

.v2-timeline__fill {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 72%;
  transform-origin: left center;
  border-radius: inherit;
  background: var(--v2-accent);
}

/* Centraggio con margini negativi: le animazioni Motion scrivono transform inline
   e cancellerebbero un translate usato per il posizionamento. */
.v2-dot {
  display: block;
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 999px;
}

.v2-dot--a { left: 0; }
.v2-dot--b { left: 50%; }

.v2-dot--a,
.v2-dot--b {
  border: 2px solid var(--v2-surface-strong);
  background: var(--v2-accent);
  box-shadow: 0 0 0 1px var(--v2-accent-border);
}

.v2-dot--c {
  left: 100%;
  border: 1px solid rgba(161, 161, 170, 0.45);
  background: var(--v2-surface-strong);
}

.v2-timeline__spot {
  display: block;
  position: absolute;
  top: 50%;
  left: 72%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 2px solid var(--v2-surface-strong);
  border-radius: 999px;
  background: var(--v2-warning);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.24);
}

.v2-timeline__labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  color: var(--v2-muted);
  font-size: 10px;
  font-weight: 550;
}

.v2-timeline__labels span:nth-child(2) { text-align: center; }
.v2-timeline__labels span:nth-child(3) { text-align: right; }

.v2-alert {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--v2-warning-border);
  border-radius: 9px;
  background: var(--v2-warning-soft);
}

.v2-alert__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 6px;
  color: var(--v2-warning);
  font-size: 11px;
  font-weight: 750;
}

.v2-alert__copy {
  min-width: 0;
}

.v2-alert__copy strong,
.v2-alert__copy span {
  display: block;
}

.v2-alert__copy strong {
  color: var(--v2-text);
  font-size: 14px;
  font-weight: 630;
}

.v2-alert__copy span {
  margin-top: 2px;
  color: var(--v2-muted);
  font-size: 11px;
}

/* ---------- Inserzioni: scheda prodotto con checklist ---------- */

.v2-listing {
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-panel--listing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  max-width: 430px;
  min-height: 218px;
}

.v2-listing__head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.v2-photo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--v2-border);
  border-radius: 10px;
  background: rgba(39, 39, 42, 0.62);
  color: rgba(161, 161, 170, 0.9);
}

.v2-photo svg {
  width: 24px;
  height: 24px;
}

.v2-price {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--v2-text);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* Cursore di digitazione: acceso solo durante la scrittura automatica del titolo */
.v2-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  background: var(--v2-accent);
  opacity: 0;
  vertical-align: -0.12em;
}

.v2-caret.is-on {
  opacity: 1;
  animation: v2CaretBlink 0.85s steps(1) infinite;
}

@keyframes v2CaretBlink {
  50% { opacity: 0; }
}

.v2-draft {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v2-draft .v2-eyebrow {
  margin-bottom: 2px;
}

.v2-line {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(161, 161, 170, 0.14);
}

.v2-line--short {
  width: 62%;
}

.v2-line__fill {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  border-radius: inherit;
  background: rgba(161, 161, 170, 0.38);
}

.v2-generated {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--v2-accent-border);
  border-radius: 999px;
  background: var(--v2-accent-soft);
  color: var(--v2-text);
  font-size: 12px;
  font-weight: 600;
}

.v2-generated__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: var(--v2-accent);
  color: #fff;
  font-size: 9px;
  font-weight: 750;
}

.v2-check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 26px;
  color: var(--v2-text);
  font-size: 13px;
  font-weight: 550;
}

.v2-check__chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--v2-accent);
  color: #fff;
  font-size: 9px;
  font-weight: 750;
}

.v2-check--warn {
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid var(--v2-warning-border);
  border-radius: 9px;
  background: var(--v2-warning-soft);
}

.v2-check--warn .v2-check__label {
  color: var(--v2-muted);
}

.v2-check--warn .v2-check__label strong {
  color: var(--v2-text);
  font-weight: 630;
}

.v2-check__chip--warn {
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: transparent;
  color: var(--v2-warning);
}

/* ---------- Resi: pratica compatta con azione suggerita ---------- */

.v2-return {
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-panel--return {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  max-width: 500px;
  min-height: 218px;
}

.v2-return__head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
}

.v2-return__head .v2-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
}

.v2-return__head .v2-head__title {
  font-size: 17px;
}

.v2-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  border: 1px solid var(--v2-border);
  border-radius: 6px;
  background: var(--v2-surface-strong);
  color: var(--v2-text);
  font-size: 10px;
  font-style: normal;
}

.v2-ref {
  flex: 0 0 auto;
  margin-left: auto;
  padding-top: 2px;
  color: var(--v2-subtle);
  font-size: 11px;
  font-weight: 550;
}

.v2-flag {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--v2-warning-border);
  border-radius: 9px;
  background: var(--v2-warning-soft);
  color: var(--v2-text);
  font-size: 12px;
  font-weight: 600;
}

.v2-flag__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 6px;
  color: var(--v2-warning);
  font-size: 10px;
  font-weight: 750;
}

.v2-return__action {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid var(--v2-border-soft);
}

.v2-return__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v2-return__text {
  color: var(--v2-text);
  font-size: 15px;
  font-weight: 630;
}

.v2-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--v2-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
}

.v2-badge__check {
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}

/* ---------- Mobile: nessun overflow, riduzioni minime ---------- */

@media (max-width: 639px) {
  .v2-scene {
    padding: 16px 14px 9px;
  }

  .v2-stage {
    min-height: 210px;
  }

  .v2-bubble {
    max-width: 88%;
    font-size: 13px;
  }

  .v2-bubble--in {
    font-size: 14px;
  }

  .v2-panel {
    padding: 16px;
  }

  .v2-panel--order,
  .v2-panel--listing,
  .v2-panel--return {
    max-width: none;
    min-height: 210px;
  }

  .v2-head__title {
    font-size: 14px;
  }

  .v2-return__head .v2-head__title {
    font-size: 15px;
  }

  .v2-return__row {
    flex-wrap: wrap;
  }

  .v2-return__text {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v2-scene *,
  .v2-scene *::before,
  .v2-scene *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
