/* ==========================================================================
   KEY FEATURES v2 — Pills compatte + modal overlay
   Filosofia: pagina prodotto = elenco rapido (come datasheet). Nessun expand
   inline. Click → modal leggero con media + testo. Spiegone va su famiglia/range.
   ========================================================================== */

/* ── GLOBAL TOKEN: accento brand (giallo segnale) ────────────────────────── */
/* Definito su :root così var(--kf-accent) funziona anche in #kf-modal-host  */
/* che è appeso a body, fuori da #key-features.                               */
:root{
  --kf-accent: #F4B532;
}

/* ── WIDGET CONTAINER ────────────────────────────────────────────────────── */
#key-features.key-features{
  --kf-pill-h:   38px;
  --kf-icon-sz:  20px;
  --kf-radius:   9px;
  --kf-accent:   #F4B532;   /* giallo segnale — preferito all'ambra per gli elementi interattivi */

  max-width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: clamp(8px, 1.4vw, 18px);
  margin-block: 12px 28px;
}

/* Titolo visivo — nascosto: posizionate sotto Learn More le pills parlano da sole */
#key-features .kf-section-title{
  display: none !important;
}


/* ── PILL GRID ───────────────────────────────────────────────────────────── */
#key-features .kf-list{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 640px){
  #key-features .kf-list{
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 5px;
  }
}


/* ── SINGLE PILL ─────────────────────────────────────────────────────────── */
#key-features .feature-pill{
  /* reset */
  all: unset;
  box-sizing: border-box;

  /* layout */
  display: flex;
  align-items: center;
  gap: 9px;
  height: var(--kf-pill-h);
  padding: 0 12px 0 8px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;   /* iOS: fire tap immediately, skip scroll-intent delay */
  -webkit-tap-highlight-color: transparent;
  width: 100%;

  /* look: glass chiaro */
  background: rgba(255,255,255,.78);
  border-radius: var(--kf-radius);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 2px 6px rgba(0,0,0,.06), inset 0 1px rgba(255,255,255,.80);

  /* tipo */
  font: 700 11.5px/1 "Oswald", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ds-c-text, rgba(0,0,0,.80));

  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 180ms ease,
    transform 120ms ease;
}

/* accento laterale sinistro — doppia linea brand */
#key-features .feature-pill::before{
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--kf-accent);
  border-radius: var(--kf-radius) 0 0 var(--kf-radius);
  opacity: .60;
  transition: opacity 140ms ease, width 140ms ease;
}
#key-features .feature-pill::after{
  content: "";
  position: absolute;
  left: 4px; top: 0; bottom: 0;
  width: 1.5px;
  background: var(--ds-brand-yellow-light, #F3E955);
  opacity: .45;
  transition: opacity 140ms ease;
}

/* hover */
#key-features .feature-pill:hover{
  background: rgba(255,255,255,.94);
  border-color: rgba(0,0,0,.12);
  box-shadow: 0 4px 12px rgba(0,0,0,.09), inset 0 1px rgba(255,255,255,.90);
  transform: translateY(-1px);
}
#key-features .feature-pill:hover::before{ opacity: .85; }
#key-features .feature-pill:hover::after { opacity: .70; }

/* active/selected */
#key-features .feature-pill.is-active,
#key-features .feature-pill[aria-selected="true"]{
  background: linear-gradient(135deg, rgba(244,181,50,.14), rgba(244,181,50,.06));
  border-color: rgba(244,181,50,.50);
  box-shadow:
    0 4px 14px rgba(244,181,50,.14),
    inset 0 1px rgba(255,255,255,.80);
  color: var(--ds-c-text, rgba(0,0,0,.90));
}
#key-features .feature-pill.is-active::before{ opacity: 1; width: 3.5px; }
#key-features .feature-pill.is-active::after { opacity: .80; }

/* focus */
#key-features .feature-pill:focus-visible{
  outline: 2px solid var(--kf-accent);
  outline-offset: 2px;
}

/* icona */
#key-features .feature-icon{
  flex: 0 0 var(--kf-icon-sz);
  width:  var(--kf-icon-sz);
  height: var(--kf-icon-sz);
  display: block;
  object-fit: contain;
  opacity: .80;
  transition: opacity 140ms ease;
}
#key-features .feature-pill:hover    .feature-icon,
#key-features .feature-pill.is-active .feature-icon{ opacity: 1; }

/* icona SVG inline (stroke usa currentColor) */
#key-features .feature-icon.inline svg{
  width: 100%; height: 100%; display: block;
}

/* label */
#key-features .feature-text{
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#key-features .feature-title{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}


/* ── Blocca residui GPT (features-cinematic.js) ─────────────────────────── */
/* Belt-and-suspenders: anche se il file venisse caricato per errore,         */
/* .kf-stage + .kf-detail-close + .kf-curtain non mostrano nulla.            */
#key-features .kf-stage,
#key-features .kf-detail-close,
#key-features .kf-curtain{
  display: none !important;
  pointer-events: none !important;
}

