/* Rework Labs Chat — Luchino (riscrittura grafica, dicembre 2026)
 *
 * Direzione: struttura da widget di assistenza (card bianche con filetto, niente ombre
 * pesanti, niente gradienti decorativi), colori di rework-labs.com: nero per le azioni
 * principali e i messaggi del cliente, blu Rework (#0a27b1) per Luchino/IA, turchese solo per
 * il punto di stato. Navy #303444 della barra del sito per bottoni e messaggi. Tema scuro su base navy.
 *
 * Layout: sotto i 760 px foglio verticale (tutto schermo sotto i 480 px); da 760 px in su
 * pannello orizzontale con la colonna di Luchino a sinistra e la conversazione a destra.
 *
 * Motion: il JS anima pannello, header e messaggi con WAAPI (solo transform/opacity).
 * Qui solo transition di stato, l'ingresso della colonna e dei punti, i puntini di
 * digitazione e i piccoli ingressi di moduli e fogli. Tutto spento con prefers-reduced-motion.
 */

/* ══ 1. Base e token ══════════════════════════════════════════════════════ */
#rlc-root,
#rlc-root * {
  box-sizing: border-box;
}

/* Nascosto finché CookieScript non registra consenso (classe su <html> dallo script inline in
 * <head> e dal widget). display:none perché il launcher ha visibility:visible forzato inline. */
html.rlc-cookie-gate-active #rlc-root {
  display: none !important;
}

#rlc-root {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  z-index: 2147483646;
  pointer-events: none;
  overflow: visible;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--rlc-text);

  /* Superfici */
  --rlc-canvas: #ffffff;
  --rlc-rail-bg: #f4f5f8;
  --rlc-surface: #ffffff;
  --rlc-bubble: #f2f2f3;
  --rlc-hover: #f4f4f5;
  --rlc-line: #e1e1e1;
  --rlc-line-strong: #c6c8cc;
  --rlc-field-line: #8e949c;
  /* Testo */
  --rlc-text: #1b1d26;
  --rlc-text-2: #5f6670;
  /* Azioni e cliente */
  --rlc-primary: #303444;
  --rlc-primary-hover: #262a38;
  --rlc-on-primary: #ffffff;
  --rlc-user-bg: #303444;
  --rlc-user-text: #ffffff;
  --rlc-launcher-bg: #303444;
  --rlc-launcher-hover: #262a38;
  --rlc-launcher-text: #ffffff;
  /* Luchino / IA */
  --rlc-ai: #0a27b1;
  --rlc-ai-text: #0a27b1;
  --rlc-ai-line: #c9d1f6;
  --rlc-ai-soft: #eef1fd;
  --rlc-avatar-bg: #f3e5f5;
  --rlc-accent: #1fb5b0;
  --rlc-thinking-shine: #128a86;
  /* Stati */
  --rlc-ok: #1e7b3f;
  --rlc-ok-soft: #e8f5ec;
  --rlc-ok-dot: #22a45d;
  --rlc-warn: #8a5300;
  --rlc-warn-soft: #fdf3e2;
  --rlc-warn-line: #efd7a6;
  --rlc-warn-dot: #e59a1b;
  --rlc-danger: #b42318;
  --rlc-danger-soft: #fdeeec;
  --rlc-danger-line: #f3c2bd;
  --rlc-focus: #0a27b1;
  /* Profondità, curve, aree sicure */
  --rlc-shadow: 0 1px 2px rgba(17, 17, 17, 0.06), 0 16px 40px rgba(17, 17, 17, 0.14);
  --rlc-shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.08), 0 6px 16px rgba(17, 17, 17, 0.1);
  --rlc-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --rlc-rail-w: 244px;
  --rlc-safe-top: env(safe-area-inset-top, 0px);
  --rlc-safe-right: env(safe-area-inset-right, 0px);
  --rlc-safe-bottom: env(safe-area-inset-bottom, 0px);
  --rlc-safe-left: env(safe-area-inset-left, 0px);
}

/* Reset a specificità zero (:where): le regole dei componenti vincono sempre. */
:where(#rlc-root) :where(button, input, textarea, select) {
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
}

/* Safari iOS zooma al focus sotto i 16 px. */
:where(#rlc-root) :where(input, textarea, select) {
  font-size: max(16px, 1rem);
}

:where(#rlc-root) button {
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:where(#rlc-root) button:disabled {
  cursor: not-allowed;
}

:where(#rlc-root) :where(p, h3, h4) {
  margin: 0;
}

:where(#rlc-root) svg {
  display: block;
  flex-shrink: 0;
}

.rlc-hidden,
#rlc-root [hidden] {
  display: none !important;
}

.rlc-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus: anello blu 2 px, visibile solo da tastiera. */
#rlc-root :focus:not(:focus-visible) {
  outline: none;
}

#rlc-root :focus-visible {
  outline: 2px solid var(--rlc-focus);
  outline-offset: 2px;
}

/* ══ 2. Posizione: data-rlc-launcher-pos vince sulla classe ═══════════════ */
#rlc-root.rlc-pos-left #rlc-launcher,
#rlc-root.rlc-pos-left #rlc-panel,
#rlc-root[data-rlc-launcher-pos="left"] #rlc-launcher,
#rlc-root[data-rlc-launcher-pos="left"] #rlc-panel {
  left: max(22px, var(--rlc-safe-left));
  right: auto;
  translate: none;
}

#rlc-root.rlc-pos-right #rlc-launcher,
#rlc-root.rlc-pos-right #rlc-panel,
#rlc-root[data-rlc-launcher-pos="right"] #rlc-launcher,
#rlc-root[data-rlc-launcher-pos="right"] #rlc-panel {
  right: max(22px, var(--rlc-safe-right));
  left: auto;
  translate: none;
}

#rlc-root.rlc-pos-center #rlc-launcher,
#rlc-root.rlc-pos-center #rlc-panel,
#rlc-root[data-rlc-launcher-pos="center"] #rlc-launcher,
#rlc-root[data-rlc-launcher-pos="center"] #rlc-panel {
  left: 50%;
  right: auto;
  translate: -50% 0;
}

/* Il pannello nasce dall'angolo del launcher (al centro: dal bordo basso). */
#rlc-root.rlc-pos-left #rlc-panel,
#rlc-root[data-rlc-launcher-pos="left"] #rlc-panel {
  transform-origin: 28px calc(100% + 40px);
}

#rlc-root.rlc-pos-right #rlc-panel,
#rlc-root[data-rlc-launcher-pos="right"] #rlc-panel {
  transform-origin: calc(100% - 28px) calc(100% + 40px);
}

#rlc-root.rlc-pos-center #rlc-panel,
#rlc-root[data-rlc-launcher-pos="center"] #rlc-panel {
  transform-origin: 50% calc(100% + 40px);
}

#rlc-root[data-rlc-launcher-pos] #rlc-launcher.rlc-launcher-dragging,
#rlc-root[data-rlc-launcher-pos] #rlc-launcher.rlc-launcher-snapping {
  right: auto;
  translate: none;
}

/* ══ 3. Launcher ══════════════════════════════════════════════════════════ */
#rlc-launcher {
  position: fixed;
  bottom: max(22px, var(--rlc-safe-bottom));
  z-index: 2147483646;
  pointer-events: auto !important;
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex !important;
  visibility: visible !important;
  align-items: center;
  gap: 10px;
  height: 56px;
  min-height: 44px;
  min-width: 44px;
  max-width: calc(100vw - 28px);
  padding: 6px 18px 6px 6px;
  border: 0;
  border-radius: 16px;
  background: var(--rlc-launcher-bg);
  color: var(--rlc-launcher-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  cursor: grab;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none !important;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.12), 0 8px 24px rgba(17, 17, 17, 0.16);
  transition: background-color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease), opacity 150ms ease-in, scale 260ms var(--rlc-ease);
}

#rlc-launcher * {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

#rlc-launcher:active {
  transform: scale(0.97);
}

#rlc-launcher:focus-visible {
  outline: 2px solid var(--rlc-focus);
  outline-offset: 3px;
}

#rlc-launcher.rlc-launcher-dragging,
#rlc-launcher.rlc-launcher-dragging:active,
#rlc-launcher.rlc-launcher-snapping {
  cursor: grabbing;
  transform: none;
  scale: none;
}

#rlc-launcher.rlc-launcher-dragging {
  transition: none;
}

#rlc-launcher.rlc-launcher-snapping {
  transition: left 180ms var(--rlc-ease);
}

/* A pannello aperto il launcher resta come ancora, un passo indietro. */
#rlc-root #rlc-launcher.rlc-launcher-open {
  opacity: 0.92 !important;
  scale: 0.96;
}

/* Il badge si posiziona sul launcher, non sulla faccia. */
.rlc-launcher-icon {
  position: static;
  display: block;
  width: 44px;
  height: 44px;
  flex: none;
}

.rlc-logo-launcher,
#rlc-launcher .rlc-logo-fallback {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.rlc-launcher-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
  line-height: 1.2;
}

.rlc-launcher-title {
  max-width: 14rem;
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rlc-launcher-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  color: inherit;
  opacity: 0.92;
  white-space: nowrap;
}

.rlc-launcher-sub::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rlc-accent);
}

.rlc-launcher-sub:empty,
.rlc-launcher-chat-icon {
  display: none !important;
}

/* Compatto: superficie chiara con filetto. */
#rlc-launcher.rlc-launcher-compact {
  padding: 6px 14px 6px 6px;
  background: var(--rlc-canvas);
  color: var(--rlc-text);
  box-shadow: inset 0 0 0 1px var(--rlc-line), 0 8px 24px rgba(17, 17, 17, 0.12);
}

#rlc-launcher.rlc-launcher-compact .rlc-launcher-sub {
  display: none !important;
}

/* Non letti: turchese dei banner del sito con testo scuro (contrasto 5,9:1). */
.rlc-unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 3;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--rlc-accent);
  color: #111111;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px #ffffff;
}

/* Conversazione in corso a pannello chiuso. */
#rlc-launcher.rlc-launcher-ongoing::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rlc-accent);
  box-shadow: 0 0 0 2px #ffffff;
}

/* Tema XStore di rework-labs.com: il tondo «torna su» (#back-top, fisso in basso a destra)
   spuntava da sotto il launcher. Con Luchino a destra sale sopra la pillola, stesso bordo destro. */
html:not(.rlc-cookie-gate-active) body:has(#rlc-root[data-rlc-launcher-pos="right"]) #back-top.back-top {
  right: max(22px, env(safe-area-inset-right, 0px)) !important;
  bottom: calc(max(22px, env(safe-area-inset-bottom, 0px)) + 68px) !important;
}

@media (max-width: 480px) {
  html:not(.rlc-cookie-gate-active) body:has(#rlc-root[data-rlc-launcher-pos="right"]) #back-top.back-top {
    bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 68px) !important;
  }
}

/* A pannello aperto il tondo starebbe dietro l'angolo arrotondato e ne spunterebbe il bordo. */
html:not(.rlc-cookie-gate-active) body:has(#rlc-panel.rlc-open) #back-top.back-top {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ══ 4. Mascotte ══════════════════════════════════════════════════════════ */
.rlc-lu-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.rlc-lu-avatar {
  display: block;
  flex: none;
  overflow: hidden;
  background: var(--rlc-avatar-bg);
}

.rlc-lu-face {
  display: block;
  width: 100%;
  height: 100%;
}

/* Bocca quasi chiusa a riposo, cerniera sotto i baffi. */
.rlc-lu-mouth {
  transform-box: fill-box;
  transform-origin: 50% 20%;
  transform: scaleY(0.12);
}

/* Testa: ruota attorno al centro del viso, così inclinata le aste restano nel riquadro; torna dritta in 200 ms. */
.rlc-lu-head {
  transform-box: view-box;
  transform-origin: 290px 700px;
  transition: transform 200ms var(--rlc-ease);
}

#rlc-header[data-lu-state="thinking"] .rlc-lu-head {
  transform: rotate(-4deg);
  transition-duration: 400ms;
}

.rlc-lu-shine-band {
  opacity: 0;
}

/* Luchino pensa (solo header): il volto si chiude negli occhiali e lascia il posto all'icona.
 * data-lu-glyph tiene lo stato finale; il JS anima solo i passaggi. Inchiostro e teal fissi:
 * lo sfondo dell'avatar è lilla chiaro in entrambi i temi. */
.rlc-lu-avatar-header {
  position: relative;
}

.rlc-lu-avatar-header .rlc-lu-face-full {
  transform-origin: 50% 34%;
}

.rlc-lu-glyph {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform-origin: 50% 34%;
  pointer-events: none;
}

.rlc-lu-g-a {
  fill-opacity: 0;
}

/* Micro-movimenti: perni in unità della griglia dell'icona (viewBox -6 -6 36 36). */
.rlc-lu-g-loop,
.rlc-lu-g-a {
  transform-box: view-box;
  transform-origin: 0 0;
}

#rlc-header:not([data-lu-glyph="none"]) .rlc-lu-avatar-header .rlc-lu-face-full {
  opacity: 0;
  transform: scale(0.6);
}