/* ── kf-detail: NASCOSTO INLINE, APERTO COME MODAL ──────────────────────── */

/* Sempre nascosto nella sua posizione originale
   Belt-and-suspenders: anche se JS rimuove [hidden] o .is-open, l'elemento non
   mostra nulla e non occupa spazio (height:0 + overflow:hidden come ulteriore guardia) */
#key-features .kf-detail,
#key-features .kf-detail[hidden],
#key-features .kf-detail:not(.is-open){
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Quando JS toglie hidden + setta aria-hidden="false",
   lo "parcheggiamo" fuori dal flusso come modal fixed */
.kf-modal-open{
  overflow: hidden;  /* blocca scroll body mentre modal è aperto */
}


/* ── KF MODAL OVERLAY ────────────────────────────────────────────────────── */
/* Creato da JS in #kf-modal-host (appeso a body) */

#kf-modal-host{
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);

  /* nascosto di default */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}
#kf-modal-host.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Backdrop */
#kf-modal-host .kfm-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(8,6,4,.62);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  cursor: pointer;
}

/* Dialog */
#kf-modal-host .kfm-dialog{
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);          /* più largo per la sidebar */
  max-height: min(680px, calc(100dvh - 32px));
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;  /* head | main | foot */

  background: rgba(255,255,255,.96);
  box-shadow:
    0 32px 80px rgba(0,0,0,.36),
    inset 0 1px rgba(255,255,255,.90);

  transform: translateY(10px) scale(.98);
  transition: transform 260ms cubic-bezier(.34,1.52,.64,1);
}
#kf-modal-host.is-open .kfm-dialog{
  transform: translateY(0) scale(1);
}

/* Header modal */
#kf-modal-host .kfm-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(0,0,0,.07);
  background: linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.70));
}
#kf-modal-host .kfm-title{
  margin: 0;
  font: 700 1.05rem/1.1 "Oswald", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(0,0,0,.88);
}
#kf-modal-host .kfm-close{
  all: unset;
  box-sizing: border-box;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  background: rgba(0,0,0,.07);
  color: rgba(0,0,0,.65);
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background 140ms ease, color 140ms ease;
}
#kf-modal-host .kfm-close:hover{
  background: rgba(0,0,0,.12);
  color: rgba(0,0,0,.90);
}
#kf-modal-host .kfm-close:focus-visible{
  outline: 2px solid var(--kf-accent);
  outline-offset: 2px;
}

/* Eyebrow — etichetta secondaria sopra il titolo */
#kf-modal-host .kfm-eyebrow{
  display: block;
  font: 600 9.5px/1 "Oswald", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--kf-accent, #F4B532);
  margin-bottom: 3px;
  opacity: .85;
}


/* ── MAIN AREA: sidebar + body ───────────────────────────────────────────── */
#kf-modal-host .kfm-main{
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── SIDEBAR: pannello pill verticale ────────────────────────────────────── */
#kf-modal-host .kfm-sidebar{
  width: 200px;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-right: 1px solid rgba(0,0,0,.07);
  background: rgba(248,247,244,.80);
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.15) transparent;
}

/* ── Singola pill nella sidebar ──────────────────────────────────────────── */
#kf-modal-host .kfm-pill{
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 120ms ease, border-color 120ms ease;
}
#kf-modal-host .kfm-pill:hover{
  background: rgba(255,255,255,.85);
  border-color: rgba(0,0,0,.08);
}
#kf-modal-host .kfm-pill.is-active{
  background: rgba(255,255,255,.95);
  border-color: rgba(244,181,50,.45);
  box-shadow: 0 2px 8px rgba(201,168,0,.12);
}
#kf-modal-host .kfm-pill:focus-visible{
  outline: 2px solid var(--kf-accent, #F4B532);
  outline-offset: 2px;
}

/* ── Cerchio icona (stessa estetica del carousel) ────────────────────────── */
#kf-modal-host .kfm-pill-icon-circle{
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, box-shadow 140ms ease;
}
#kf-modal-host .kfm-pill.is-active .kfm-pill-icon-circle{
  background: #F4B532;
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.70), 0 2px 6px rgba(201,168,0,.32);
}
#kf-modal-host .kfm-pill:hover:not(.is-active) .kfm-pill-icon-circle{
  background: rgba(0,0,0,.10);
}

#kf-modal-host .kfm-pill-icon{
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: block;
  opacity: .75;
}
#kf-modal-host .kfm-pill-icon.inline svg{
  width: 14px; height: 14px; display: block;
}
#kf-modal-host .kfm-pill.is-active .kfm-pill-icon{ opacity: 1; }

/* ── Label testo pill ────────────────────────────────────────────────────── */
#kf-modal-host .kfm-pill-label{
  font: 700 10.5px/1.25 "Oswald", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(0,0,0,.65);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 120ms ease;
}
#kf-modal-host .kfm-pill.is-active .kfm-pill-label{ color: rgba(0,0,0,.88); }
#kf-modal-host .kfm-pill:hover .kfm-pill-label{ color: rgba(0,0,0,.80); }