#rlc-header:not([data-lu-glyph="none"]) .rlc-lu-glyph {
  opacity: 1;
}

/* Riga «Penso…»: stessa icona dell'header (stato su #rlc-panel), senza WAAPI. */
.rlc-lu-avatar-typing {
  position: relative;
}

.rlc-lu-avatar-typing .rlc-lu-glyph {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

#rlc-panel:not([data-lu-glyph="none"]) .rlc-lu-avatar-typing .rlc-lu-face {
  opacity: 0;
}

#rlc-panel:not([data-lu-glyph="none"]) .rlc-lu-avatar-typing .rlc-lu-glyph {
  opacity: 1;
}

#rlc-panel[data-lu-glyph="bulb"] .rlc-lu-avatar-typing .rlc-lu-g-a,
#rlc-header[data-lu-glyph="bulb"] .rlc-lu-g-a {
  fill-opacity: 0.18;
}

#rlc-panel[data-lu-glyph="search"] .rlc-lu-avatar-typing .rlc-lu-g-a,
#rlc-header[data-lu-glyph="search"] .rlc-lu-g-a {
  fill-opacity: 0.12;
}

/* La «luce» è una tinta, non un bagliore: vetro della lampadina e lente.
 * (regole bulb/search unificate sopra per header + riga d'attesa) */

@media (forced-colors: active) {
  .rlc-lu-glyph path {
    stroke: CanvasText;
    fill: none;
  }
}

/* Riduci movimento: «Luchino risponde» al posto della bocca. */
.rlc-lu-says {
  display: none;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--rlc-ai-text);
}

#rlc-header.rlc-lu-says-on .rlc-lu-says {
  display: inline;
}

#rlc-header.rlc-lu-says-on .rlc-online {
  display: none;
}

/* Avatar di ripiego (img dal PHP prima del JS). */
.rlc-logo-fallback {
  object-fit: cover;
  background: var(--rlc-avatar-bg);
}

/* ══ 5. Pannello e griglia (foglio verticale) ═════════════════════════════ */
#rlc-panel {
  position: fixed;
  top: auto;
  bottom: calc(90px + var(--rlc-safe-bottom));
  z-index: 2147483645;
  width: min(380px, calc(100vw - 24px));
  height: min(640px, calc(100dvh - 110px));
  max-height: calc(100dvh - 110px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--rlc-canvas);
  border: 1px solid var(--rlc-line);
  border-radius: 16px;
  box-shadow: var(--rlc-shadow);
  color: var(--rlc-text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
  /* L'opacità vince sull'!important del CSS critico solo come transition: chiusura 150 ms. */
  transition: opacity 150ms ease-in, visibility 0s linear 150ms;
}

#rlc-panel.rlc-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto !important;
  z-index: 2147483647;
  transition: opacity 220ms var(--rlc-ease), visibility 0s;
}

html.admin-bar #rlc-panel {
  max-height: calc(100dvh - 142px);
}

/* Sul foglio la colonna si scioglie: header, attesa e rete diventano righe. */
.rlc-rail {
  display: contents;
}

#rlc-header {
  grid-area: 1 / 1 / 2 / -1;
}

.rlc-header-actions {
  grid-area: 1 / 2 / 2 / 3;
  z-index: 2;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 0;
  padding-right: 6px;
}

#rlc-live-bar {
  grid-area: 2 / 1 / 3 / -1;
}

#rlc-net-banner {
  grid-area: 3 / 1 / 4 / -1;
}

#rlc-content {
  grid-area: 4 / 1 / 5 / -1;
}

#rlc-footer {
  grid-area: 5 / 1 / 6 / -1;
}

/* ══ 6. Header ════════════════════════════════════════════════════════════ */
#rlc-header {
  position: relative;
  min-width: 0;
  padding: 12px 100px 12px 16px;
  background: var(--rlc-canvas);
  border-bottom: 1px solid var(--rlc-line);
}

.rlc-header-top {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.rlc-header-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.rlc-back-intent {
  display: grid;
  place-items: center;
  width: 36px;
  height: 44px;
  margin-left: -8px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rlc-text-2);
  transition: background-color 120ms var(--rlc-ease), color 120ms var(--rlc-ease);
}

.rlc-back-intent svg {
  width: 20px;
  height: 20px;
}

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

/* Logo di Luchino e foto dell'operatore nella stessa cella: coin flip 3D al passaggio. */
.rlc-header-avatar-slot {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  perspective: 520px;
}

.rlc-header-avatar-slot > * {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-origin: 50% 50%;
}

.rlc-avatar.rlc-lu-avatar {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.rlc-brand-text {
  min-width: 0;
}

.rlc-header-eyebrow {
  display: none;
}

#rlc-header-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--rlc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rlc-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--rlc-text-2);
  white-space: nowrap;
}

.rlc-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--rlc-ai-text);
  font-variant-numeric: tabular-nums;
}

.rlc-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Il pallino rinforza, il testo dice lo stato. */
.rlc-status-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rlc-accent);
}

.rlc-status-halo {
  display: none;
}

.rlc-online[data-live-state="waiting"] {
  color: var(--rlc-warn);
}

.rlc-online[data-live-state="waiting"] .rlc-status-dot {
  background: var(--rlc-warn-dot);
}

.rlc-online[data-live-state="assigned"] {
  color: var(--rlc-text);
}

.rlc-online[data-live-state="assigned"] .rlc-status-dot {
  background: var(--rlc-ok-dot);
}

.rlc-online[data-live-state="callback"],
#rlc-root[data-ai-replies="false"] .rlc-online[data-live-state="ai"],
#rlc-root[data-ai-replies="false"] .rlc-online[data-live-state="closed"] {
  color: var(--rlc-text-2);
}

.rlc-online[data-live-state="callback"] .rlc-status-dot,
#rlc-root[data-ai-replies="false"] .rlc-online[data-live-state="ai"] .rlc-status-dot,
#rlc-root[data-ai-replies="false"] .rlc-online[data-live-state="closed"] .rlc-status-dot {
  background: var(--rlc-line-strong);
}

.rlc-header-sep {
  display: none;
}

#rlc-header-subtitle:empty {
  display: none;
}

#rlc-header-subtitle:not(:empty)::before {
  content: "· ";
}

.rlc-rail-welcome-block,
.rlc-rail-points,
.rlc-rail-note,
.rlc-rail-shipment,
.rlc-rail-offer {
  display: none;
}

/* Azioni (nuova chat, chiudi): 44×44, icone 20. */
.rlc-header-action {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rlc-text-2);
  transition: background-color 120ms var(--rlc-ease), color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

.rlc-header-action svg {
  width: 20px;
  height: 20px;
}

.rlc-header-action:active,
.rlc-back-intent:active {
  transform: scale(0.94);
}

/* ══ 7. Attesa operatore e rete ═══════════════════════════════════════════ */
.rlc-live-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px 16px;
  background: var(--rlc-rail-bg);
  border-bottom: 1px solid var(--rlc-line);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--rlc-text);
}

.rlc-live-bar[data-live-state="waiting"] {
  background: var(--rlc-warn-soft);
}

/* Durante l'uscita (motion) l'elemento resta in vista anche con .rlc-hidden. */
.rlc-m-leaving.rlc-hidden {
  display: block !important;
}

.rlc-live-bar.rlc-m-leaving.rlc-hidden,
.rlc-wait-card.rlc-m-leaving.rlc-hidden {
  display: flex !important;
}

.rlc-header-avatar-slot > .rlc-m-leaving.rlc-hidden {
  display: grid !important;
}

.rlc-wait-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Sul foglio il timer è già nello stato dell'header («In attesa · 01:24»). */
.rlc-wait-clock {
  display: none !important;
}

.rlc-wait-face {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

#rlc-live-timer-time {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--rlc-text);
}

.rlc-wait-clock-label {
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-wait-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.rlc-live-bar-text {
  font-weight: 500;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.rlc-live-bar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-live-alt {
  color: var(--rlc-warn);
}

.rlc-live-link {
  color: var(--rlc-ai-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rlc-net-banner {
  padding: 10px 16px;
  background: var(--rlc-danger-soft);
  border-bottom: 1px solid var(--rlc-danger-line);
  color: var(--rlc-danger);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ══ 8. Contenuto e schermata iniziale ════════════════════════════════════ */
#rlc-content {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--rlc-canvas);
}

#rlc-mode-view {
  flex: 1 1 auto;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 14px;
}

#rlc-panel.rlc-mode-active #rlc-mode-view {
  display: flex;
}

#rlc-panel.rlc-mode-active #rlc-messages,
#rlc-panel.rlc-mode-active #rlc-order-drawer {
  display: none;
}

/* Benvenuto: blocco in alto; se l'altezza non basta, #rlc-mode-view scorre. */
.rlc-mode-screen {
  margin-top: 0;
}

#rlc-mode-chips {
  display: grid;
  gap: 16px;
  margin: 0;
}

#rlc-mode-chips:empty {
  display: none;
}

.rlc-mode-greeting {
  margin: 0 0 3px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--rlc-ai-text);
  hyphens: manual;
  word-break: normal;
  overflow-wrap: normal;
}

.rlc-mode-title {
  margin: 0 0 5px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--rlc-text);
  text-wrap: balance;
  hyphens: manual;
  word-break: normal;
  overflow-wrap: normal;
}

.rlc-mode-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--rlc-text-2);
  text-wrap: pretty;
  hyphens: manual;
  word-break: normal;
  overflow-wrap: normal;
}

/* Tre intenti: card con icona blu. */
.rlc-intent-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rlc-intent-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-surface);
  color: var(--rlc-text);
  text-align: left;
  transition: border-color 120ms var(--rlc-ease), background-color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

.rlc-intent-pill:active {
  transform: scale(0.98);
}

.rlc-intent-pill-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--rlc-ai-soft);
  color: var(--rlc-ai);
}

.rlc-intent-pill-icon svg {
  width: 18px;
  height: 18px;
}

.rlc-intent-pill-text {
  display: block;
  min-width: 0;
}

.rlc-intent-pill-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  hyphens: manual;
  word-break: normal;
  overflow-wrap: normal;
}

/* Quattro domande frequenti in griglia 2×2. */
/* Riga 1 = etichetta (::before); le righe delle domande hanno tutte l'altezza della più alta. */
.rlc-welcome-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto;
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 8px;
}

/* Doppia classe: vince su .rlc-suggestions (flex). */
.rlc-suggestions.rlc-welcome-chips {
  display: grid;
}

.rlc-welcome-chips::before {
  content: "Domande frequenti";
  grid-column: 1 / -1;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rlc-text-2);
}

/* ══ 9. Chip e suggerimenti ═══════════════════════════════════════════════ */
.rlc-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rlc-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--rlc-line);
  border-radius: 8px;
  background: var(--rlc-surface);
  color: var(--rlc-text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: break-word;
  transition: border-color 120ms var(--rlc-ease), background-color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

.rlc-chip:active {
  transform: scale(0.98);
}

/* Domanda guidata (valutazione usato): risposte in evidenza, azioni di servizio (link, annulla) in secondo piano. */
.rlc-guided {
  margin-top: 10px;
}

.rlc-guided-option {
  border-color: var(--rlc-line-strong);
}

.rlc-guided-option[aria-pressed="true"] {
  border-color: var(--rlc-ai-line);
  background: var(--rlc-ai-soft);
}

.rlc-guided-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-basis: 100%;
}

.rlc-guided-action {
  background: transparent;
  color: var(--rlc-text-2);
  font-size: 0.8125rem;
}

.rlc-chip:disabled {
  opacity: 0.5;
}

.rlc-welcome-chip {
  width: 100%;
  height: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  font-weight: 500;
  font-size: 0.8125rem;
  line-height: 1.25;
  white-space: normal;
  hyphens: manual;
  word-break: normal;
  overflow-wrap: normal;
}

/* Il taglio a due righe sta sul testo, così il bottone può centrarlo in verticale. */
.rlc-welcome-chip-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-width: 0;
  overflow: hidden;
}

/* ══ 10. Messaggi ═════════════════════════════════════════════════════════ */
#rlc-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 16px 16px 12px;
  scroll-padding-bottom: 12px;
}

.rlc-msg-wrap {
  min-width: 0;
}

.rlc-msg-wrap + .rlc-msg-wrap {
  margin-top: 16px;
}

/* Stesso mittente di fila: gruppo stretto, avatar e nome solo sul primo. */
.rlc-msg-wrap-user + .rlc-msg-wrap-user,
.rlc-msg-wrap-bot:not(.rlc-msg-wrap-operator):not(.rlc-contact-wrap) + .rlc-msg-wrap-bot:not(.rlc-msg-wrap-operator):not(.rlc-contact-wrap),
.rlc-msg-wrap-operator + .rlc-msg-wrap-operator {
  margin-top: 6px;
}

.rlc-msg-wrap-bot:not(.rlc-msg-wrap-operator):not(.rlc-contact-wrap) + .rlc-msg-wrap-bot:not(.rlc-msg-wrap-operator) .rlc-bot-avatar,
.rlc-msg-wrap-operator + .rlc-msg-wrap-operator .rlc-op-avatar {
  visibility: hidden;
}

.rlc-msg-wrap-operator + .rlc-msg-wrap-operator .rlc-op-name {
  display: none;
}

.rlc-msg-wrap-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* Consiglio prodotti: bolla a tutta larghezza, intro + almeno tre card */
.rlc-msg-wrap-products {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  margin-inline-start: 0;
}

.rlc-msg-wrap-products .rlc-bot-avatar {
  display: none;
}

.rlc-msg-wrap-products .rlc-msg-row {
  gap: 0;
  width: 100%;
}

.rlc-msg-wrap-products .rlc-msg-stack,
.rlc-msg-wrap-products .rlc-msg-bot.rlc-msg-support {
  width: 100%;
  max-width: 100%;
}

.rlc-msg-wrap-products .rlc-rec-intro,
.rlc-msg-wrap-products .rlc-rec-list,
.rlc-msg-wrap-products .rlc-product-card,
.rlc-msg-wrap-products .rlc-product-item,
.rlc-msg-wrap-products .rlc-rec-more-btn {
  opacity: 1;
  transform: none;
}

.rlc-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.rlc-bot-avatar {
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 8px;
}

.rlc-msg-stack {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.rlc-msg {
  max-width: min(100%, 40rem);
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 0.9375rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Card, guide e prodotti sono markup: gli a capo del template non vanno mostrati. */
.rlc-msg-support:not(.rlc-msg-structured),
.rlc-msg-orders,
.rlc-msg-order-track,
.rlc-msg-card,
.rlc-order-summary,
.rlc-support-guide,
.rlc-product-rec,
.rlc-site-cards,
.rlc-track-cards,
.rlc-products {
  white-space: normal;
}

.rlc-msg-bot {
  background: var(--rlc-bubble);
  color: var(--rlc-text);
  border-top-left-radius: 4px;
}

.rlc-msg-user {
  max-width: 85%;
  background: var(--rlc-user-bg);
  color: var(--rlc-user-text);
  border-bottom-right-radius: 4px;
}

.rlc-msg-user .rlc-link {
  color: inherit;
}

/* Operatore: persona del team, bolla bianca con filetto. */
.rlc-msg-operator {
  background: var(--rlc-surface);
  color: var(--rlc-text);
  border: 1px solid var(--rlc-line);
  border-top-left-radius: 4px;
}

.rlc-op-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rlc-text);
}

.rlc-op-name-team {
  font-weight: 400;
  color: var(--rlc-text-2);
}

/* Avatar operatore: iniziali, la foto le copre quando è caricata. */
.rlc-op-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--rlc-primary);
  color: var(--rlc-on-primary);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.rlc-op-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 200ms var(--rlc-ease);
}

.rlc-op-avatar-loaded .rlc-op-avatar-img {
  opacity: 1;
}

.rlc-op-avatar-ini {
  line-height: 1;
}

.rlc-op-avatar.rlc-op-avatar-lg {
  width: 100%;
  height: 100%;
  margin: 0;
  font-size: 0.875rem;
}

/* Righe di sistema: centrate, tra due filetti. */
.rlc-msg-wrap-system {
  display: flex;
  justify-content: center;
}

.rlc-msg-system {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--rlc-text-2);
  text-align: center;
}

.rlc-msg-system::before,
.rlc-msg-system::after {
  content: "";
  flex: 1 1 16px;
  height: 1px;
  background: var(--rlc-line);
}

.rlc-msg-system > span {
  max-width: 80%;
}

/* Errore di Luchino e messaggio non inviato. */
.rlc-msg-wrap-error .rlc-msg-bot {
  background: var(--rlc-danger-soft);
  box-shadow: inset 0 0 0 1px var(--rlc-danger-line);
}

.rlc-msg-wrap-failed .rlc-msg-user {
  opacity: 0.72;
}

.rlc-msg-failed-row {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  color: var(--rlc-danger);
}

.rlc-msg-failed-label {
  font-weight: 500;
}

.rlc-msg-retry {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--rlc-danger);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Foto in chat (allegati). */
.rlc-msg-wrap-photo .rlc-msg-stack,
.rlc-msg-wrap-photo {
  gap: 6px;
}

.rlc-photo {
  display: block;
  max-width: min(240px, 85%);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rlc-line);
  border-radius: 14px;
  background: var(--rlc-bubble);
  line-height: 0;
  transition: transform 120ms var(--rlc-ease);
}

.rlc-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
}

.rlc-photo:active {
  transform: scale(0.99);
}

.rlc-photo-broken {
  display: grid;
  place-items: center;
  min-width: 160px;
  min-height: 72px;
  padding: 12px;
  line-height: 1.4;
  font-size: 0.8125rem;
  color: var(--rlc-text-2);
}

/* ══ 11. Testo formattato e link ══════════════════════════════════════════ */
.rlc-msg-formatted > * + * {
  margin-top: 8px;
}

.rlc-msg-para {
  margin: 0;
}

.rlc-msg-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rlc-text);
}

.rlc-msg-formatted > .rlc-msg-section-title:not(:first-child) {
  margin-top: 14px;
}

.rlc-msg-list {
  margin: 0;
  padding-left: 18px;
}

.rlc-msg-list li + li {
  margin-top: 4px;
}

.rlc-msg-list .rlc-msg-list-sub {
  margin-top: 4px;
  padding-left: 16px;
  list-style: circle;
}

.rlc-msg-list li::marker {
  color: var(--rlc-text-2);
}

.rlc-msg-bold {
  font-weight: 600;
}

.rlc-link {
  color: var(--rlc-ai-text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ══ 12. Digitazione ══════════════════════════════════════════════════════ */
.rlc-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 15px 16px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  background: var(--rlc-bubble);
}

.rlc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rlc-text-2);
  opacity: 0.35;
  animation: rlc-dot 1.2s var(--rlc-ease) infinite;
}

.rlc-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.rlc-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

/* Oltre 6 secondi i puntini rallentano. */
.rlc-typing-slow .rlc-typing span {
  animation-duration: 1.8s;
}

.rlc-preparing-label {
  font-size: 0.8125rem;
  color: var(--rlc-text-2);
}

/* Attesa di Luchino: al posto dei puntini, una bolla con l'etichetta che avanza
 * («Penso…», «Cerco nel catalogo…», …) e un riflesso lento che le scorre sopra. */
.rlc-thinking {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: min(100%, 40rem);
  padding: 11px 14px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  background: var(--rlc-bubble);
}

.rlc-typing-label {
  display: inline-grid;
  min-width: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--rlc-text-2);
}

/* Etichetta uscente ed entrante nella stessa cella: il cambio non sposta nulla. */
.rlc-typing-label > span {
  grid-area: 1 / 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Senza background-clip:text resta il testo nel colore secondario. */
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .rlc-thinking .rlc-typing-label > span {
    background-image: linear-gradient(
      100deg,
      var(--rlc-text-2) 0%,
      var(--rlc-text-2) 38%,
      var(--rlc-thinking-shine) 50%,
      var(--rlc-text-2) 62%,
      var(--rlc-text-2) 100%
    );
    background-size: 200% 100%;
    background-position: 150% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rlc-thinking-shine 1.8s ease-in-out infinite;
  }
}

@media (forced-colors: active) {
  .rlc-thinking .rlc-typing-label > span {
    background: none;
    -webkit-text-fill-color: CanvasText;
  }
}

.rlc-typing-wrap.rlc-preparing .rlc-msg-stack {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.rlc-op-typing {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rlc-op-typing .rlc-typing {
  background: var(--rlc-surface);
  box-shadow: inset 0 0 0 1px var(--rlc-line);
}

.rlc-op-typing-label {
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

/* ══ 13. Card (contenitori) ═══════════════════════════════════════════════ */
/* Con card, guida o prodotti la bolla diventa solo un contenitore. */
.rlc-msg-bot:has(> .rlc-product-rec),
.rlc-msg-bot:has(> .rlc-support-guide),
.rlc-msg-bot:has(> .rlc-msg-card),
.rlc-msg-bot:has(> .rlc-order-summary) {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rlc-msg-card,
.rlc-support-guide,
.rlc-msg-bot.rlc-msg-orders,
.rlc-msg-bot.rlc-msg-order-track,
.rlc-contact-form {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-surface);
  color: var(--rlc-text);
}

/* Testo d'apertura sopra la card d'ordine: resta una bolla. */
.rlc-order-lead {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  background: var(--rlc-bubble);
}

/* Info card: etichetta quieta con pallino del tipo. */
.rlc-msg-card-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.rlc-msg-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rlc-ai-text);
}

.rlc-msg-card-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.rlc-msg-card-warning .rlc-msg-card-badge {
  color: var(--rlc-warn);
}

.rlc-msg-card-success .rlc-msg-card-badge {
  color: var(--rlc-ok);
}

.rlc-msg-card-orders .rlc-msg-card-badge {
  color: var(--rlc-text-2);
}

.rlc-msg-card-warning {
  border-color: var(--rlc-warn-line);
}

.rlc-msg-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.rlc-msg-card-body,
.rlc-msg-card-content {
  margin-top: 8px;
  font-size: 0.875rem;
}

.rlc-msg-card > .rlc-msg-list {
  margin-top: 8px;
  font-size: 0.875rem;
}

.rlc-msg-card-footer {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

/* Riepilogo ordini (account). */
.rlc-order-overview-list {
  margin-top: 10px;
}

.rlc-order-overview-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--rlc-line);
}

.rlc-order-overview-num {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rlc-order-overview-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px 10px;
  font-size: 0.8125rem;
  color: var(--rlc-text-2);
}

.rlc-order-overview-status {
  font-weight: 600;
  color: var(--rlc-text);
}

/* ══ 14. Ordine: card riepilogo ═══════════════════════════════════════════ */
.rlc-order-summary {
  width: 100%;
}

.rlc-order-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rlc-order-summary-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rlc-order-summary-badge {
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-order-summary-num {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* Stato: etichetta rettangolare, colore per significato. */
.rlc-order-summary-status,
.rlc-order-status {
  flex: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--rlc-hover);
  color: var(--rlc-text);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.rlc-order-summary-status-done,
.rlc-order-status[data-status="completed"] {
  background: var(--rlc-ok-soft);
  color: var(--rlc-ok);
}

.rlc-order-summary-status-progress,
.rlc-order-status[data-status="processing"] {
  background: var(--rlc-ai-soft);
  color: var(--rlc-ai-text);
}

.rlc-order-summary-status-pending,
.rlc-order-status[data-status="on-hold"],
.rlc-order-status[data-status="pending"] {
  background: var(--rlc-warn-soft);
  color: var(--rlc-warn);
}

.rlc-order-summary-status-bad,
.rlc-order-status[data-status="cancelled"],
.rlc-order-status[data-status="failed"] {
  background: var(--rlc-danger-soft);
  color: var(--rlc-danger);
}

.rlc-order-summary-meta,
.rlc-order-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--rlc-line);
}

.rlc-order-meta-item {
  min-width: 0;
}

.rlc-order-meta-label {
  display: block;
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-order-meta-value {
  display: block;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.rlc-order-meta-total .rlc-order-meta-value {
  font-weight: 600;
}

.rlc-order-summary .rlc-order-products {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rlc-line);
}

.rlc-order-products-title {
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rlc-text-2);
}

.rlc-order-product-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.rlc-order-product-thumb {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid var(--rlc-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--rlc-text-2);
}

.rlc-order-product-thumb > * {
  grid-area: 1 / 1;
}

.rlc-order-product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rlc-order-product-thumb svg {
  width: 18px;
  height: 18px;
}

.rlc-order-product-thumb-letter,
.rlc-order-product-fallback {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rlc-text-2);
}

.rlc-order-product-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.35;
}

.rlc-order-product-qty {
  flex: none;
  font-size: 0.8125rem;
  color: var(--rlc-text-2);
  font-variant-numeric: tabular-nums;
}

/* ══ 15. Ordini: lista espandibile, verifica, tracking ════════════════════ */
.rlc-orders-intro,
.rlc-order-track-intro {
  margin-bottom: 10px;
  font-size: 0.875rem;
}

.rlc-order-list {
  display: grid;
  gap: 8px;
}

.rlc-order-item {
  overflow: hidden;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-surface);
}

.rlc-order-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--rlc-text);
  text-align: left;
  transition: background-color 120ms var(--rlc-ease);
}