/* ── Mobile (<680px): sidebar collassa in strip orizzontale ──────────────── */
@media (max-width: 679px){
  #kf-modal-host .kfm-main{ flex-direction: column; }
  #kf-modal-host .kfm-sidebar{
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,.07);
    padding: 6px 8px;
    gap: 5px;
    max-height: 64px;
  }
  #kf-modal-host .kfm-pill{
    flex-direction: row;
    min-height: 48px;
    width: auto;
    flex-shrink: 0;
    padding: 0 10px 0 6px;
    white-space: nowrap;
  }
  #kf-modal-host .kfm-pill-label{
    display: block;
    -webkit-line-clamp: unset;
    white-space: nowrap;
  }
}


/* Corpo modal: media (sx) + testo (dx) su desktop, stack su mobile */
#kf-modal-host .kfm-body{
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}
@media (min-width: 680px){
  #kf-modal-host .kfm-body.has-media{
    grid-template-columns: 55% 45%;
  }
}

/* zona media */
#kf-modal-host .kfm-media{
  background: rgba(0,0,0,.88);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  position: relative;
}
#kf-modal-host .kfm-media img,
#kf-modal-host .kfm-media video{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* nessun media: zona media collassa */
#kf-modal-host .kfm-body:not(.has-media) .kfm-media{
  display: none;
}

/* ── .kf-media (wrapper da renderMediaHTML): riempie .kfm-media ──────────── */
#kf-modal-host .kfm-media .kf-media{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* Gallery dentro modal: fill + position context per le frecce overlay */
#kf-modal-host .kfm-media .kf-gallery{
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#kf-modal-host .kfm-media .kf-gallery-stage{
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Slides dentro modal: stessa struttura a colonna */
#kf-modal-host .kfm-media .kf-slides{
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#kf-modal-host .kfm-media .kf-slides-stage{
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#kf-modal-host .kfm-media .kf-slides-media{
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Main text già in .kfm-text → nascosto nella zona media */
#kf-modal-host .kfm-media .kf-slides-main{ display: none !important; }
/* Caption per-slide: strip compatta in fondo alla media */
#kf-modal-host .kfm-media .kf-slides-text{
  flex-shrink: 0;
  padding: 7px 14px;
  background: rgba(0,0,0,.52);
  font-size: .82rem;
  line-height: 1.4;
  color: rgba(255,255,255,.78);
  text-align: center;
  max-height: 72px;
  overflow-y: auto;
}
#kf-modal-host .kfm-media .kf-slides-caption:empty + * ,
#kf-modal-host .kfm-media .kf-slides-text:empty{ display: none; }

/* ── Frecce prev/next overlay (gallery e slides) ─────────────────────────── */
/* Stesso stile 3D brand-yellow di .kf-rail-btn, ma overlay sulla zona media  */
#kf-modal-host .kf-g-prev,
#kf-modal-host .kf-g-next{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #F4B532;
  /* Sess.25 flat-ten: niente 3D drop. Microelevation + glow on hover. */
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: #1a1a1a;
  font-size: 0;           /* nasconde eventuali char di fallback */
  /* fade in al hover della zona media */
  opacity: 0;
  transition:
    opacity 180ms ease,
    background 180ms var(--ds-ease-std, cubic-bezier(.4,0,.2,1)),
    box-shadow 200ms var(--ds-ease-std, cubic-bezier(.4,0,.2,1)),
    transform 120ms var(--ds-ease-std, cubic-bezier(.4,0,.2,1));
}
#kf-modal-host .kf-g-prev svg,
#kf-modal-host .kf-g-next svg{
  display: block;
  stroke: #1a1a1a;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
/* Mostra frecce al hover della zona media o per focus-visible */
#kf-modal-host .kfm-media:hover .kf-g-prev,
#kf-modal-host .kfm-media:hover .kf-g-next,
#kf-modal-host .kf-g-prev:focus-visible,
#kf-modal-host .kf-g-next:focus-visible{ opacity: 1; }
#kf-modal-host .kf-g-prev{ left: 10px; }
#kf-modal-host .kf-g-next{ right: 10px; }
#kf-modal-host .kf-g-prev:hover,
#kf-modal-host .kf-g-next:hover{
  opacity: 1;
  background: #E8C000;
  box-shadow:
    0 0 0 1px rgba(201,168,0,.45),
    0 5px 16px rgba(255,209,0,.35);
  transform: translateY(calc(-50% - 1px));
}
#kf-modal-host .kf-g-prev:active,
#kf-modal-host .kf-g-next:active{
  transform: translateY(-50%) scale(0.94);
  box-shadow: 0 1px 3px rgba(0,0,0,.14);
}
#kf-modal-host .kf-g-prev:focus-visible,
#kf-modal-host .kf-g-next:focus-visible{
  outline: 2px solid #F4B532;
  outline-offset: 2px;
}

/* ── Counter overlay (bottom-right della zona media) ─────────────────────── */
#kf-modal-host .kf-g-counter{
  position: absolute;
  bottom: 8px;
  right: 10px;
  z-index: 3;
  font: 600 11px/1 "Oswald", system-ui, sans-serif;
  letter-spacing: .05em;
  color: rgba(255,255,255,.72);
  background: rgba(0,0,0,.40);
  border-radius: 999px;
  padding: 3px 9px;
  pointer-events: none;
  user-select: none;
}

/* zona testo */
#kf-modal-host .kfm-text{
  padding: 20px 22px;
  overflow-y: auto;
  line-height: 1.60;
  font-size: .95rem;
  color: rgba(0,0,0,.82);
}
#kf-modal-host .kfm-text h3{
  margin: 0 0 10px;
  font: 700 1rem/1.1 "Oswald", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(0,0,0,.90);
}
/* ── TEXT-ONLY: centrato verticalmente + lineette brand ──────────────────── */
#kf-modal-host .kfm-body.is-text-only{
  display: flex;          /* override grid */
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* fallback (belt-and-suspenders) se la classe JS non è ancora stata aggiunta */
#kf-modal-host .kfm-body:not(.has-media) .kfm-text,
#kf-modal-host .kfm-body.is-text-only    .kfm-text{
  max-width: 560px;
  width: 100%;
  max-height: 100%;
  margin-inline: auto;
  padding: 36px 44px;
  overflow-y: auto;
  text-align: center;
}
/* Frame a doppia riga specchiato — usa la palette BRAND (non kf-accent).
   --ds-brand-yellow-dark  #F4B532 · riga spessa (identico agli accent bar family/product)
   --ds-brand-yellow-light #F3E955 · riga sottile
   Gap 3px. Totale altezza 7.5px. */
#kf-modal-host .kfm-body.is-text-only .kfm-text::before,
#kf-modal-host .kfm-body.is-text-only .kfm-text::after{
  content: "";
  display: block;
  height: 7.5px;   /* 3px + 3px gap + 1.5px */
  border-radius: 1px;
}
/* TOP: brand-dark spessa → gap → brand-light sottile */
#kf-modal-host .kfm-body.is-text-only .kfm-text::before{
  background: linear-gradient(to bottom,
    #F4B532              0px, #F4B532              3px,
    transparent          3px, transparent          6px,
    rgba(243,233,85,.55) 6px, rgba(243,233,85,.55) 7.5px
  );
  margin-bottom: 24px;
}
/* BOTTOM (specchio): brand-light sottile → gap → brand-dark spessa */
#kf-modal-host .kfm-body.is-text-only .kfm-text::after{
  background: linear-gradient(to bottom,
    rgba(243,233,85,.55) 0px,  rgba(243,233,85,.55) 1.5px,
    transparent          1.5px, transparent          4.5px,
    #F4B532              4.5px, #F4B532              7.5px
  );
  margin-top: 24px;
}

/* ── SLIDES layout: media più largo + pannello caption live ──────────────── */
@media (min-width: 680px){
  #kf-modal-host .kfm-body.has-slides.has-media{
    grid-template-columns: 62% 38%;
  }
}
/* Pannello testo slides: colonna flex (overview + caption) */
#kf-modal-host .kfm-body.has-slides .kfm-text{
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
/* Nascondi caption overlay nella zona media — è nel pannello */
#kf-modal-host .kfm-body.has-slides .kfm-media .kf-slides-text{ display: none !important; }

/* Header overview: descrizione feature, sottile e discreta */
#kf-modal-host .kfm-body.has-slides .kfm-slide-main{
  flex-shrink: 0;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: rgba(248,247,244,.60);
}
#kf-modal-host .kfm-body.has-slides .kfm-slide-main:empty{ display: none; }
#kf-modal-host .kfm-body.has-slides .kfm-slide-overview{
  margin: 0;
  font-size: .79rem;
  line-height: 1.55;
  color: rgba(0,0,0,.46);
  font-style: italic;
}

/* Caption corrente: protagonista, centrata verticalmente se breve */
#kf-modal-host .kfm-body.has-slides .kfm-slide-caption{
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px;
  font-size: .93rem;
  line-height: 1.70;
  color: rgba(0,0,0,.82);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#kf-modal-host .kfm-body.has-slides .kfm-slide-caption:empty::after{
  content: "—";
  color: rgba(0,0,0,.18);
  font-size: 1.6rem;
  text-align: center;
  line-height: 1;
}

/* Footer modal: navigazione prev/next */
#kf-modal-host .kfm-foot{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.80);
}
#kf-modal-host .kfm-nav-btn{
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.85);
  font: 600 11px/1 "Oswald", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(0,0,0,.75);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 100ms ease;
}
#kf-modal-host .kfm-nav-btn:hover{
  background: rgba(255,255,255,1);
  border-color: rgba(0,0,0,.18);
  transform: translateY(-1px);
}
#kf-modal-host .kfm-counter{
  font: 600 11px/1 "Oswald", system-ui, sans-serif;
  letter-spacing: .06em;
  color: rgba(0,0,0,.45);
  min-width: 40px;
  text-align: center;
}