.rlc-order-item-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rlc-order-number {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rlc-order-date {
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-order-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rlc-order-chevron {
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-order-item-body {
  padding: 0 14px 14px;
}

.rlc-order-item .rlc-order-products {
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--rlc-line);
  list-style: none;
}

.rlc-order-item .rlc-order-products li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.rlc-order-products-empty,
.rlc-order-empty,
.rlc-order-loading,
.rlc-order-tracking {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--rlc-text-2);
}

.rlc-order-form-inline {
  display: grid;
  gap: 12px;
}

.rlc-order-field {
  min-width: 0;
}

/* Drawer della vecchia schermata (nascosto dalla logica, stile minimo). */
.rlc-order-drawer {
  margin-top: 16px;
}

.rlc-order-drawer-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.rlc-order-drawer-summary::-webkit-details-marker {
  display: none;
}

.rlc-order-drawer-summary svg {
  width: 18px;
  height: 18px;
}

.rlc-mode-card-inner {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.rlc-mode-card-label {
  font-size: 0.8125rem;
  font-weight: 600;
}

.rlc-mode-hint {
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-order-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-order-divider::before,
.rlc-order-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rlc-line);
}

/* Tracking corriere. */
.rlc-track-cards {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.rlc-msg-stack > .rlc-track-cards {
  margin-top: 0;
}

.rlc-track-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-surface);
  color: var(--rlc-text);
  text-decoration: none;
  transition: border-color 120ms var(--rlc-ease), background-color 120ms var(--rlc-ease);
}

.rlc-track-card-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--rlc-primary);
  color: var(--rlc-on-primary);
  font-size: 0.8125rem;
  font-weight: 700;
}

.rlc-track-card-body {
  display: flex;
  flex: 1 1 120px;
  flex-direction: column;
  min-width: 0;
}

.rlc-track-card-kicker {
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-track-card-number {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.rlc-track-card-cta {
  margin-left: auto;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rlc-ai-text);
  white-space: nowrap;
}

/* ══ 16. Site card, anteprime link ════════════════════════════════════════ */
.rlc-site-cards {
  display: grid;
  gap: 8px;
  width: 100%;
}

.rlc-site-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-surface);
  color: var(--rlc-text);
  text-decoration: none;
  transition: border-color 120ms var(--rlc-ease), background-color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

.rlc-site-card:active,
.rlc-product-card:active,
.rlc-track-card:active,
.rlc-link-card:active {
  transform: scale(0.99);
}

.rlc-site-img {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--rlc-hover);
  object-fit: cover;
}

.rlc-site-img-fallback {
  color: var(--rlc-ai);
}

.rlc-site-img-fallback svg {
  width: 22px;
  height: 22px;
}

.rlc-site-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rlc-site-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
}

.rlc-site-desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--rlc-text-2);
}

.rlc-site-cta {
  margin-top: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rlc-ai-text);
}

/* Lo Compriamo Noi: i colori del suo sito, invariati. */
.rlc-site-card--locompriamonoi {
  background: #201c24;
  border-color: #201c24;
  color: #fffef9;
}

.rlc-site-card--locompriamonoi .rlc-site-img {
  background: #201c24;
  object-fit: contain;
}

.rlc-site-card--locompriamonoi .rlc-site-title {
  color: #fffef9;
}

.rlc-site-card--locompriamonoi .rlc-site-desc {
  color: #d4c4df;
}

.rlc-site-card--locompriamonoi .rlc-site-cta {
  color: #defb6b;
}

#rlc-root .rlc-site-card--locompriamonoi:focus-visible {
  outline-color: #defb6b;
}

/* Anteprima link sotto la bolla. */
.rlc-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  padding: 10px;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-surface);
  color: var(--rlc-text);
  text-decoration: none;
  transition: border-color 120ms var(--rlc-ease), opacity 200ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

.rlc-link-card-pending {
  opacity: 0.55;
}

.rlc-link-card-media {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--rlc-hover);
}

.rlc-link-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rlc-link-card-fallback {
  font-size: 1rem;
  font-weight: 600;
  color: var(--rlc-text-2);
}

.rlc-link-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rlc-link-card-site {
  font-size: 0.75rem;
  color: var(--rlc-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rlc-link-card-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
}

/* ══ 17. Prodotti e raccomandazioni ═══════════════════════════════════════ */
.rlc-product-rec {
  display: grid;
  gap: 12px;
  width: 100%;
}

.rlc-rec-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.rlc-rec-badge {
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: -0.011em;
  color: var(--rlc-text);
}

.rlc-rec-meta {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--rlc-text-2);
}

/* Motivazione: un paragrafo leggibile sotto il badge consigli. */
.rlc-rec-intro {
  display: block;
  width: 100%;
  max-width: 40rem;
  margin: 0;
  padding: 0;
  color: var(--rlc-text);
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: normal;
}

.rlc-rec-para {
  display: block;
  margin: 0;
}

/* Testo semplice, nessun riquadro: apertura e motivazioni si leggono come il resto della chat. */
.rlc-rec-prose {
  line-height: 1.5;
  text-indent: 0;
  overflow-wrap: break-word;
}

/* Elenco «dispositivo — prezzo. motivo». Puntini e rientro espliciti: il tema WP può azzerarli. */
#rlc-root .rlc-rec-intro .rlc-rec-points {
  display: block;
  margin: 0;
  padding: 0 0 0 20px !important;
  list-style: disc outside !important;
}

#rlc-root .rlc-rec-intro .rlc-rec-points > li {
  display: list-item;
  margin: 0;
  padding: 0;
  list-style: inherit !important;
  line-height: 1.5;
  overflow-wrap: break-word;
}

#rlc-root .rlc-rec-intro .rlc-rec-points > li::before {
  content: none !important;
}

#rlc-root .rlc-rec-intro .rlc-rec-points > li + li {
  margin-top: 6px;
}

.rlc-rec-points > li::marker {
  color: var(--rlc-ai);
}

#rlc-root .rlc-rec-intro > * + .rlc-rec-points,
#rlc-root .rlc-rec-intro > * + .rlc-rec-para {
  margin-top: 6px;
}

.rlc-rec-intro .rlc-msg-bold {
  font-weight: 650;
}

.rlc-rec-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--rlc-ai);
}

.rlc-rec-advisor {
  margin: 0;
  padding-left: 10px;
  border-left: 2px solid var(--rlc-ai-line);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--rlc-text-2);
}

.rlc-products,
.rlc-rec-list,
.rlc-rec-list-compact,
.rlc-rec-more {
  display: grid;
  gap: 8px;
  width: 100%;
}

.rlc-product-reason {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--rlc-text-2);
}

.rlc-product-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 20px;
  align-items: start;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-surface);
  color: var(--rlc-text);
  text-decoration: none;
  transition: border-color 120ms var(--rlc-ease), background-color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

.rlc-product-card-featured {
  border-color: var(--rlc-ai-line);
}

.rlc-product-thumb {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--rlc-line);
}

.rlc-product-img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
}

.rlc-product-img-fallback {
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--rlc-hover);
  color: var(--rlc-text-2);
}

.rlc-product-img-fallback svg {
  width: 22px;
  height: 22px;
}

.rlc-product-card-out .rlc-product-thumb {
  opacity: 0.6;
}

.rlc-product-body {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: 6px;
  min-width: 0;
  min-height: 64px;
}

.rlc-product-badge-row {
  display: flex;
  gap: 6px;
}

.rlc-product-badge {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--rlc-ai-soft);
  color: var(--rlc-ai-text);
  font-size: 0.75rem;
  font-weight: 600;
}

.rlc-product-rank {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rlc-text-2);
  font-variant-numeric: tabular-nums;
}

.rlc-product-name {
  display: block;
  overflow: visible;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.011em;
  overflow-wrap: break-word;
}

.rlc-product-foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 10px;
  margin-top: auto;
}

.rlc-product-price {
  font-size: 0.9375rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.rlc-product-stock {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 5px;
  min-width: 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--rlc-text-2);
  text-align: right;
}

.rlc-product-stock.rlc-in {
  color: var(--rlc-ok);
}

.rlc-product-stock.rlc-in::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rlc-ok-dot);
}

.rlc-product-stock.rlc-out {
  color: var(--rlc-danger);
}

.rlc-product-cta {
  align-self: center;
  color: var(--rlc-text-2);
  transition: color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

.rlc-product-cta svg {
  width: 18px;
  height: 18px;
}

.rlc-rec-more-btn {
  justify-self: start;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--rlc-ai-text);
  font-size: 0.875rem;
  font-weight: 600;
}

/* ══ 18. Guida di assistenza a passi ══════════════════════════════════════ */
.rlc-guide-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rlc-guide-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rlc-ai-text);
}

.rlc-guide-meta {
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-guide-intro {
  margin-top: 10px;
  font-size: 0.875rem;
}

.rlc-support-steps {
  display: grid;
  gap: 2px;
  margin: 12px -8px 0;
}

.rlc-support-step {
  padding: 10px 8px;
  border-radius: 8px;
  transition: background-color 200ms var(--rlc-ease);
}

.rlc-support-step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rlc-step-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--rlc-line-strong);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rlc-text-2);
  font-variant-numeric: tabular-nums;
  transition: background-color 200ms var(--rlc-ease), border-color 200ms var(--rlc-ease), color 200ms var(--rlc-ease);
}

.rlc-support-step-title {
  padding-top: 2px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.rlc-support-step-body {
  margin: 4px 0 0 36px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--rlc-text-2);
  white-space: pre-line;
}

/* Passo corrente: fondo blu tenue e numero pieno. */
.rlc-step-current {
  background: var(--rlc-ai-soft);
}

.rlc-step-current .rlc-step-num {
  border-color: var(--rlc-ai);
  background: var(--rlc-ai);
  color: #ffffff;
}

.rlc-step-current .rlc-support-step-body {
  color: var(--rlc-text);
}

.rlc-step-completed .rlc-step-num,
.rlc-step-num-done {
  border-color: transparent;
  background: var(--rlc-ok-soft);
  color: var(--rlc-ok);
}

.rlc-step-completed .rlc-support-step-title,
.rlc-step-done .rlc-support-step-title {
  color: var(--rlc-text-2);
}

.rlc-guide-footer {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--rlc-text-2);
}

.rlc-guide-apple {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rlc-ai-text);
  text-decoration: none;
}

/* ══ 19. Azioni del messaggio: copia, pollici, segnala ════════════════════ */
.rlc-msg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: -6px 0 -6px -10px;
  color: var(--rlc-text-2);
}

.rlc-msg-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.rlc-msg-copy,
.rlc-msg-feedback-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rlc-text-2);
  transition: background-color 120ms var(--rlc-ease), color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

.rlc-msg-copy svg,
.rlc-msg-feedback-btn svg {
  width: 18px;
  height: 18px;
}

.rlc-msg-copy:active,
.rlc-msg-feedback-btn:active {
  transform: scale(0.92);
}

.rlc-msg-copy-done {
  color: var(--rlc-ok);
}

.rlc-msg-feedback-btn[aria-pressed="true"] {
  color: var(--rlc-ai-text);
}

.rlc-msg-feedback-btn[aria-pressed="true"] svg path {
  fill: currentColor;
  fill-opacity: 0.18;
}

.rlc-msg-feedback-done .rlc-msg-feedback-btn[aria-pressed="false"] {
  opacity: 0.45;
}

.rlc-msg-feedback-label {
  padding: 0 6px 0 10px;
  font-size: 0.8125rem;
  color: var(--rlc-text-2);
}

.rlc-msg-report-link {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rlc-text-2);
  font-size: 0.8125rem;
  transition: color 120ms var(--rlc-ease);
}

.rlc-msg-feedback-reported .rlc-msg-report-link {
  color: var(--rlc-ok);
}

/* ══ 20. Modale segnalazione, lightbox, torna in fondo ════════════════════ */
.rlc-report-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.rlc-report-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.42);
  animation: rlc-fade 180ms var(--rlc-ease) both;
}

.rlc-report-sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  border: 1px solid var(--rlc-line);
  border-radius: 16px;
  background: var(--rlc-canvas);
  box-shadow: var(--rlc-shadow);
  animation: rlc-rise 220ms var(--rlc-ease) both;
}

.rlc-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px -8px 0 0;
}

.rlc-report-head strong {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.rlc-report-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rlc-text-2);
  font-size: 1.375rem;
  line-height: 1;
}

.rlc-report-lead {
  margin: 2px 0 14px;
  font-size: 0.875rem;
  color: var(--rlc-text-2);
}

.rlc-report-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rlc-report-chip {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--rlc-line-strong);
  border-radius: 8px;
  background: var(--rlc-surface);
  color: var(--rlc-text);
  font-size: 0.875rem;
  transition: background-color 120ms var(--rlc-ease), border-color 120ms var(--rlc-ease), color 120ms var(--rlc-ease);
}

.rlc-report-chip-active {
  border-color: var(--rlc-primary);
  background: var(--rlc-primary);
  color: var(--rlc-on-primary);
}

.rlc-report-text {
  margin-top: 12px;
  min-height: 88px;
  resize: vertical;
}

.rlc-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* Lightbox foto. */
.rlc-lightbox {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 56px 16px 24px;
  opacity: 0;
  transition: opacity 180ms var(--rlc-ease);
}

.rlc-lightbox-open {
  opacity: 1;
}

.rlc-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 14, 0.88);
}

.rlc-lightbox-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}

.rlc-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 100%);
  border-radius: 8px;
  object-fit: contain;
}

.rlc-lightbox-caption {
  max-width: 40ch;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
}

.rlc-lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1.375rem;
}

.rlc-lightbox-close svg {
  width: 20px;
  height: 20px;
}