/* ── DARK MODE ───────────────────────────────────────────────────────────── */
body.ds-dark #key-features .feature-pill{
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.10);
  color: var(--ds-c-text, rgba(232,230,224,.90));
  box-shadow: 0 2px 8px rgba(0,0,0,.30), inset 0 1px rgba(255,255,255,.05);
}
body.ds-dark #key-features .feature-pill:hover{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 4px 14px rgba(0,0,0,.40), inset 0 1px rgba(255,255,255,.07);
}
body.ds-dark #key-features .feature-pill.is-active{
  background: rgba(244,181,50,.12);
  border-color: rgba(244,181,50,.40);
  box-shadow: 0 4px 14px rgba(0,0,0,.40);
}

body.ds-dark #kf-modal-host .kfm-dialog{
  background: #1a1714;
  box-shadow: 0 32px 80px rgba(0,0,0,.70), inset 0 1px rgba(255,255,255,.06);
}
body.ds-dark #kf-modal-host .kfm-head{
  background: linear-gradient(180deg, rgba(26,23,18,.95), rgba(18,16,12,.80));
  border-bottom-color: rgba(255,255,255,.08);
}
body.ds-dark #kf-modal-host .kfm-title{ color: rgba(232,230,224,.92); }
body.ds-dark #kf-modal-host .kfm-close{
  background: rgba(255,255,255,.08);
  color: rgba(218,216,210,.80);
}
body.ds-dark #kf-modal-host .kfm-close:hover{
  background: rgba(255,255,255,.14);
  color: rgba(232,230,224,1);
}
body.ds-dark #kf-modal-host .kfm-text{
  color: rgba(218,216,210,.88);
}
body.ds-dark #kf-modal-host .kfm-text h3{ color: rgba(232,230,224,.92); }
body.ds-dark #kf-modal-host .kfm-foot{
  background: rgba(18,16,12,.80);
  border-top-color: rgba(255,255,255,.07);
}
body.ds-dark #kf-modal-host .kfm-nav-btn{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
  color: rgba(218,216,210,.88);
}
body.ds-dark #kf-modal-host .kfm-nav-btn:hover{
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.18);
}
body.ds-dark #kf-modal-host .kfm-counter{ color: rgba(218,216,210,.45); }

body.ds-dark #kf-modal-host .kfm-eyebrow{ color: var(--kf-accent, #F4B532); }

/* Sidebar */
body.ds-dark #kf-modal-host .kfm-sidebar{
  background: rgba(20,18,14,.80);
  border-right-color: rgba(255,255,255,.08);
}

/* Pill (sfondo trasparente su sidebar scura) */
body.ds-dark #kf-modal-host .kfm-pill{ background: transparent; border-color: transparent; }
body.ds-dark #kf-modal-host .kfm-pill:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.10);
}
body.ds-dark #kf-modal-host .kfm-pill.is-active{
  background: rgba(244,181,50,.12);
  border-color: rgba(244,181,50,.35);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

/* Icon circle dark */
body.ds-dark #kf-modal-host .kfm-pill-icon-circle{ background: rgba(255,255,255,.10); }
body.ds-dark #kf-modal-host .kfm-pill:hover:not(.is-active) .kfm-pill-icon-circle{ background: rgba(255,255,255,.15); }
body.ds-dark #kf-modal-host .kfm-pill.is-active .kfm-pill-icon-circle{
  background: #E6BB00;
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.25), 0 2px 8px rgba(0,0,0,.40);
}
body.ds-dark #kf-modal-host .kfm-pill-icon{ opacity: .80; }
body.ds-dark #kf-modal-host .kfm-pill.is-active .kfm-pill-icon{ opacity: 1; }

/* Label dark */
body.ds-dark #kf-modal-host .kfm-pill-label{ color: rgba(218,216,210,.58); }
body.ds-dark #kf-modal-host .kfm-pill:hover .kfm-pill-label{ color: rgba(232,230,224,.80); }
body.ds-dark #kf-modal-host .kfm-pill.is-active .kfm-pill-label{ color: rgba(232,230,224,.92); }

/* Frecce gallery/slides overlay dark — flat brand yellow coerente con kf-rail-btn */
body.ds-dark #kf-modal-host .kf-g-prev,
body.ds-dark #kf-modal-host .kf-g-next{
  background: #F4B532;
  color: #1a1a1a;
  box-shadow: 0 1px 4px rgba(0,0,0,.55);
}
body.ds-dark #kf-modal-host .kf-g-prev svg,
body.ds-dark #kf-modal-host .kf-g-next svg{ stroke: #1a1a1a; }
body.ds-dark #kf-modal-host .kf-g-prev:hover,
body.ds-dark #kf-modal-host .kf-g-next:hover{
  background: #E8C000;
  box-shadow:
    0 0 0 1px rgba(201,168,0,.55),
    0 5px 20px rgba(255,209,0,.42),
    0 1px 4px rgba(0,0,0,.55);
}
body.ds-dark #kf-modal-host .kf-g-prev:active,
body.ds-dark #kf-modal-host .kf-g-next:active{
  box-shadow: 0 1px 3px rgba(0,0,0,.60);
}


/* ═══════════════════════════════════════════════════════════════════════════
   KF CAROUSEL — attivo quando il JS aggiunge .as-carousel2 a .kf-list
   Usato esclusivamente quando KF è nella .top-right-col (col. destra hero)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Contenitore carousel 2 righe: CSS grid column-flow + scroll orizzontale snap */
#key-features .kf-list.as-carousel2{
  display: grid !important;
  grid-template-columns: none !important; /* annulla repeat(auto-fill,minmax(210px,1fr)) del base: senza questo
                                             le prime N pill finiscono in colonne esplicite larghissime (210px+)
                                             e le restanti in colonne implicite strette — tutte le colonne devono
                                             essere SOLO implicite, dimensionate da grid-auto-columns */
  grid-template-rows: repeat(2, 74px);    /* fisso → entrambe le righe identiche */
  grid-auto-flow: column;
  /* Larghezza colonna calcolata da JS (--kf-col-px) in pixel esatti:
     JS misura WRAP.clientWidth - 2×margin, divide per N colonne con gap.
     Fallback CSS 80px: mai usato in pratica ma evita colonne a 0 al primo paint. */
  grid-auto-columns: var(--kf-col-px, 80px);
  overflow-x: scroll !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 5px !important;
  padding: 0 0 6px !important;
  /* Corridoio sicuro: le frecce (28px) sono a left/right:2px nel kf-rail.
     margin-inline = 36px sposta il kf-list DENTRO le frecce →
     le pill non passano mai sotto le frecce, nessuna pill parzialmente visibile. */
  margin-inline: 36px !important;
  align-items: start;
}
#key-features .kf-list.as-carousel2::-webkit-scrollbar{ display: none; }

/* ── Modalità riga singola: attivata dal JS quando KF.clientHeight < 185px ──
   Sostituisce la doppia riga CSS-only (che usava media query di larghezza,
   meno precisa). Il JS misura l'altezza reale disponibile dopo il layout. */
#key-features .kf-list.as-carousel2.kf-single-row{
  grid-template-rows: 74px !important;            /* 1 riga × 74px */
  /* JS ricalcola --kf-col-px con N=4 per riga singola */
  grid-auto-columns: var(--kf-col-px, 80px) !important;
  margin-inline: 36px !important;
}

/* Centrato quando le pill non riempiono il container (JS aggiunge .kf-centered) */
#key-features .kf-list.as-carousel2.kf-centered{
  justify-content: center;
}

/* Pill in carousel 2-righe: rimuove flex, mantiene snap */
#key-features .kf-list.as-carousel2 .feature-pill{
  width: 100% !important;       /* riempie la colonna grid */
  flex: none !important;
  scroll-snap-align: start;     /* ogni pill snappa (stesso X per le 2 del colonna) */
  scroll-snap-stop: always;     /* forza stop su ogni colonna: scroll col-by-col */
  transition: opacity 200ms ease, transform 200ms ease,
              background 140ms ease, box-shadow 180ms ease !important;
}

/* ── Frecce prev/next: flat brand yellow (sess.25 flat-ten) ─────────────── */
#key-features .kf-rail-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;           /* cerchio — coerente con brand dot motif e pill buttons */
  border: none;
  background: #F4B532;
  /* Flat: niente 3D drop. Microelevation soft + glow on hover. */
  box-shadow: 0 1px 2px rgba(0,0,0,.10);
  display: none;               /* mostrate da JS */
  place-items: center;
  cursor: pointer;
  padding: 0;
  color: #1a1a1a;
  z-index: 4;
  transition:
    background 180ms var(--ds-ease-std, cubic-bezier(.4,0,.2,1)),
    box-shadow 200ms var(--ds-ease-std, cubic-bezier(.4,0,.2,1)),
    transform  120ms var(--ds-ease-std, cubic-bezier(.4,0,.2,1));
}
#key-features .kf-rail-btn svg{
  display: block;
  stroke: #1a1a1a;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
#key-features .kf-rail-btn:hover{
  background: #E8C000;
  box-shadow:
    0 0 0 1px rgba(201,168,0,.45),
    0 4px 14px rgba(255,209,0,.32);
  transform: translateY(calc(-50% - 1px));
}
#key-features .kf-rail-btn:active{
  transform: translateY(-50%) scale(0.94);
  box-shadow: 0 1px 3px rgba(0,0,0,.14);
}
/* Posizionamento: inside card padding, non a filo bordo */
#key-features .kf-rail-btn.prev{ left: 2px; }
#key-features .kf-rail-btn.next{ right: 2px; }

/* .kf-rail (wrapper delle pills) — relative per le frecce assolute */
#key-features .kf-rail{
  position: relative;
}