/* Torna in fondo. */
.rlc-scroll-fab {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-canvas);
  color: var(--rlc-text);
  box-shadow: var(--rlc-shadow-sm);
  animation: rlc-rise 200ms var(--rlc-ease) both;
  transition: background-color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

.rlc-scroll-fab svg {
  width: 20px;
  height: 20px;
}

.rlc-scroll-fab:active {
  transform: scale(0.94);
}

/* ══ 21. Footer: composer ═════════════════════════════════════════════════ */
#rlc-footer {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 16px calc(12px + var(--rlc-safe-bottom));
  background: var(--rlc-canvas);
  border-top: 1px solid var(--rlc-line);
}

.rlc-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.rlc-human-cta,
.rlc-attach {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-canvas);
  color: var(--rlc-text-2);
  transition: background-color 120ms var(--rlc-ease), color 120ms var(--rlc-ease), border-color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

.rlc-human-cta svg,
.rlc-attach svg {
  width: 20px;
  height: 20px;
}

.rlc-human-cta:active,
.rlc-attach:active {
  transform: scale(0.95);
}

.rlc-composer-bar {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
  min-height: 48px;
  padding: 1px;
  border: 1px solid var(--rlc-field-line);
  border-radius: 12px;
  background: var(--rlc-canvas);
  transition: border-color 120ms var(--rlc-ease), box-shadow 120ms var(--rlc-ease);
}

.rlc-composer-bar:focus-within {
  border-color: var(--rlc-focus);
  box-shadow: none;
  outline: 2px solid var(--rlc-focus);
  outline-offset: 2px;
}

#rlc-root #rlc-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-height: 120px;
  margin: 0;
  padding: 11px 6px 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--rlc-text);
  line-height: 1.4;
  resize: none;
  box-shadow: none;
  outline: none;
}

#rlc-root #rlc-input::placeholder {
  color: var(--rlc-text-2);
  opacity: 1;
}

#rlc-send {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--rlc-primary);
  color: var(--rlc-on-primary);
  transition: background-color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

#rlc-send svg {
  width: 18px;
  height: 18px;
}

#rlc-send:active {
  transform: scale(0.94);
}

#rlc-send:disabled {
  background: var(--rlc-line);
  color: var(--rlc-text-2);
  transform: none;
}

.rlc-footer-note,
.rlc-privacy-note {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--rlc-text-2);
  text-align: center;
  text-wrap: pretty;
}

.rlc-privacy-note a {
  color: var(--rlc-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* «Stai chattando come …»: una riga, il nome lungo si accorcia. */
#rlc-footer .rlc-live-identity {
  margin: 0 0 8px;
}

.rlc-live-identity-line {
  display: flex;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-live-identity-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rlc-live-identity-text strong,
.rlc-visitor-name {
  font-weight: 600;
  color: var(--rlc-text);
}

/* Vassoio foto sopra il composer. */
.rlc-photo-tray {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-rail-bg);
  animation: rlc-rise 200ms var(--rlc-ease) both;
}

.rlc-photo-tray-thumb {
  display: block;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--rlc-line);
}

.rlc-photo-tray-info {
  flex: 1 1 auto;
  min-width: 0;
}

.rlc-photo-tray-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
}

.rlc-photo-tray-meta {
  font-size: 0.75rem;
  color: var(--rlc-text-2);
  font-variant-numeric: tabular-nums;
}

.rlc-photo-tray-progress {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: var(--rlc-line);
  accent-color: var(--rlc-ai);
  appearance: none;
  -webkit-appearance: none;
}

.rlc-photo-tray-progress::-webkit-progress-bar {
  background: var(--rlc-line);
}

.rlc-photo-tray-progress::-webkit-progress-value {
  background: var(--rlc-ai);
  transition: width 200ms var(--rlc-ease);
}

.rlc-photo-tray-progress::-moz-progress-bar {
  background: var(--rlc-ai);
}

.rlc-photo-tray-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.rlc-photo-tray-retry {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rlc-ai-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.rlc-photo-tray-remove {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rlc-text-2);
}

.rlc-photo-tray-remove svg {
  width: 18px;
  height: 18px;
}

/* ══ 22. Moduli: campi, pulsanti, intake, contatti ════════════════════════ */
.rlc-field-label,
.rlc-contact-field label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rlc-text);
}

.rlc-field-hint {
  font-weight: 400;
  color: var(--rlc-text-2);
}

#rlc-panel input[type="text"],
#rlc-panel input[type="email"],
#rlc-panel input[type="tel"],
#rlc-panel textarea:not(#rlc-input) {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--rlc-field-line);
  border-radius: 8px;
  background: var(--rlc-canvas);
  color: var(--rlc-text);
  line-height: 1.4;
  box-shadow: none;
  transition: border-color 120ms var(--rlc-ease), box-shadow 120ms var(--rlc-ease);
}

#rlc-panel input[type="text"]:focus,
#rlc-panel input[type="email"]:focus,
#rlc-panel input[type="tel"]:focus,
#rlc-panel textarea:not(#rlc-input):focus {
  outline: none;
  border-color: var(--rlc-ai);
  box-shadow: 0 0 0 1px var(--rlc-ai);
}

#rlc-panel input[aria-invalid="true"],
#rlc-panel textarea[aria-invalid="true"] {
  border-color: var(--rlc-danger);
}

#rlc-panel input::placeholder,
#rlc-panel textarea::placeholder {
  color: var(--rlc-text-2);
  opacity: 1;
}

.rlc-field-help {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--rlc-text-2);
}

.rlc-field-error,
.rlc-intake-error,
.rlc-contact-form-error {
  margin-top: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--rlc-danger);
}

.rlc-intake-error:empty {
  display: none;
}

/* Pulsante principale: nero pieno, 44 px, angoli 8. */
.rlc-mode-btn,
.rlc-contact-submit,
.rlc-report-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--rlc-primary);
  color: var(--rlc-on-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease), opacity 120ms var(--rlc-ease);
}

.rlc-mode-btn,
.rlc-contact-submit {
  width: 100%;
}

.rlc-mode-btn svg {
  width: 18px;
  height: 18px;
}

.rlc-mode-btn:active,
.rlc-contact-submit:active,
.rlc-report-submit:active,
.rlc-report-cancel:active {
  transform: scale(0.98);
}

.rlc-mode-btn:disabled,
.rlc-contact-submit:disabled,
.rlc-report-submit:disabled {
  opacity: 0.45;
  transform: none;
}

.rlc-report-cancel {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--rlc-line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--rlc-text);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background-color 120ms var(--rlc-ease), transform 120ms var(--rlc-ease);
}

/* Intake «Parla con una persona». */
.rlc-intake {
  display: grid;
  gap: 16px;
  margin: 0;
  min-width: 0;
  animation: rlc-rise 220ms var(--rlc-ease) both;
}

.rlc-intake-head {
  display: grid;
  gap: 2px;
}

.rlc-intake-kicker {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--rlc-text);
}

.rlc-intake-page {
  font-size: 0.8125rem;
  color: var(--rlc-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rlc-intake-page:empty {
  display: none;
}

.rlc-intake-lead {
  display: none !important;
}

.rlc-intake-row {
  display: grid;
  gap: 12px;
}

.rlc-intake-field {
  min-width: 0;
}

#rlc-intake-request {
  min-height: 72px;
  resize: vertical;
}

/* Intake aperto: un solo modulo, niente composer che compete con l'invio. */
#rlc-panel.rlc-intake-open .rlc-input-wrap,
#rlc-panel.rlc-intake-open .rlc-footer-note,
#rlc-panel.rlc-intake-open .rlc-photo-tray,
#rlc-panel.rlc-intake-open #rlc-live-identity,
#rlc-panel.rlc-intake-open #rlc-content {
  display: none;
}

#rlc-panel.rlc-intake-open #rlc-footer {
  grid-row: 4 / 6;
  overflow-y: auto;
  padding: 20px 16px calc(16px + var(--rlc-safe-bottom));
}

/* Modulo contatti (stato richiamata) e conferma. */
.rlc-contact-wrap .rlc-contact-form {
  display: grid;
  gap: 12px;
  margin-left: 38px;
  width: auto;
}

.rlc-contact-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.rlc-contact-desc {
  margin-top: -8px;
  font-size: 0.8125rem;
  color: var(--rlc-text-2);
}

.rlc-contact-field {
  min-width: 0;
}

.rlc-contact-done {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rlc-m-check {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--rlc-ok);
}

.rlc-m-sentence {
  display: inline;
}

/* ══ 23. Hover (solo puntatori fini, niente hover appiccicoso al tocco) ═══ */
@media (hover: hover) and (pointer: fine) {
  #rlc-launcher:hover {
    background: var(--rlc-launcher-hover);
  }

  #rlc-launcher.rlc-launcher-compact:hover {
    background: var(--rlc-hover);
  }

  .rlc-header-action:hover,
  .rlc-back-intent:hover,
  .rlc-msg-copy:hover,
  .rlc-msg-feedback-btn:not(:disabled):hover,
  .rlc-report-close:hover,
  .rlc-photo-tray-remove:hover {
    background: var(--rlc-hover);
    color: var(--rlc-text);
  }

  .rlc-human-cta:hover,
  .rlc-attach:hover {
    border-color: var(--rlc-line-strong);
    background: var(--rlc-hover);
    color: var(--rlc-text);
  }

  .rlc-intent-pill:hover {
    border-color: var(--rlc-ai-line);
    background: var(--rlc-ai-soft);
  }

  .rlc-chip:not(:disabled):hover,
  .rlc-report-chip:not(.rlc-report-chip-active):hover {
    border-color: var(--rlc-line-strong);
    background: var(--rlc-hover);
  }

  .rlc-product-card:hover,
  .rlc-site-card:hover,
  .rlc-track-card:hover,
  .rlc-link-card:hover {
    border-color: var(--rlc-line-strong);
  }

  .rlc-product-card:hover .rlc-product-cta {
    color: var(--rlc-text);
    transform: translateX(2px);
  }

  .rlc-site-card--locompriamonoi:hover {
    border-color: #defb6b;
  }

  .rlc-order-item-head:hover {
    background: var(--rlc-hover);
  }

  #rlc-send:not(:disabled):hover,
  .rlc-mode-btn:not(:disabled):hover,
  .rlc-contact-submit:not(:disabled):hover,
  .rlc-report-submit:not(:disabled):hover,
  .rlc-cart-add:hover {
    background: var(--rlc-primary-hover);
  }

  .rlc-trade-btn:hover {
    background: var(--rlc-hover);
    border-color: var(--rlc-line-strong);
    color: var(--rlc-text);
  }

  .rlc-report-cancel:hover,
  .rlc-scroll-fab:hover {
    background: var(--rlc-hover);
  }

  .rlc-msg-report-link:hover,
  .rlc-rec-more-btn:hover,
  .rlc-guide-apple:hover,
  .rlc-track-card:hover .rlc-track-card-cta,
  .rlc-site-card:hover .rlc-site-cta {
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .rlc-msg-report-link:hover {
    color: var(--rlc-text);
  }

  .rlc-link:hover {
    text-decoration-thickness: 2px;
  }
}

/* ══ 24. Telefono (≤ 480 px): pannello a tutto schermo ════════════════════ */
@media (max-width: 480px) {
  html.rlc-scroll-lock,
  html.rlc-scroll-lock body {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  #rlc-root.rlc-pos-left #rlc-launcher,
  #rlc-root[data-rlc-launcher-pos="left"] #rlc-launcher {
    left: max(14px, var(--rlc-safe-left));
  }

  #rlc-root.rlc-pos-right #rlc-launcher,
  #rlc-root[data-rlc-launcher-pos="right"] #rlc-launcher {
    right: max(14px, var(--rlc-safe-right));
  }

  #rlc-launcher {
    bottom: max(14px, var(--rlc-safe-bottom));
  }

  #rlc-launcher.rlc-launcher-full .rlc-launcher-sub {
    display: none !important;
  }

  /* Il CSS critico forza il display del launcher: qui va spento davvero. */
  #rlc-root.rlc-panel-open #rlc-launcher {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  #rlc-root.rlc-pos-left #rlc-panel,
  #rlc-root.rlc-pos-right #rlc-panel,
  #rlc-root.rlc-pos-center #rlc-panel,
  #rlc-root[data-rlc-launcher-pos="left"] #rlc-panel,
  #rlc-root[data-rlc-launcher-pos="right"] #rlc-panel,
  #rlc-root[data-rlc-launcher-pos="center"] #rlc-panel,
  #rlc-panel {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    translate: none;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    transform-origin: 50% 100%;
    overscroll-behavior: contain;
  }

  html.admin-bar #rlc-panel {
    top: 46px;
    height: calc(100dvh - 46px);
    max-height: calc(100dvh - 46px);
  }

  #rlc-header {
    padding: max(10px, var(--rlc-safe-top)) 100px 10px max(16px, var(--rlc-safe-left));
  }

  .rlc-header-actions {
    padding-top: var(--rlc-safe-top);
    padding-right: max(6px, var(--rlc-safe-right));
  }

  .rlc-msg {
    font-size: 1rem;
  }

  #rlc-messages {
    padding: 16px max(16px, var(--rlc-safe-right)) 12px max(16px, var(--rlc-safe-left));
  }

  .rlc-live-bar,
  .rlc-net-banner {
    padding-left: max(16px, var(--rlc-safe-left));
    padding-right: max(16px, var(--rlc-safe-right));
  }

  #rlc-footer {
    padding: 10px max(16px, var(--rlc-safe-right)) calc(10px + var(--rlc-safe-bottom)) max(16px, var(--rlc-safe-left));
  }

  .rlc-report-sheet {
    max-width: none;
  }
}