/* dark mode frecce — flat con leggera elevation, glow brand al hover */
body.ds-dark #key-features .kf-rail-btn{
  background: #F4B532;          /* mantiene brand yellow anche su dark */
  color: #1a1a1a;
  box-shadow: 0 1px 4px rgba(0,0,0,.55);
}
body.ds-dark #key-features .kf-rail-btn svg{
  stroke: #1a1a1a;
}
body.ds-dark #key-features .kf-rail-btn:hover{
  background: #E8C000;
  box-shadow:
    0 0 0 1px rgba(201,168,0,.55),
    0 4px 18px rgba(255,209,0,.40),
    0 1px 4px rgba(0,0,0,.55);
}
body.ds-dark #key-features .kf-rail-btn:active{
  box-shadow: 0 1px 3px rgba(0,0,0,.60);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PILL VERTICALE — attiva nel carousel della right-col
   Icona grande centrata · label centrata sotto · raised↔inset toggle
   ═══════════════════════════════════════════════════════════════════════════ */

#key-features .kf-list.as-carousel2 .feature-pill{
  /* layout verticale */
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;

  /* dimensioni compatte: quadrato arrotondato */
  height: 100% !important;       /* riempie la cella fissa 74px del grid */
  min-height: unset !important;  /* non serve più: è la row-height a governare */
  padding: 8px 4px 6px !important;
  overflow: hidden !important;   /* clip del testo lungo */

  /* forma: niente bordo marcato */
  border-radius: 12px !important;
  border: none !important;

  /* raised — compatibile con glass card */
  background: rgba(255,255,255,.82) !important;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.92),   /* highlight superiore */
    0 4px 12px rgba(0,0,0,.10),
    0 1px 3px rgba(0,0,0,.06) !important;
}

/* Rimuovi accent bar laterale sinistra (layout orizzontale → non applicabile) */
#key-features .kf-list.as-carousel2 .feature-pill::before,
#key-features .kf-list.as-carousel2 .feature-pill::after{
  display: none !important;
}

/* ── Cerchio icona (brand dot motif) ─────────────────────────────────────── */
/* Nel carousel verticale l'icona è contenuta in una "bolla" circolare gialla  */
#key-features .kf-list.as-carousel2 .pill-icon-circle{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #F4B532;
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.70),   /* highlight superiore */
    0 2px 6px rgba(201,168,0,.32);
  flex-shrink: 0;
  transition: box-shadow 140ms ease, background 140ms ease;
}

/* Icona SVG/img dentro il cerchio */
#key-features .kf-list.as-carousel2 .pill-icon-circle .feature-icon{
  flex: none !important;
  width: 15px !important;
  height: 15px !important;
  color: #1a1a1a !important;
  opacity: 1 !important;
}
#key-features .kf-list.as-carousel2 .pill-icon-circle .feature-icon.inline svg{
  width: 15px;
  height: 15px;
  stroke: #1a1a1a;
}

/* Hover: cerchio si illumina leggermente */
#key-features .kf-list.as-carousel2 .feature-pill:hover .pill-icon-circle{
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.80),
    0 4px 10px rgba(201,168,0,.42);
}

/* Active/pressed: cerchio si "abbassa" (inset) */
#key-features .kf-list.as-carousel2 .feature-pill.is-active .pill-icon-circle,
#key-features .kf-list.as-carousel2 .feature-pill[aria-selected="true"] .pill-icon-circle{
  background: #FFC400;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,.15),
    inset 0 -1px 0 rgba(255,255,255,.30);
}

/* dark mode: cerchio leggermente più scuro */
body.ds-dark #key-features .kf-list.as-carousel2 .pill-icon-circle{
  background: #E6BB00;
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.25),
    0 2px 6px rgba(0,0,0,.35);
}
body.ds-dark #key-features .kf-list.as-carousel2 .pill-icon-circle .feature-icon,
body.ds-dark #key-features .kf-list.as-carousel2 .pill-icon-circle .feature-icon.inline svg{
  color: #111 !important;
  stroke: #111 !important;
}
body.ds-dark #key-features .kf-list.as-carousel2 .feature-pill.is-active .pill-icon-circle{
  background: #CC9D00;
}

/* Nel layout GRIGLIA normale: cerchio invisibile (solo wrapper trasparente) */
#key-features .kf-list:not(.as-carousel2) .pill-icon-circle{
  display: contents; /* il figlio va direttamente nel flex flow della pill */
}

/* Icona */
#key-features .kf-list.as-carousel2 .feature-pill .feature-icon{
  flex: none !important;
  width: 15px !important;
  height: 15px !important;
}