/* Foglio verticale: intenti in colonna (icona + label), parole intere. */
@media (max-width: 759px) {
  #rlc-panel.rlc-mode-active #rlc-mode-view {
    justify-content: safe center;
    gap: 16px;
    padding: 16px 16px 18px;
  }

  .rlc-intent-pills {
    grid-template-columns: minmax(0, 1fr);
  }

  .rlc-intent-pill {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 12px;
  }

  .rlc-intent-pill-icon {
    flex: none;
  }

  #rlc-mode-chips {
    gap: 14px;
  }
}

/* Schermi stretti: FAQ una colonna se due colonne strette. */
@media (max-width: 429px) {
  .rlc-suggestions.rlc-welcome-chips {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 359px) {
  .rlc-suggestions.rlc-welcome-chips {
    grid-template-columns: minmax(0, 1fr);
  }

  .rlc-order-summary-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Tastiera virtuale aperta: composer visibile, lista messaggi scorrevole. */
#rlc-root.rlc-kb-open #rlc-footer {
  overflow: visible;
  padding-bottom: 8px;
}

#rlc-root.rlc-kb-open #rlc-content,
#rlc-root.rlc-kb-open #rlc-messages {
  min-height: 0;
}

#rlc-root.rlc-kb-open .rlc-footer-note,
#rlc-root.rlc-kb-open .rlc-privacy-note,
#rlc-root.rlc-kb-open #rlc-human-cta {
  display: none !important;
}

/* Finestre basse ma non da telefono: niente nota, più spazio ai messaggi. */
@media (min-width: 481px) and (max-height: 560px) {
  .rlc-footer-note,
  .rlc-privacy-note {
    display: none;
  }
}

/* ══ 25. Computer (≥ 760 × 440): pannello orizzontale ═════════════════════ */
@media (min-width: 760px) and (min-height: 440px) {
  #rlc-root #rlc-panel {
    width: min(780px, calc(100vw - 48px));
    height: min(520px, calc(100dvh - 120px));
    max-height: calc(100dvh - 120px);
    grid-template-columns: var(--rlc-rail-w) minmax(0, 1fr);
    grid-template-rows: 52px minmax(0, 1fr) auto;
    border-radius: 20px;
  }

  /* Colonna: identità (logo, nome, stato) + slot (ordine, confronto o spunte) formano UN gruppo
     centrato in verticale e in orizzontale sull'asse del pannello; se non c'è altezza scorre lo slot. */
  .rlc-rail {
    grid-area: 1 / 1 / -1 / 2;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
    background: var(--rlc-rail-bg);
    border-right: 1px solid var(--rlc-line);
  }

  .rlc-rail > #rlc-header {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    /* Stesso respiro orizzontale del #rlc-mode-view (24px); sopra e sotto uguali, così il gruppo è centrato. */
    padding: 24px;
    background: transparent;
    border: 0;
  }

  .rlc-rail .rlc-header-top {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: safe center;
    min-height: 0;
    gap: 22px;
  }

  .rlc-rail .rlc-header-left {
    flex: 0 0 auto;
    align-items: center;
    max-width: 100%;
    text-align: center;
  }

  #rlc-header {
    padding: 20px 20px 4px;
    background: transparent;
    border: 0;
  }

  .rlc-header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .rlc-header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .rlc-rail .rlc-brand {
    align-items: center;
    gap: 10px;
  }

  .rlc-rail .rlc-brand-text {
    text-align: center;
  }

  .rlc-rail .rlc-header-meta {
    justify-content: center;
  }

  .rlc-rail #rlc-header-title {
    font-size: 1.125rem;
    line-height: 1.2;
    letter-spacing: -0.012em;
  }

  .rlc-rail .rlc-header-meta {
    margin-top: 3px;
    line-height: 1.3;
    font-size: 0.8125rem;
  }

  .rlc-rail .rlc-back-intent {
    width: 44px;
    height: 44px;
    margin: 0 0 8px -12px;
    align-self: flex-start;
  }

  .rlc-back-intent {
    height: 36px;
    margin: -10px 0 0 -10px;
  }

  .rlc-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .rlc-header-avatar-slot {
    width: 56px;
    height: 56px;
  }

  .rlc-avatar.rlc-lu-avatar {
    border-radius: 16px;
  }

  .rlc-header-eyebrow:not(.rlc-hidden) {
    display: block;
    margin-bottom: 2px;
    font-size: 0.75rem;
    color: var(--rlc-text-2);
  }

  #rlc-header-title {
    font-size: 1.25rem;
    line-height: 1.25;
    letter-spacing: -0.015em;
    white-space: normal;
  }

  .rlc-header-meta {
    margin-top: 2px;
    white-space: normal;
  }

  .rlc-online {
    overflow: visible;
  }

  .rlc-rail-points {
    display: grid;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    list-style: none;
  }

  .rlc-rail-points li {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--rlc-text);
  }

  /* Spunta blu disegnata con una maschera: niente emoji, eredita il token. */
  .rlc-rail-ico {
    flex: none;
    width: 15px;
    height: 15px;
    margin-top: 0.2em;
    background: var(--rlc-ai);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  /* Quarta voce: è l'unica cliccabile (avvia la valutazione dell'usato in chat). Aspetto da testo, non da bottone. */
  .rlc-rail-trade-in {
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    line-height: inherit;
    text-align: left;
    color: var(--rlc-text);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--rlc-ai) 45%, transparent);
    text-underline-offset: 3px;
    transition: color 160ms ease, text-decoration-color 160ms ease;
  }

  .rlc-rail-trade-in:hover {
    color: var(--rlc-ai);
    text-decoration-color: currentColor;
  }

  .rlc-rail-trade-in:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--rlc-ai);
    outline-offset: 3px;
  }

  .rlc-rail-note {
    display: block;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--rlc-line);
    font-size: 0.8125rem;
    line-height: 1.5;
    text-align: center;
    color: var(--rlc-text-2);
  }

  /* Slot spunte (default): punti + nota come un blocco, centrato sotto l’identità. */
  #rlc-panel:not(.rlc-rail-has-offer):not(.rlc-rail-has-order):not(.rlc-rail-has-context) .rlc-rail-welcome-block {
    display: flex;
    flex-direction: column;
    margin-block: 0;
    flex: 0 1 auto;
    align-self: stretch;
    width: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 0;
  }

  #rlc-panel:not(.rlc-rail-has-offer):not(.rlc-rail-has-order):not(.rlc-rail-has-context) .rlc-rail-points {
    display: grid;
  }

  #rlc-panel:not(.rlc-rail-has-offer):not(.rlc-rail-has-order):not(.rlc-rail-has-context) .rlc-rail-note {
    display: block;
  }

  /* Ordine, confronto, contesto: stesso centraggio; se troppo alti, scroll interno. */
  #rlc-panel.rlc-rail-has-offer .rlc-rail-offer:not(.rlc-hidden),
  #rlc-panel.rlc-rail-has-order .rlc-rail-shipment:not(.rlc-hidden),
  #rlc-panel.rlc-rail-has-context .rlc-rail-context:not([hidden]) {
    margin-block: 0;
    flex: 0 1 auto;
    align-self: stretch;
    width: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 0;
  }

  .rlc-rail-shipment:not(.rlc-hidden) {
    display: block;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--rlc-text);
  }

  /* Un solo slot: ordine aperto, mini-confronto consiglio o spunte. Mai due insieme. */
  #rlc-panel.rlc-rail-has-order .rlc-rail-welcome-block,
  #rlc-panel.rlc-rail-has-order .rlc-rail-offer,
  #rlc-panel.rlc-rail-has-offer .rlc-rail-welcome-block,
  #rlc-panel.rlc-rail-has-offer .rlc-rail-shipment {
    display: none;
  }

  .rlc-rail-offer:not(.rlc-hidden) {
    display: block;
    margin: 0;
    min-width: 0;
  }

  .rlc-rail-offer-card {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--rlc-line);
    border-radius: 12px;
    background: var(--rlc-surface);
    color: var(--rlc-text);
    text-decoration: none;
  }

  a.rlc-rail-offer-card:hover {
    border-color: var(--rlc-ai-line);
  }

  .rlc-rail-offer-name {
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: -0.011em;
    overflow-wrap: anywhere;
  }

  .rlc-rail-offer-price {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
  }

  .rlc-rail-offer-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 4px;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--rlc-ai-text);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 650;
    cursor: pointer;
  }

  .rlc-rail-compare-kicker {
    margin: 0;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rlc-text-2);
  }

  .rlc-rail-compare-meta {
    margin: 4px 0 12px;
    text-align: center;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--rlc-text-2);
  }

  .rlc-rail-compare-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
  }

  .rlc-rail-compare-item {
    display: grid;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--rlc-line);
    border-radius: 10px;
    background: var(--rlc-surface);
    color: var(--rlc-text);
    text-decoration: none;
    min-width: 0;
  }

  a.rlc-rail-compare-item:hover {
    border-color: var(--rlc-ai-line);
  }

  .rlc-rail-compare-item-featured {
    border-color: var(--rlc-ai-line);
  }

  .rlc-rail-compare-name {
    font-size: 0.8125rem;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.011em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
  }

  .rlc-rail-compare-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    justify-content: space-between;
  }

  .rlc-rail-compare-price {
    font-size: 0.8125rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
  }

  .rlc-rail-grade {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    font-size: 0.6875rem;
    line-height: 1.2;
    color: var(--rlc-text-2);
  }

  .rlc-rail-grade-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 8.5rem;
  }

  .rlc-grade-meter-compact {
    gap: 2px;
  }

  .rlc-grade-meter-compact i {
    width: 3px;
    border-radius: 1px;
  }

  .rlc-grade-meter-compact i:nth-child(1) { height: 4px; }
  .rlc-grade-meter-compact i:nth-child(2) { height: 5px; }
  .rlc-grade-meter-compact i:nth-child(3) { height: 7px; }
  .rlc-grade-meter-compact i:nth-child(4) { height: 9px; }

  .rlc-rail-order-id {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    text-align: center;
  }

  .rlc-rail-order-sub {
    margin-top: 2px;
    text-align: center;
    color: var(--rlc-text-2);
  }

  .rlc-rail-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
  }

  .rlc-rail-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--rlc-line);
    border-radius: 10px;
    background: var(--rlc-surface);
    color: var(--rlc-text);
  }

  .rlc-rail-switch-btn svg {
    width: 20px;
    height: 20px;
  }

  .rlc-rail-switch-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
  }

  .rlc-rail-switch-pos {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--rlc-text-2);
    font-variant-numeric: tabular-nums;
  }

  /* Percorso verticale: il tratto grigio è il binario, quello colorato arriva una volta sola. */
  .rlc-rail-path {
    display: grid;
    width: fit-content;
    max-width: 100%;
    margin: 12px auto 0;
    padding: 0;
    list-style: none;
  }

  .rlc-rail-path-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    padding: 4px 0;
    color: var(--rlc-text-2);
  }

  .rlc-rail-path-step[data-state="done"],
  .rlc-rail-path-step[data-state="current"] {
    color: var(--rlc-text);
  }

  .rlc-rail-path-step[data-state="current"] {
    font-weight: 650;
  }

  .rlc-rail-path-dot {
    position: relative;
    z-index: 1;
    flex: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--rlc-line-strong);
    border-radius: 50%;
    background: var(--rlc-rail-bg);
  }

  .rlc-rail-path-step[data-state="done"] .rlc-rail-path-dot {
    border-color: var(--rlc-ai);
    background: var(--rlc-ai);
  }

  .rlc-rail-path-step[data-state="current"] .rlc-rail-path-dot {
    border-color: var(--rlc-ai);
    background: var(--rlc-accent);
    box-shadow: 0 0 0 3px var(--rlc-ai-line);
    animation: rlc-path-dot 420ms var(--rlc-ease) both;
  }

  .rlc-rail-path-step:not(:last-child)::before,
  .rlc-rail-path-step[data-state="done"]:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 6px;
    top: calc(50% + 8px);
    bottom: calc(-50% + 8px);
    width: 2px;
  }

  .rlc-rail-path-step:not(:last-child)::before {
    background: var(--rlc-line-strong);
  }

  .rlc-rail-path-step[data-state="done"]:not(:last-child)::after {
    background: var(--rlc-ai);
    transform-origin: top center;
    animation: rlc-path-draw 640ms var(--rlc-ease) both;
  }

  .rlc-rail-path-step:nth-child(2)[data-state="done"]::after {
    animation-delay: 180ms;
  }

  .rlc-rail-track {
    display: grid;
    gap: 2px;
    text-align: center;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--rlc-line);
    border-radius: 12px;
    background: var(--rlc-surface);
    color: var(--rlc-text);
    text-decoration: none;
  }

  a.rlc-rail-track:hover {
    border-color: var(--rlc-ai-line);
  }

  .rlc-rail-track-empty {
    color: var(--rlc-text-2);
  }

  .rlc-rail-track-carrier {
    font-weight: 650;
  }

  .rlc-rail-track-number {
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }

  .rlc-rail-track-cta {
    margin-top: 4px;
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--rlc-ai-text);
  }

  /* Attesa operatore: card nella colonna, con timer e avanzamento. */
  .rlc-live-bar {
    margin: 0 16px;
    padding: 12px;
    border: 1px solid var(--rlc-line);
    border-radius: 12px;
    background: var(--rlc-surface);
  }

  .rlc-live-bar[data-live-state="waiting"] {
    border-color: var(--rlc-warn-line);
    background: var(--rlc-surface);
  }

  .rlc-wait-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .rlc-wait-clock:not(.rlc-hidden) {
    display: block !important;
    padding-bottom: 8px;
    /* Avanzamento dell'attesa sul limite: barra di 3 px che il JS aggiorna con --rlc-wait. */
    background:
      linear-gradient(var(--rlc-ai), var(--rlc-ai)) 0 100% / var(--rlc-wait, 0%) 3px no-repeat,
      linear-gradient(var(--rlc-line), var(--rlc-line)) 0 100% / 100% 3px no-repeat;
    transition: background-size 400ms var(--rlc-ease);
  }

  .rlc-wait-clock.rlc-wait-late {
    background:
      linear-gradient(var(--rlc-warn-dot), var(--rlc-warn-dot)) 0 100% / var(--rlc-wait, 0%) 3px no-repeat,
      linear-gradient(var(--rlc-line), var(--rlc-line)) 0 100% / 100% 3px no-repeat;
  }

  .rlc-wait-clock.rlc-wait-late #rlc-live-timer-time {
    color: var(--rlc-warn);
  }

  .rlc-live-bar[data-live-state="callback"] .rlc-wait-clock {
    display: none !important;
  }

  .rlc-net-banner {
    margin: 0 16px;
    padding: 10px 12px;
    border: 1px solid var(--rlc-danger-line);
    border-radius: 12px;
  }

  /* Barra azioni sopra la conversazione. */
  .rlc-header-actions {
    grid-area: 1 / 2 / 2 / 3;
    justify-self: end;
    padding: 4px 8px 0;
  }

  #rlc-content {
    grid-area: 2 / 2 / 3 / 3;
  }

  /* Stessi 24px laterali di benvenuto e messaggi: composer allineato al contenuto. */
  #rlc-footer {
    grid-area: 3 / 2 / 4 / 3;
    padding: 12px 24px 14px;
  }

  #rlc-panel.rlc-intake-open #rlc-footer {
    grid-row: 2 / 4;
    padding: 8px 24px 20px;
  }

  /* Home: blocco centrato sullo stesso asse orizzontale del gruppo nella colonna sinistra (centro del
     pannello). L'area utile sta sopra al centro perché sotto c'è il composer: il padding alto di 58px
     compensa composer (~95px) meno fascia azioni (52px). I due distanziatori si annullano quando
     l'altezza non basta: allora scorre dall'alto. */
  #rlc-panel.rlc-mode-active #rlc-mode-view {
    justify-content: flex-start;
    gap: 0;
    padding: 58px 24px 16px;
  }

  #rlc-panel.rlc-mode-active #rlc-mode-view::before,
  #rlc-panel.rlc-mode-active #rlc-mode-view::after {
    content: "";
    flex: 1 1 0;
    min-height: 0;
  }

  #rlc-panel.rlc-mode-active #rlc-mode-chips:not(:empty) {
    margin-top: 16px;
  }

  #rlc-panel.rlc-mode-active .rlc-mode-greeting {
    margin-bottom: 4px;
    font-size: 0.8125rem;
    line-height: 1.25;
  }

  #rlc-panel.rlc-mode-active .rlc-mode-title {
    margin-bottom: 4px;
    font-size: 1.125rem;
    line-height: 1.2;
  }

  #rlc-panel.rlc-mode-active .rlc-mode-desc {
    font-size: 0.8125rem;
    line-height: 1.3;
  }

  #rlc-panel.rlc-mode-active #rlc-mode-chips {
    gap: 16px;
  }

  #rlc-panel.rlc-mode-active .rlc-intent-pills {
    gap: 8px;
  }

  #rlc-panel.rlc-mode-active .rlc-intent-pill {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 10px 12px;
  }

  #rlc-panel.rlc-mode-active .rlc-intent-pill-icon {
    flex: none;
    width: 26px;
    height: 26px;
  }

  #rlc-panel.rlc-mode-active .rlc-intent-pill-icon svg {
    width: 16px;
    height: 16px;
  }

  #rlc-panel.rlc-mode-active .rlc-intent-pill-label {
    font-size: 0.8125rem;
    line-height: 1.25;
    hyphens: manual;
  }

  #rlc-panel.rlc-mode-active .rlc-welcome-chips::before {
    margin-bottom: 1px;
    line-height: 1.2;
  }

  #rlc-panel.rlc-mode-active .rlc-welcome-chip {
    min-height: 0;
    padding: 9px 10px;
    font-size: 0.8125rem;
    line-height: 1.25;
    hyphens: manual;
    overflow-wrap: normal;
  }

  #rlc-panel.rlc-mode-active #rlc-footer {
    padding-top: 8px;
    padding-bottom: 12px;
  }

  #rlc-messages {
    padding: 8px 24px 12px;
  }

  .rlc-msg-user {
    max-width: 80%;
  }

  .rlc-report-modal {
    align-items: center;
  }

  /* Apertura: la colonna entra da sinistra, poi i punti in sequenza.
     Il JS fa salire header, conversazione e footer: qui niente transform su quegli elementi. */
  #rlc-panel.rlc-open .rlc-rail {
    animation: rlc-rail-in 320ms var(--rlc-ease) both;
  }

  #rlc-panel.rlc-open .rlc-rail-points li,
  #rlc-panel.rlc-open .rlc-rail-note {
    animation: rlc-point-in 260ms var(--rlc-ease) both;
  }

  #rlc-panel.rlc-open .rlc-rail-points li:nth-child(1) { animation-delay: 160ms; }
  #rlc-panel.rlc-open .rlc-rail-points li:nth-child(2) { animation-delay: 210ms; }
  #rlc-panel.rlc-open .rlc-rail-points li:nth-child(3) { animation-delay: 260ms; }
  #rlc-panel.rlc-open .rlc-rail-points li:nth-child(4) { animation-delay: 310ms; }
  #rlc-panel.rlc-open .rlc-rail-note { animation-delay: 360ms; }
}