/* Label: centrata, wrap consentito */
#key-features .kf-list.as-carousel2 .feature-pill .feature-text{
  flex: none !important;
  text-align: center !important;
  overflow: hidden !important;
  width: 100%;
}
#key-features .kf-list.as-carousel2 .feature-pill .feature-title{
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: center !important;
  line-height: 1.2 !important;
  font-size: 10px !important;
  /* ⚠️ V-57 — i titoli si tagliavano a 390, 1150 e 1920. Non era «poco
     spazio»: le DUE righe c'erano gia' (`line-clamp: 2`), ma una PAROLA
     SINGOLA piu' larga della card non puo' andare a capo con
     `overflow-wrap: normal`. A 1920 la card e' larga 61 px e
     «configurabile» ne chiede 71: 18 px tagliati via netti, senza nemmeno i
     puntini, perche' l'ellissi non compare a meta' di una parola.
     ⛔ Allargare la card era la strada gia' bocciata da David sulle
     targhette (V-04): il contenitore non insegue il testo.
     ⇒ Si da' al testo il permesso di spezzarsi. `hyphens: auto` con
     `lang="it"` sillaba in italiano (con-fi-gu-ra-bi-le) e usa le due righe
     che ci sono gia'; `overflow-wrap: anywhere` e' la rete per le parole che
     il vocabolario non sa sillabare (sigle, codici).
     📌 Vale per TUTTE le fasce e per tutti i titoli, presenti e futuri: non
     e' un rimedio a «Menu configurabile», e' la regola che mancava. */
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: anywhere;
}

/* Hover: lift */
#key-features .kf-list.as-carousel2 .feature-pill:hover{
  transform: translateY(-2px) !important;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.92),
    0 8px 18px rgba(0,0,0,.13),
    0 2px 4px rgba(0,0,0,.08) !important;
}

/* Active/pressed: inset — il pill "si incassa" */
#key-features .kf-list.as-carousel2 .feature-pill.is-active,
#key-features .kf-list.as-carousel2 .feature-pill[aria-selected="true"]{
  background: rgba(244,243,240,.90) !important;
  border: none !important;
  box-shadow:
    inset 0 3px 7px rgba(0,0,0,.15),       /* ombra superiore interna */
    inset 0 -1px 2px rgba(255,255,255,.65), /* luce inferiore interna */
    0 1px 0 rgba(255,255,255,.6) !important;
  transform: translateY(1px) !important;
}
#key-features .kf-list.as-carousel2 .feature-pill.is-active .feature-icon,
#key-features .kf-list.as-carousel2 .feature-pill[aria-selected="true"] .feature-icon{
  color: #F4B532 !important;
  opacity: 1 !important;
}

/* dark mode pill carousel */
body.ds-dark #key-features .kf-list.as-carousel2 .feature-pill{
  background: rgba(40,38,32,.72) !important;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.08),
    0 4px 12px rgba(0,0,0,.30),
    0 1px 3px rgba(0,0,0,.20) !important;
}
body.ds-dark #key-features .kf-list.as-carousel2 .feature-pill.is-active,
body.ds-dark #key-features .kf-list.as-carousel2 .feature-pill[aria-selected="true"]{
  background: rgba(28,26,20,.88) !important;
  box-shadow:
    inset 0 3px 7px rgba(0,0,0,.45),
    inset 0 -1px 2px rgba(255,255,255,.06),
    0 1px 0 rgba(255,255,255,.06) !important;
}

/* ── Hint text: sotto il carousel ────────────────────────────────────────── */
.kf-hint{
  display: block;
  padding: 0 4px;
  margin-top: 4px;              /* ridotto: evita disallineamento bottom con hero card */
  text-align: center;
  font: 400 10px/1 "Oswald", system-ui, sans-serif;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(60,60,60,.48);
  user-select: none;
  pointer-events: none;
  transition: opacity 2s ease 0.8s;  /* più lenta + delay: non sparisce come un errore */
}
.kf-hint.is-hidden{ opacity: 0; }
body.ds-dark .kf-hint{ color: rgba(220,216,204,.38); }

/* ── Dark mode: text-only e slides layout ────────────────────────────────── */
/* Dark: brand-dark attenuata (.60), brand-light più discreta (.30) */
body.ds-dark #kf-modal-host .kfm-body.is-text-only .kfm-text::before{
  background: linear-gradient(to bottom,
    rgba(244,181,50,.60) 0px,  rgba(244,181,50,.60) 3px,
    transparent          3px,  transparent          6px,
    rgba(243,233,85,.30) 6px,  rgba(243,233,85,.30) 7.5px
  );
}
body.ds-dark #kf-modal-host .kfm-body.is-text-only .kfm-text::after{
  background: linear-gradient(to bottom,
    rgba(243,233,85,.30) 0px,  rgba(243,233,85,.30) 1.5px,
    transparent          1.5px, transparent          4.5px,
    rgba(244,181,50,.60) 4.5px, rgba(244,181,50,.60) 7.5px
  );
}
body.ds-dark #kf-modal-host .kfm-body.has-slides .kfm-slide-main{
  background: rgba(20,18,14,.60);
  border-bottom-color: rgba(255,255,255,.07);
}
body.ds-dark #kf-modal-host .kfm-body.has-slides .kfm-slide-overview{ color: rgba(218,216,210,.40); }
body.ds-dark #kf-modal-host .kfm-body.has-slides .kfm-slide-caption{ color: rgba(218,216,210,.88); }
body.ds-dark #kf-modal-host .kfm-body.has-slides .kfm-slide-caption:empty::after{ color: rgba(255,255,255,.14); }