/* ══ 25b. Certificato prodotto, colonna contestuale, espressioni di Luchino ══ */

/* Certificato di ricondizionamento nella card: timbro del grado, solo se è nella scheda.
   Batteria e garanzia del singolo pezzo non si conoscono: non si mostrano. */
.rlc-grade {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  max-width: 100%;
  min-width: 0;
  margin: 2px 0;
  padding: 4px 8px 4px 6px;
  border: 1px solid var(--rlc-ai-line);
  border-radius: 6px;
  background: var(--rlc-ai-soft);
  color: var(--rlc-ai-text);
  font-size: 0.75rem;
  line-height: 1.2;
}

.rlc-grade-text {
  min-width: 0;
  overflow-wrap: break-word;
}

.rlc-grade-text strong {
  font-weight: 650;
}

/* Scala a 4 tacche crescenti: si legge al volo, il testo porta il dato. */
.rlc-grade-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.rlc-grade-meter i {
  width: 4px;
  border-radius: 1px;
  background: var(--rlc-ai-line);
  transform-origin: bottom;
}

.rlc-grade-meter i:nth-child(1) { height: 5px; }
.rlc-grade-meter i:nth-child(2) { height: 7px; }
.rlc-grade-meter i:nth-child(3) { height: 10px; }
.rlc-grade-meter i:nth-child(4) { height: 12px; }

.rlc-grade-meter i.rlc-on {
  background: var(--rlc-ai);
  animation: rlc-seg-in 260ms var(--rlc-ease) both;
}

.rlc-grade-meter i:nth-child(2).rlc-on { animation-delay: 60ms; }
.rlc-grade-meter i:nth-child(3).rlc-on { animation-delay: 120ms; }
.rlc-grade-meter i:nth-child(4).rlc-on { animation-delay: 180ms; }



/* Colonna contestuale: esiste solo nel layout orizzontale. */
.rlc-rail-context {
  display: none;
}

/* Espressioni di Luchino: parti aggiunte all'SVG dell'header, invisibili a riposo. */
.rlc-lu-pupils,
.rlc-lu-eye-happy,
.rlc-lu-wink,
.rlc-lu-brow,
.rlc-lu-smile,
.rlc-lu-frown {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition: opacity 160ms var(--rlc-ease), transform 260ms var(--rlc-ease);
}

.rlc-lu-brow-l { transform-origin: 0% 100%; }
.rlc-lu-brow-r { transform-origin: 100% 100%; }

.rlc-lu-mouth {
  transition: opacity 160ms var(--rlc-ease);
}

/* Pensa: occhi che vanno in alto a destra (una volta), un sopracciglio alzato. */
#rlc-header[data-lu-state="thinking"] .rlc-lu-pupils {
  opacity: 1;
  transform: translate(12px, -20px);
  animation: rlc-lu-look 420ms var(--rlc-ease) both;
}

#rlc-header[data-lu-state="thinking"] .rlc-lu-brow { opacity: 1; }
#rlc-header[data-lu-state="thinking"] .rlc-lu-brow-l { transform: translateY(-12px); }

/* Contento (prodotti, ordine) e saluta (passaggio a una persona): occhi a mezzaluna, sopracciglia su. */
#rlc-header[data-lu-mood="happy"] .rlc-lu-eye-happy,
#rlc-header[data-lu-mood="wave"] .rlc-lu-eye-happy:not(.rlc-lu-eye-happy-r),
#rlc-header[data-lu-mood="wave"] .rlc-lu-wink,
#rlc-header[data-lu-mood="happy"] .rlc-lu-brow,
#rlc-header[data-lu-mood="wave"] .rlc-lu-brow {
  opacity: 1;
}

#rlc-header[data-lu-mood="happy"] .rlc-lu-brow,
#rlc-header[data-lu-mood="wave"] .rlc-lu-brow {
  transform: translateY(-8px);
}

#rlc-header[data-lu-mood="wave"] .rlc-lu-head {
  transform: rotate(5deg);
  transition-duration: 320ms;
}

/* Preoccupato/attento (guasti, guide): sopracciglia alzate al centro, sguardo un po' giù. */
#rlc-header[data-lu-mood="worried"] .rlc-lu-pupils {
  opacity: 1;
  transform: translateY(6px);
}

#rlc-header[data-lu-mood="worried"] .rlc-lu-brow { opacity: 1; }
#rlc-header[data-lu-mood="worried"] .rlc-lu-brow-l { transform: rotate(-12deg); }
#rlc-header[data-lu-mood="worried"] .rlc-lu-brow-r { transform: rotate(12deg); }

/* Bocca dell'espressione solo a bocca ferma: mentre parla vince l'animazione della bocca. */
#rlc-header[data-lu-mood="happy"]:not([data-lu-speaking="true"]) .rlc-lu-smile,
#rlc-header[data-lu-mood="wave"]:not([data-lu-speaking="true"]) .rlc-lu-smile,
#rlc-header[data-lu-mood="worried"]:not([data-lu-speaking="true"]) .rlc-lu-frown {
  opacity: 1;
}

#rlc-header[data-lu-mood]:not([data-lu-speaking="true"]) .rlc-lu-mouth {
  opacity: 0;
}

@media (min-width: 760px) and (min-height: 440px) {
  .rlc-rail-context:not([hidden]) {
    display: block;
  }

  /* Con un riepilogo i tre punti generici lasciano il posto; con l'attesa resta la sua card. */
  #rlc-panel.rlc-rail-has-context .rlc-rail-welcome-block,
  #rlc-panel.rlc-rail-has-offer .rlc-rail-context,
  #rlc-panel.rlc-rail-has-order .rlc-rail-context,
  #rlc-panel[data-live-state="waiting"] .rlc-rail-context,
  #rlc-panel[data-live-state="assigned"] .rlc-rail-context,
  #rlc-panel[data-live-state="callback"] .rlc-rail-context {
    display: none;
  }

  .rlc-ctx-card {
    padding: 12px;
    border: 1px solid var(--rlc-line);
    border-radius: 12px;
    background: var(--rlc-surface);
    animation: rlc-ctx-in 220ms var(--rlc-ease) both;
  }

  .rlc-ctx-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rlc-ai-text);
  }

  .rlc-ctx-title {
    margin-top: 2px;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--rlc-text);
    font-variant-numeric: tabular-nums;
  }

  .rlc-ctx-line {
    margin-top: 10px;
    font-size: 0.8125rem;
    color: var(--rlc-text-2);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }

  .rlc-ctx-line strong {
    color: var(--rlc-text);
  }

  /* Linea a passi: pieno = fatto, anello con punto = adesso, vuoto = da fare. */
  .rlc-ctx-steps {
    display: grid;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
  }

  .rlc-ctx-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 10px;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--rlc-text-2);
  }

  .rlc-ctx-step:last-child {
    padding-bottom: 0;
  }

  .rlc-ctx-step::before {
    content: "";
    position: absolute;
    top: 16px;
    bottom: 0;
    left: 6px;
    width: 2px;
    background: var(--rlc-line);
  }

  .rlc-ctx-step:last-child::before {
    display: none;
  }

  .rlc-ctx-step[data-state="done"]::before {
    background: var(--rlc-ai);
  }

  .rlc-ctx-mark {
    position: relative;
    flex: none;
    width: 14px;
    height: 14px;
    margin-top: 1px;
    border: 2px solid var(--rlc-line-strong);
    border-radius: 50%;
    background: var(--rlc-surface);
    transition: background-color 220ms var(--rlc-ease), border-color 220ms var(--rlc-ease);
  }

  .rlc-ctx-step[data-state="done"] .rlc-ctx-mark {
    border-color: var(--rlc-ai);
    background: var(--rlc-ai);
  }

  .rlc-ctx-step[data-state="current"] .rlc-ctx-mark {
    border-color: var(--rlc-ai);
    box-shadow: inset 0 0 0 2px var(--rlc-surface);
    background: var(--rlc-accent);
  }

  .rlc-ctx-step[data-state="current"] {
    font-weight: 600;
    color: var(--rlc-text);
  }

  .rlc-ctx-list {
    display: grid;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
  }

  .rlc-ctx-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--rlc-text-2);
  }

  .rlc-ctx-num {
    font-weight: 600;
    color: var(--rlc-text);
    font-variant-numeric: tabular-nums;
  }

  .rlc-ctx-compare li {
    display: grid;
    grid-template-columns: minmax(7.25rem, auto) minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 4px;
    align-items: baseline;
    padding-top: 10px;
    border-top: 1px solid var(--rlc-line);
  }

  .rlc-ctx-compare li:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .rlc-ctx-name {
    grid-column: 1 / -1;
    display: block;
    overflow: visible;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.011em;
    color: var(--rlc-text);
    overflow-wrap: break-word;
  }

  .rlc-ctx-facts {
    display: contents;
    font-variant-numeric: tabular-nums;
  }

  .rlc-ctx-facts > span:first-child {
    font-weight: 650;
    color: var(--rlc-text);
    white-space: nowrap;
  }

  .rlc-ctx-facts > span:last-child:not(:first-child) {
    min-width: 0;
    color: var(--rlc-text-2);
    overflow-wrap: break-word;
  }
}

@keyframes rlc-seg-in {
  from { transform: scaleY(0); }
  to { transform: none; }
}

@keyframes rlc-ctx-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes rlc-lu-look {
  from { transform: translate(-12px, -8px); }
  to { transform: translate(12px, -20px); }
}

@media (prefers-reduced-motion: reduce) {
  /* Le espressioni restano (sono stati), senza testa inclinata. */
  #rlc-header[data-lu-mood="wave"] .rlc-lu-head {
    transform: none;
  }
}

/* ══ 26. Keyframe ═════════════════════════════════════════════════════════ */
@keyframes rlc-dot {
  0%, 60%, 100% { opacity: 0.35; transform: none; }
  30% { opacity: 1; transform: translateY(-2px); }
}

@keyframes rlc-thinking-shine {
  from { background-position: 150% 0; }
  to { background-position: -50% 0; }
}

@keyframes rlc-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes rlc-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rlc-rail-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}

@keyframes rlc-point-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes rlc-path-draw {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes rlc-path-dot {
  from { transform: scale(0.7); }
  to { transform: none; }
}

/* ══ 27. Movimento ridotto: tutto fermo, gli stati restano leggibili ══════ */
@media (prefers-reduced-motion: reduce) {
  #rlc-root *,
  #rlc-root *::before,
  #rlc-root *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  #rlc-panel {
    transition-delay: 0s, 0s !important;
  }

  .rlc-typing span {
    opacity: 0.7;
    animation: none !important;
  }

  .rlc-thinking .rlc-typing-label > span {
    animation: none !important;
    background: none;
    -webkit-text-fill-color: currentColor;
  }

  .rlc-grade-meter i.rlc-on,
  .rlc-ctx-card,
  .rlc-photo-tray,
  #rlc-panel.rlc-open .rlc-rail,
  #rlc-panel.rlc-open .rlc-rail-points li,
  #rlc-panel.rlc-open .rlc-rail-note,
  .rlc-rail-path-step::after,
  .rlc-rail-path-step .rlc-rail-path-dot {
    animation: none !important;
  }

  #rlc-header[data-lu-state="thinking"] .rlc-lu-head {
    transform: none;
  }
}

/* ══ 28. Tema scuro: base navy della barra del sito ══════════════════════════════════ */
#rlc-root[data-theme="dark"] {
  --rlc-canvas: #171a24;
  --rlc-rail-bg: #1d2130;
  --rlc-surface: #232736;
  --rlc-bubble: #241e29;
  --rlc-hover: #2b2431;
  --rlc-line: #343a4d;
  --rlc-line-strong: #4a5169;
  --rlc-field-line: #7a8196;
  --rlc-text: #f3f5fa;
  --rlc-text-2: #aab1c2;
  --rlc-primary: #f5f0f7;
  --rlc-primary-hover: #ffffff;
  --rlc-on-primary: #171a24;
  --rlc-user-bg: #3a4060;
  --rlc-user-text: #f3f5fa;
  --rlc-launcher-bg: #303444;
  --rlc-launcher-hover: #3a4060;
  --rlc-launcher-text: #ffffff;
  --rlc-ai: #8fa3ff;
  --rlc-ai-text: #9fb0ff;
  --rlc-ai-line: #2e3a78;
  --rlc-ai-soft: #1e2540;
  --rlc-avatar-bg: #ead7f0;
  --rlc-thinking-shine: #8ce6e1;
  --rlc-ok: #7fd49b;
  --rlc-ok-soft: #16261c;
  --rlc-ok-dot: #3fbf6f;
  --rlc-warn: #f0b95a;
  --rlc-warn-soft: #2b2214;
  --rlc-warn-line: #5a4320;
  --rlc-warn-dot: #e5a43a;
  --rlc-danger: #ff9b8f;
  --rlc-danger-soft: #2e1716;
  --rlc-danger-line: #5a2a26;
  --rlc-focus: #8fa3ff;
  --rlc-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);
  --rlc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  #rlc-root:not([data-theme="light"]) {
    --rlc-canvas: #171a24;
    --rlc-rail-bg: #1d2130;
    --rlc-surface: #232736;
    --rlc-bubble: #241e29;
    --rlc-hover: #2b2431;
    --rlc-line: #343a4d;
    --rlc-line-strong: #4a5169;
    --rlc-field-line: #7a8196;
    --rlc-text: #f3f5fa;
    --rlc-text-2: #aab1c2;
    --rlc-primary: #f5f0f7;
    --rlc-primary-hover: #ffffff;
    --rlc-on-primary: #171a24;
    --rlc-user-bg: #3a4060;
    --rlc-user-text: #f3f5fa;
    --rlc-launcher-bg: #303444;
    --rlc-launcher-hover: #3a4060;
    --rlc-launcher-text: #ffffff;
    --rlc-ai: #8fa3ff;
    --rlc-ai-text: #9fb0ff;
    --rlc-ai-line: #2e3a78;
    --rlc-ai-soft: #1e2540;
    --rlc-avatar-bg: #ead7f0;
    --rlc-thinking-shine: #8ce6e1;
    --rlc-ok: #7fd49b;
    --rlc-ok-soft: #16261c;
    --rlc-ok-dot: #3fbf6f;
    --rlc-warn: #f0b95a;
    --rlc-warn-soft: #2b2214;
    --rlc-warn-line: #5a4320;
    --rlc-warn-dot: #e5a43a;
    --rlc-danger: #ff9b8f;
    --rlc-danger-soft: #2e1716;
    --rlc-danger-line: #5a2a26;
    --rlc-focus: #8fa3ff;
    --rlc-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);
    --rlc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

/* Il passo corrente in scuro: numero scuro su viola chiaro. */
#rlc-root[data-theme="dark"] .rlc-step-current .rlc-step-num {
  color: #141016;
}

@media (prefers-color-scheme: dark) {
  #rlc-root:not([data-theme="light"]) .rlc-step-current .rlc-step-num {
    color: #141016;
  }
}

/* ══ 29. Contrasto forzato (Windows) ══════════════════════════════════════ */
/* Risposte dalle pagine del sito e dal post-vendita: a capo e liste del testo originale. */
.rlc-msg-card.rlc-msg-formatted-site {
  background: var(--rlc-surface);
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  padding: 14px;
}

.rlc-msg-formatted-site .rlc-msg-para {
  white-space: pre-wrap;
}

.rlc-msg-formatted-site .rlc-msg-list,
.rlc-msg-formatted-postvendita .rlc-msg-list {
  margin-top: 4px;
  padding: 8px 12px 8px 26px;
  border-radius: 8px;
  background: var(--rlc-canvas);
}

.rlc-msg-formatted-postvendita > .rlc-msg-card-content > .rlc-msg-para:first-child {
  font-weight: 600;
  color: var(--rlc-text);
}

@media (forced-colors: active) {
  #rlc-launcher,
  #rlc-panel,
  .rlc-msg,
  .rlc-typing,
  .rlc-thinking,
  .rlc-chip,
  .rlc-intent-pill,
  .rlc-product-card,
  .rlc-site-card,
  .rlc-track-card,
  .rlc-link-card,
  .rlc-msg-card,
  .rlc-support-guide,
  .rlc-composer-bar,
  .rlc-human-cta,
  .rlc-attach,
  .rlc-rail-switch-btn,
  .rlc-live-bar,
  .rlc-report-sheet,
  .rlc-scroll-fab,
  .rlc-ctx-card,
  .rlc-rail-offer-card,
  .rlc-rail-compare-item {
    border: 1px solid CanvasText;
  }

  #rlc-send,
  .rlc-mode-btn,
  .rlc-contact-submit,
  .rlc-report-submit,
  .rlc-report-chip-active {
    border: 1px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }

  .rlc-status-dot,
  .rlc-unread-badge,
  .rlc-rail-ico,
  #rlc-launcher.rlc-launcher-ongoing::after,
  .rlc-step-current .rlc-step-num,
  .rlc-ctx-step[data-state="done"] .rlc-ctx-mark,
  .rlc-ctx-step[data-state="current"] .rlc-ctx-mark,
  .rlc-rail-path-step[data-state="done"] .rlc-rail-path-dot,
  .rlc-rail-path-step[data-state="current"] .rlc-rail-path-dot,
  .rlc-rail-path-step[data-state="done"]::after {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }

  #rlc-root :focus-visible {
    outline-color: Highlight;
  }

  .rlc-composer-bar:focus-within {
    outline: 2px solid Highlight;
  }
}

/* «Aggiungi al carrello»: link a tutta larghezza sotto la card (navigazione Woo). */
.rlc-product-item {
  display: grid;
  gap: 6px;
}

.rlc-cart-add,
.rlc-cart-done {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--rlc-primary);
  color: var(--rlc-on-primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 120ms ease, transform 120ms ease;
}

.rlc-cart-add:active { transform: scale(0.98); }
.rlc-cart-add:disabled { opacity: 0.7; cursor: progress; }

.rlc-cart-done {
  background: var(--rlc-ok-soft);
  color: var(--rlc-ok);
}

.rlc-trade {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--rlc-line);
  border-radius: 12px;
  background: var(--rlc-surface);
  color: var(--rlc-text);
}
.rlc-trade-q {
  margin: 0 0 8px;
  font-weight: 650;
  color: var(--rlc-text);
}
.rlc-trade-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rlc-trade-btn {
  border: 1px solid var(--rlc-line-strong);
  background: var(--rlc-canvas);
  color: var(--rlc-text);
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.rlc-trade-on {
  background: var(--rlc-ai-soft);
  border-color: var(--rlc-ai-line);
  color: var(--rlc-text);
}
.rlc-trade-next { background: var(--rlc-primary); color: var(--rlc-on-primary); border-color: var(--rlc-primary); }
.rlc-trade-hint,
.rlc-trade-value { margin: 8px 0; color: var(--rlc-text-2); }
.rlc-trade-battery {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--rlc-text);
}
.rlc-trade-battery input[type="range"] { flex: 1; }
.rlc-trade-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.rlc-trade-link {
  border: 0;
  background: transparent;
  color: var(--rlc-ai-text);
  cursor: pointer;
  min-height: 44px;
  padding: 8px 0;
}
.rlc-trade-go {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  background: var(--rlc-primary);
  color: var(--rlc-on-primary);
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 14px;
}
.rlc-trade-grade { font-weight: 650; }
