/* ═══════════════════════════════════════════════════════════════
   clearfin — landing direttore finanziario
   Estende style.css: qui solo override e componenti nuovi.
   ═══════════════════════════════════════════════════════════════ */

.cfo-page {
  --cfo-ink:      #10141a;
  --cfo-ink-soft: #1b212a;
  --cfo-line:     rgba(255,255,255,0.10);
  --cfo-accent:   #494fdf;
  --cfo-grid:     rgba(25,28,31,0.055);
}

/* ───────────────────────── HERO ───────────────────────── */
.cfo-hero {
  padding: 6.5rem 1.5rem 4.5rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% -5%, var(--rui-teal-tint), transparent 70%),
    linear-gradient(180deg, rgba(73,79,223,0.05), transparent 45%),
    var(--rui-white);
  position: relative;
}
.cfo-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--cfo-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--cfo-grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 0%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 65% 60% at 50% 0%, #000, transparent 75%);
  pointer-events: none;
  z-index: 0;
}
.cfo-hero .hero-inner { position: relative; z-index: 1; max-width: 880px; }
.cfo-hero h2 { font-size: clamp(2.35rem, 5.8vw, 4.1rem); }
.cfo-hero .hero-sub { max-width: 660px; }

/* ───────────────────────── IL PROBLEMA ───────────────────────── */
.cfo-problem { padding: 5.5rem 1.5rem 5rem; }
.cfo-pain-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
.cfo-pain {
  border: 1px solid var(--rui-border);
  border-radius: var(--radius-card);
  padding: 1.7rem 1.5rem;
  background: var(--rui-white);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.cfo-pain:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: rgba(0,168,126,0.35);
}
.cfo-pain-mark {
  display: block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--rui-teal);
  margin-bottom: 1rem;
}
.cfo-pain h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--rui-dark);
}
.cfo-pain p { color: var(--rui-text-2); font-size: 0.93rem; }

/* ───────────────────────── COME FUNZIONA (dark) ───────────────────────── */
.cfo-how {
  padding: 5.5rem 1.5rem;
  background: var(--cfo-ink);
}
.cfo-steps {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.cfo-step {
  background: var(--cfo-ink-soft);
  border: 1px solid var(--cfo-line);
  border-radius: var(--radius-card);
  padding: 2rem 1.7rem;
  display: flex;
  flex-direction: column;
}
.cfo-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--rui-teal);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.3rem;
}
.cfo-step h3 {
  color: #fff;
  font-size: 1.28rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}
.cfo-step p {
  color: rgba(255,255,255,0.72);
  font-size: 0.96rem;
  flex: 1;
}
.cfo-step p strong { color: #fff; font-weight: 600; }
.cfo-step-time {
  display: inline-block;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cfo-line);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--rui-teal);
}

/* ───────────────────────── SERVIZI ───────────────────────── */
.cfo-services .feature-note {
  margin-top: 0.8rem;
  color: var(--rui-text-3);
  font-size: 0.95rem;
}

/* mock cards condivisi */
.cfo-mock { max-width: 440px; padding: 1.5rem 1.6rem 1.4rem; }
.cfo-mock-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.cfo-mock-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rui-text-3);
}
.cfo-mock-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--rui-teal-tint);
  color: var(--rui-teal-dark);
}
.cfo-mock-tag-warn { background: rgba(236,126,0,0.12); color: var(--rui-warning); }
.cfo-mock-big {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--rui-dark);
  margin-top: 0.9rem;
  line-height: 1.1;
}
.cfo-mock-delta {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--rui-teal-dark);
  margin-top: 0.15rem;
}
.cfo-mock-foot {
  margin-top: 1.2rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rui-border);
  font-size: 0.83rem;
  color: var(--rui-text-2);
}
.cfo-mock-foot-alert { color: var(--rui-danger); font-weight: 600; }
.cfo-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--rui-teal);
  color: #fff;
  font-size: 0.65rem;
  margin-right: 0.25rem;
  vertical-align: -3px;
}

/* grafico cassa */
.cfo-chart {
  margin-top: 1.4rem;
  height: 118px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-bottom: 1px solid var(--rui-border);
  padding-bottom: 0.2rem;
}
.cfo-chart-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cfo-chart-col span {
  display: block;
  width: 100%;
  border-radius: 4px;
  animation: cfo-grow 0.7s ease-out both;
}
.cfo-bar-in {
  background: var(--rui-teal);
  margin-top: auto;
  transform-origin: bottom center;
  border-radius: 4px 4px 1px 1px;
}
.cfo-bar-out {
  background: rgba(25,28,31,0.14);
  margin-bottom: auto;
  transform-origin: top center;
  border-radius: 1px 1px 4px 4px;
}
.cfo-chart-col:nth-child(2) span { animation-delay: 0.05s; }
.cfo-chart-col:nth-child(3) span { animation-delay: 0.1s; }
.cfo-chart-col:nth-child(4) span { animation-delay: 0.15s; }
.cfo-chart-col:nth-child(5) span { animation-delay: 0.2s; }
.cfo-chart-col:nth-child(6) span { animation-delay: 0.25s; }
.cfo-chart-col:nth-child(7) span { animation-delay: 0.3s; }
.cfo-chart-col:nth-child(8) span { animation-delay: 0.35s; }
@keyframes cfo-grow { from { transform: scaleY(0.05); opacity: 0.4; } to { transform: scaleY(1); opacity: 1; } }

.cfo-mock-legend {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  color: var(--rui-text-3);
}
.cfo-mock-legend i {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 3px;
  margin-right: 0.4rem;
}
.cfo-dot-in { background: var(--rui-teal); }
.cfo-dot-out { background: rgba(25,28,31,0.2); }

/* aging fatture scadute */
.cfo-aging {
  margin-top: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.cfo-aging-row {
  display: grid;
  grid-template-columns: 6.6rem 1fr auto;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.85rem;
}
.cfo-aging-lbl { color: var(--rui-text-2); }
.cfo-aging-bar {
  height: 8px;
  background: var(--rui-surface);
  border-radius: 999px;
  overflow: hidden;
}
.cfo-aging-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--rui-warning);
  transform-origin: left center;
  animation: cfo-fill 1s ease-out both;
}
.cfo-aging-bar i.mid { background: #e2603a; }
.cfo-aging-bar i.late { background: var(--rui-danger); }
.cfo-aging-amt {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--rui-dark);
  white-space: nowrap;
}
@keyframes cfo-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* marginalità */
.cfo-margin {
  margin-top: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.cfo-margin-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}
.cfo-margin-top span { color: var(--rui-text-2); font-weight: 500; }
.cfo-margin-top strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--rui-dark);
}
.cfo-neg { color: var(--rui-danger) !important; }
.cfo-margin-bar {
  display: block;
  height: 9px;
  background: var(--rui-surface);
  border-radius: 999px;
  overflow: hidden;
}
.cfo-margin-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--rui-teal);
  transform-origin: left center;
  animation: cfo-fill 1.1s ease-out both;
}
.cfo-margin-bar i.neg { background: var(--rui-danger); }
.cfo-margin-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--rui-text-3);
}
.cfo-margin-row-alert .cfo-margin-sub { color: var(--rui-danger); }

/* agenda settimanale */
.cfo-agenda {
  list-style: none;
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
}
.cfo-agenda li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.62rem 0;
  font-size: 0.9rem;
  color: var(--rui-text-2);
  border-bottom: 1px solid var(--rui-border);
  position: relative;
  padding-left: 1.4rem;
}
.cfo-agenda li:last-child { border-bottom: 0; }
.cfo-agenda li::before {
  content: "";
  position: absolute;
  left: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rui-gray-border);
}
.cfo-agenda li.done { color: var(--rui-text-3); }
.cfo-agenda li.done::before { background: var(--rui-teal); }
.cfo-agenda li.live { color: var(--rui-dark); font-weight: 600; }
.cfo-agenda li.live::before {
  background: var(--rui-teal);
  box-shadow: 0 0 0 3px var(--rui-teal-tint);
  animation: pulse 2s infinite;
}
.cfo-agenda li.alert::before { background: var(--rui-warning); }
.cfo-agenda-day {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rui-text-3);
  width: 2.1rem;
  flex-shrink: 0;
}

/* ───────────────────────── PER CHI ───────────────────────── */
.cfo-forwho { padding: 5.5rem 1.5rem; }
.cfo-profile-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.cfo-profile {
  background: var(--rui-white);
  border: 1px solid var(--rui-border);
  border-radius: var(--radius-card);
  padding: 1.9rem 1.6rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cfo-profile:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.cfo-profile-size {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cfo-accent);
  background: rgba(73,79,223,0.09);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1.1rem;
}
.cfo-profile h3 {
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--rui-dark);
  margin-bottom: 0.6rem;
}
.cfo-profile p { color: var(--rui-text-2); font-size: 0.94rem; flex: 1; }
.cfo-profile-need {
  display: block;
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rui-border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rui-teal-dark);
}

.cfo-notfor {
  max-width: var(--maxw);
  margin: 2.5rem auto 0;
  border: 1px dashed var(--rui-gray-border);
  border-radius: var(--radius-card);
  padding: 1.6rem 1.8rem;
  background: transparent;
  text-align: center;
}
.cfo-notfor h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--rui-text-2);
  margin-bottom: 0.4rem;
}
.cfo-notfor p {
  color: var(--rui-text-3);
  font-size: 0.93rem;
  max-width: 640px;
  margin: 0 auto;
}

/* ───────────────────────── FORM: select ───────────────────────── */
.form-field select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 2.2rem 0.75rem 0.9rem;
  min-height: 50px;
  border: 1px solid var(--rui-gray-border);
  border-radius: 10px;
  background-color: var(--rui-white);
  color: var(--rui-text);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d969e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 18px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-field select:focus {
  outline: none;
  border-color: var(--rui-teal);
  box-shadow: 0 0 0 3px var(--rui-teal-tint);
}
.form-field select:invalid { color: var(--rui-text-3); }

/* ───────────────────────── FOOTER ───────────────────────── */
.footer-links {
  margin-top: 0.7rem;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--rui-text-2);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover { color: var(--rui-teal-dark); }

/* ───────────────────────── RESPONSIVE ───────────────────────── */
@media (max-width: 900px) {
  .cfo-hero { padding: 5rem 1.25rem 3.5rem; }
  .cfo-pain-grid { grid-template-columns: repeat(2, 1fr); }
  .cfo-steps { grid-template-columns: 1fr; }
  .cfo-profile-grid { grid-template-columns: 1fr; }
  .cfo-services .feature-copy { text-align: center; }
}

@media (max-width: 520px) {
  .cfo-pain-grid { grid-template-columns: 1fr; }
  .cfo-hero h2 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .cfo-mock { padding: 1.25rem 1.2rem 1.1rem; }
  .cfo-mock-big { font-size: 2rem; }
  .cfo-aging-row { grid-template-columns: 5.6rem 1fr auto; font-size: 0.8rem; gap: 0.5rem; }
  .cfo-notfor { padding: 1.4rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cfo-chart-col span,
  .cfo-aging-bar i,
  .cfo-margin-bar i,
  .cfo-agenda li.live::before { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENTI CONDIVISI — usati dalla dashboard in hero
   ═══════════════════════════════════════════════════════════════ */
.cfo-dash-dots { display: inline-flex; gap: 5px; }
.cfo-dash-dots i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--rui-gray-border);
}
.cfo-pos { color: var(--rui-teal-dark); }
.cfo-pill {
  display: inline-block;
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.cfo-pill-ok   { background: var(--rui-teal-tint); color: var(--rui-teal-dark); }
.cfo-pill-soon { background: rgba(236,126,0,0.13); color: var(--rui-warning); }
.cfo-pill-late { background: rgba(226,59,74,0.12); color: var(--rui-danger); }
.cfo-online {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rui-teal);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   COME FUNZIONA — visual in cima a ogni step
   ═══════════════════════════════════════════════════════════════ */
.cfo-step-visual {
  aspect-ratio: 16 / 10;
  background: var(--rui-white);
  border-radius: 12px;
  overflow: hidden;
  padding: 0.95rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
}
.cfo-step-visual > * { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* step 1 — connessioni */
.cfo-conn { justify-content: center; gap: 0.5rem; }
.cfo-conn-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--rui-border);
  border-radius: 10px;
  padding: 0.42rem 0.65rem;
}
.cfo-conn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--rui-surface);
  color: var(--rui-text-2);
  flex-shrink: 0;
}
.cfo-conn-ico svg { width: 16px; height: 16px; }
.cfo-conn-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--rui-dark);
  line-height: 1.25;
}
.cfo-conn-name em {
  font-style: normal;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--rui-text-3);
}
.cfo-conn-ok {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--rui-teal-dark);
  background: var(--rui-teal-tint);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
}
.cfo-conn-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--rui-text-3);
}
.cfo-conn-foot svg { width: 13px; height: 13px; }

/* step 2 — scenari sul modello */
.cfo-scen { justify-content: center; gap: 0.15rem; }
.cfo-scen-head {
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rui-text-3);
  margin-bottom: 0.5rem;
}
.cfo-scen-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.79rem;
  color: var(--rui-text-2);
  border-bottom: 1px solid var(--rui-border);
}
.cfo-scen-row:last-child { border-bottom: 0; }
.cfo-scen-row strong {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  white-space: nowrap;
}
.cfo-warn { color: var(--rui-warning); }

/* step 3 — chat in miniatura */
.cfo-mini-chat { gap: 0.4rem; }
.cfo-mini-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rui-border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--rui-dark);
}
.cfo-mini-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--cfo-ink);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  flex-shrink: 0;
}
.cfo-mini-bubble {
  flex: 0 0 auto;
  align-self: flex-start;
  max-width: 88%;
  background: var(--rui-surface);
  border-radius: 10px;
  border-bottom-left-radius: 3px;
  padding: 0.45rem 0.6rem;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--rui-text);
}
.cfo-mini-me {
  align-self: flex-end;
  background: var(--rui-teal);
  color: #fff;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 3px;
}
.cfo-mini-wa {
  flex: 0 0 auto;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rui-border);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: #0e7a41;
}
.cfo-mini-wa svg { width: 13px; height: 13px; }

@media (max-width: 900px) {
  .cfo-step-visual { max-width: 420px; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   HERO — la chat col direttore finanziario che, se vuoi, diventa la dashboard
   Regia in tre atti guidata da cfo.js (classi .is-shown / .is-dash):
   atto 1  il direttore finanziario ti scrive lui (telefono centrato)
   atto 2  tu chiedi, lui risponde
   atto 3  il telefono si accosta a sinistra, la dashboard entra
           da destra nella sua corsia: i due non si toccano mai
           (stessa durata e easing, il bordo del desk resta sempre
           a destra del bordo del telefono).
   ═══════════════════════════════════════════════════════════════ */
.cfo-hero-transform {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 3.5rem auto 0;
  animation: cfo-transform-enter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes cfo-transform-enter {
  from { opacity: 0; transform: translateY(28px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.cfo-transform-stage {
  position: relative;
  height: 660px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 15% 12%, rgba(37,211,102,0.10), transparent 26%),
    radial-gradient(circle at 85% 8%, rgba(73,79,223,0.13), transparent 30%),
    radial-gradient(circle at 70% 95%, rgba(0,168,126,0.07), transparent 30%),
    linear-gradient(160deg, rgba(255,255,255,0.97), rgba(247,248,250,0.9));
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 30px 70px rgba(25,28,31,0.13),
    0 10px 24px rgba(25,28,31,0.05);
  overflow: hidden;
}
.cfo-stage-scene {
  position: absolute;
  inset: 0;
  transition: opacity 0.55s ease;
}
.cfo-transform-stage.is-leaving .cfo-stage-scene { opacity: 0; }
.cfo-transform-stage.is-resetting,
.cfo-transform-stage.is-resetting * { transition: none !important; }

/* ── telefono ── */
.cfo-stage-phone {
  position: absolute;
  top: 38px;
  left: calc(50% - 170px);
  width: 340px;
  transform-origin: top left;
  transition:
    left 1s cubic-bezier(0.22, 1, 0.36, 1),
    top 1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: left, transform;
}
.is-dash .cfo-stage-phone {
  left: 34px;
  top: 108px;
  transform: scale(0.8);
}
.cfo-stage-phone::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -18px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(25,28,31,0.15), transparent 65%);
}
.cfo-phone-shell {
  position: relative;
  padding: 11px;
  border-radius: 40px;
  background: linear-gradient(160deg, #23262e, #0d0f14);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.14),
    0 24px 48px rgba(15,19,24,0.30);
}
.cfo-phone-island {
  position: absolute;
  left: 50%;
  top: 21px;
  width: 84px;
  height: 22px;
  margin-left: -42px;
  border-radius: 999px;
  background: #05070a;
  z-index: 3;
}
.cfo-phone-screen {
  height: 574px;
  display: flex;
  flex-direction: column;
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(37,211,102,0.07), transparent 26%),
    radial-gradient(circle at 80% 40%, rgba(73,79,223,0.06), transparent 30%),
    #efeae2;
}
.cfo-phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.35rem 0.4rem;
  background: rgba(255,255,255,0.86);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--rui-dark);
}
.cfo-phone-status-icons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--rui-dark);
}
.cfo-phone-status-icons svg { height: 11px; width: auto; display: block; }

.cfo-phone-wahead {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem 0.7rem;
  background: rgba(255,255,255,0.86);
  border-bottom: 1px solid rgba(16,20,26,0.07);
}
.cfo-wa-back { width: 20px; height: 20px; color: #0a7cff; flex-shrink: 0; }
.cfo-phone-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(150deg, #2c313b, #10141a);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}
.cfo-phone-contact {
  /* block, non flex: text-overflow non funziona sui flex container */
  display: block;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--rui-dark);
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfo-phone-contact em {
  display: block;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--rui-text-3);
}
.cfo-phone-waicons {
  margin-left: auto;
  display: inline-flex;
  gap: 0.95rem;
  color: #0a7cff;
  flex-shrink: 0;
}
.cfo-phone-waicons svg { width: 20px; height: 20px; }

.cfo-phone-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* ancorata in basso come una chat vera: ogni messaggio nuovo
     spinge in alto i precedenti */
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem 0.65rem;
  overflow: hidden;
}
/* i messaggi non ancora arrivati non occupano spazio
   (il display dichiarato sotto vincerebbe sull'attributo hidden) */
.cfo-phone-chat [hidden] { display: none !important; }
.cfo-chat-daychip {
  align-self: center;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 2px 8px rgba(25,28,31,0.06);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--rui-text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* bolle: compaiono via .is-shown (regia in cfo.js) */
.cfo-bbl {
  position: relative;
  width: fit-content;
  max-width: 88%;
  padding: 0.55rem 0.75rem 0.95rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.42;
  color: #111b21;
  box-shadow: 0 1px 2px rgba(16,20,26,0.10);
  opacity: 0;
  transform: translateY(14px) scale(0.94);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.cfo-bbl.is-shown { opacity: 1; transform: none; }
.cfo-bbl strong { font-weight: 700; }
.cfo-bbl-in {
  align-self: flex-start;
  background: #fff;
  border-top-left-radius: 4px;
}
.cfo-bbl-out {
  align-self: flex-end;
  background: #d9fdd3;
  border-top-right-radius: 4px;
}
.cfo-bbl-in::before,
.cfo-bbl-out::before {
  content: "";
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
}
.cfo-bbl-in::before {
  left: -7px;
  border-top: 9px solid #fff;
  border-left: 8px solid transparent;
}
.cfo-bbl-out::before {
  right: -7px;
  border-top: 9px solid #d9fdd3;
  border-right: 8px solid transparent;
}
/* come su WhatsApp: la coda solo sulla prima bolla del gruppo */
.cfo-bbl-in + .cfo-bbl-in { border-top-left-radius: 14px; }
.cfo-bbl-in + .cfo-bbl-in::before { display: none; }
.cfo-bbl-flag {
  display: block;
  width: fit-content;
  margin-bottom: 0.35rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: rgba(226,59,74,0.10);
  color: var(--rui-danger);
  font-family: var(--font-display);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.cfo-bbl-meta {
  position: absolute;
  right: 0.65rem;
  bottom: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.66rem;
  color: rgba(17,27,33,0.45);
}
.cfo-ticks { width: 15px; height: 10px; color: #53bdeb; flex-shrink: 0; }

.cfo-bbl-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  border-top-left-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16,20,26,0.10);
  opacity: 0;
  transform: translateY(14px) scale(0.94);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.cfo-bbl-typing.is-shown { opacity: 1; transform: none; }
.cfo-bbl-typing.is-gone { display: none; }
.cfo-bbl-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(17,27,33,0.35);
  animation: cfo-typing-dot 1.1s infinite;
}
.cfo-bbl-typing i:nth-child(2) { animation-delay: 0.15s; }
.cfo-bbl-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cfo-typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.cfo-bbl-cta { padding-bottom: 1.15rem; }
.cfo-bbl-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  background: var(--rui-teal);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  overflow: hidden;
  transition: transform 0.18s ease, background 0.18s ease;
}
.cfo-bbl-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.cfo-bbl-btn.is-pressed { transform: scale(0.95); background: var(--rui-teal-dark); }
.cfo-tap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  opacity: 0;
  pointer-events: none;
}
.cfo-bbl-btn.is-pressed .cfo-tap { animation: cfo-tap-ripple 0.55s ease-out; }
@keyframes cfo-tap-ripple {
  from { opacity: 0.9; transform: scale(0.4); }
  to   { opacity: 0; transform: scale(6); }
}

.cfo-phone-compose {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem 0.8rem;
  background: rgba(255,255,255,0.86);
  border-top: 1px solid rgba(16,20,26,0.06);
}
.cfo-phone-input {
  flex: 1;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(16,20,26,0.08);
  font-size: 0.82rem;
  color: var(--rui-text-3);
  white-space: nowrap;
  overflow: hidden;
}
.cfo-phone-mic {
  /* pattern iOS: glifo piatto, niente cerchio pieno (quello è Android) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #54656f;
  flex-shrink: 0;
}
.cfo-phone-mic svg { width: 20px; height: 20px; }

/* ── dashboard ── */
.cfo-stage-desk {
  position: absolute;
  top: 56px;
  left: 322px;
  right: 34px;
  border-radius: 22px;
  border: 1px solid rgba(16,20,26,0.08);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(25,28,31,0.16), 0 6px 16px rgba(25,28,31,0.07);
  transform: translateX(calc(100% + 90px));
  transition: transform 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.05s;
  will-change: transform;
}
.is-dash .cfo-stage-desk { transform: translateX(0); }

.cfo-desk-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(180deg, #fbfbfc, #f4f5f7);
  border-bottom: 1px solid rgba(16,20,26,0.07);
}
.cfo-desk-url {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-radius: 8px;
  background: rgba(16,20,26,0.05);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rui-text-2);
  white-space: nowrap;
}
.cfo-desk-url svg { width: 11px; height: 11px; flex-shrink: 0; }
.cfo-desk-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--rui-text-3);
  white-space: nowrap;
}
.cfo-desk-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rui-teal);
  animation: pulse 2s infinite;
}

.cfo-desk-body {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr) 220px;
  background: #fff;
}
.cfo-desk-main {
  padding: 0.75rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: linear-gradient(180deg, #fdfdfe, #f8f9fb);
  min-width: 0;
}

.cfo-desk-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}
.cfo-desk-kpi {
  padding: 0.55rem 0.7rem;
  border-radius: 13px;
  border: 1px solid rgba(16,20,26,0.06);
  background: #fff;
  box-shadow: 0 2px 8px rgba(25,28,31,0.04);
  min-width: 0;
}
.cfo-desk-kpi span {
  display: block;
  font-size: 0.64rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rui-text-3);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfo-desk-kpi strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--rui-dark);
  line-height: 1.15;
  white-space: nowrap;
}
.cfo-desk-kpi em {
  display: block;
  margin-top: 0.1rem;
  line-height: 1.25;
  font-style: normal;
  font-size: 0.68rem;
  color: var(--rui-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfo-kpi-up { color: var(--rui-teal-dark) !important; font-weight: 600; }

.cfo-desk-panel {
  border: 1px solid rgba(16,20,26,0.06);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(25,28,31,0.04);
  padding: 0.7rem 0.8rem;
}
.cfo-desk-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rui-text-3);
}
.cfo-desk-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.cfo-leg-solid,
.cfo-leg-dash { display: inline-block; width: 16px; }
.cfo-leg-solid { border-top: 2.5px solid var(--rui-teal); }
.cfo-leg-dash { border-top: 2.5px dashed var(--cfo-accent); }

.cfo-line-base {
  stroke-dasharray: 640;
  stroke-dashoffset: 640;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.is-dash .cfo-line-base { stroke-dashoffset: 0; transition-delay: 1.15s; }
.cfo-line-scen {
  stroke: var(--cfo-accent);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s ease-out;
}
.is-dash .cfo-line-scen { clip-path: inset(0 -5% 0 0); transition-delay: 1.6s; }
.cfo-line-area { opacity: 0; transition: opacity 0.9s ease; }
.is-dash .cfo-line-area { opacity: 1; transition-delay: 1.9s; }
.cfo-chart-dot {
  opacity: 0;
  transform: scale(0.4);
  transform-origin: 300px 138px;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.is-dash .cfo-chart-dot { opacity: 1; transform: scale(1); transition-delay: 2.5s; }
.cfo-chart-pin {
  position: absolute;
  left: 57.5%;
  top: 92%;
  transform: translate(-50%, -170%) scale(0.9);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(16,20,26,0.08);
  box-shadow: 0 8px 20px rgba(25,28,31,0.12);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--rui-dark);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.is-dash .cfo-chart-pin {
  opacity: 1;
  transform: translate(-50%, -190%) scale(1);
  transition-delay: 2.65s;
}

/* ── sidebar dell'app ── */
.cfo-desk-side {
  display: flex;
  flex-direction: column;
  padding: 0.8rem 0.6rem 0.7rem;
  background: #fbfbfc;
  border-right: 1px solid rgba(16,20,26,0.07);
  min-width: 0;
}
.cfo-desk-brand { padding: 0.1rem 0.45rem 0.75rem; }
.cfo-desk-brand img { display: block; width: 86px; height: auto; }
.cfo-desk-nav { display: flex; flex-direction: column; gap: 2px; }
.cfo-desk-nav-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--rui-text-2);
  white-space: nowrap;
}
.cfo-desk-nav-item svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--rui-text-3); }
.cfo-desk-nav-item.is-active {
  background: #fff;
  color: var(--rui-dark);
  box-shadow: 0 1px 3px rgba(25,28,31,0.08);
}
.cfo-desk-nav-item.is-active svg { color: var(--rui-teal); }
.cfo-desk-nav-item b {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(226,59,74,0.12);
  color: var(--rui-danger);
  font-size: 0.6rem;
  font-weight: 700;
}
.cfo-desk-nav-item .cfo-online { margin-left: auto; }
.cfo-desk-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.45rem 0;
  border-top: 1px solid rgba(16,20,26,0.07);
}
.cfo-desk-user-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--rui-teal-tint);
  color: var(--rui-teal-dark);
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  flex-shrink: 0;
}
.cfo-desk-user-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--rui-dark);
  line-height: 1.15;
}
.cfo-desk-user-who em {
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--rui-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── header di pagina ── */
.cfo-desk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.cfo-desk-title {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--rui-dark);
  line-height: 1.15;
  min-width: 0;
}
.cfo-desk-title em {
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.63rem;
  font-weight: 400;
  color: var(--rui-text-3);
  white-space: nowrap;
}
.cfo-desk-tools { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.cfo-desk-range {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(16,20,26,0.1);
  background: #fff;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--rui-text-2);
  white-space: nowrap;
}
.cfo-desk-range svg { width: 11px; height: 11px; }
.cfo-desk-icobtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(16,20,26,0.1);
  background: #fff;
  color: var(--rui-text-2);
}
.cfo-desk-icobtn svg { width: 13px; height: 13px; }
.cfo-desk-bell b {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rui-danger);
  box-shadow: 0 0 0 1.5px #fff;
}

/* sparkline nei KPI */
.cfo-kpi-spark {
  display: block;
  width: 100%;
  height: 14px;
  margin-top: 0.35rem;
  fill: none;
  stroke: var(--rui-teal);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.cfo-kpi-spark-warn { stroke: var(--rui-danger); }

/* grafico con assi */
.cfo-desk-chart {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.35rem;
}
.cfo-chart-y { position: relative; }
.cfo-chart-y span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  font-size: 0.57rem;
  font-weight: 600;
  color: var(--rui-text-3);
  white-space: nowrap;
}
.cfo-chart-y span:nth-child(1) { top: 21.3%; }
.cfo-chart-y span:nth-child(2) { top: 46.7%; }
.cfo-chart-y span:nth-child(3) { top: 72%; }
.cfo-chart-y span:nth-child(4) { top: 97.3%; }
.cfo-chart-plot { position: relative; }
.cfo-chart-plot svg { display: block; width: 100%; height: 100px; }
.cfo-chart-x {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-size: 0.57rem;
  font-weight: 600;
  color: var(--rui-text-3);
}

/* striscia scenario sotto il grafico */
.cfo-desk-insight {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(16,20,26,0.06);
  font-size: 0.65rem;
  color: var(--rui-text-3);
  white-space: nowrap;
  min-width: 0;
}
.cfo-desk-insight-lbl {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rui-text-2);
}
.cfo-desk-insight b {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--rui-dark);
}
.cfo-desk-verdict {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.26rem 0.55rem;
  border-radius: 999px;
  background: var(--rui-teal-tint);
  border: 1px solid rgba(0,168,126,0.25);
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--rui-teal-dark);
}
.cfo-desk-verdict svg { width: 11px; height: 11px; flex-shrink: 0; }

/* tabella scadenziario */
.cfo-desk-link {
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--rui-teal-dark);
  white-space: nowrap;
}
.cfo-desk-table { display: flex; flex-direction: column; }
.cfo-desk-tr {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 62px 72px 96px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.27rem 0;
  font-size: 0.69rem;
  line-height: 1.3;
  color: var(--rui-text);
  border-bottom: 1px solid rgba(16,20,26,0.06);
}
.cfo-desk-tr:last-child { border-bottom: 0; }
.cfo-desk-tr > span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfo-desk-tr > span:first-child { font-weight: 600; }
.cfo-desk-tr > span:nth-child(2) { font-family: var(--font-display); font-weight: 700; text-align: right; }
.cfo-desk-tr > span:nth-child(3) { font-size: 0.63rem; color: var(--rui-text-3); }
.cfo-desk-tr > span:nth-child(4) { text-align: right; overflow: visible; }
.cfo-desk-tr.cfo-desk-th {
  padding-top: 0;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rui-text-3);
}
.cfo-desk-tr.cfo-desk-th > span {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: inherit;
  color: inherit;
}
.cfo-desk-table .cfo-pill { font-size: 0.57rem; padding: 0.15rem 0.45rem; }

/* ingressi della dashboard, a cascata dopo l'aggancio */
.cfo-desk-kpi,
.cfo-desk-panel {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.is-dash .cfo-desk-kpi,
.is-dash .cfo-desk-panel { opacity: 1; transform: none; }
.is-dash .cfo-d1 { transition-delay: 0.55s; }
.is-dash .cfo-d2 { transition-delay: 0.68s; }
.is-dash .cfo-d3 { transition-delay: 0.81s; }
.is-dash .cfo-d4 { transition-delay: 0.95s; }
.is-dash .cfo-d5 { transition-delay: 1.1s; }

/* chat laterale: la conversazione continua */
.cfo-desk-chat {
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(16,20,26,0.07);
  background: #fff;
  min-width: 0;
}
.cfo-desk-chat-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid rgba(16,20,26,0.07);
}
.cfo-desk-chat-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--rui-dark);
  line-height: 1.2;
}
.cfo-desk-chat-who em {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--rui-text-3);
  white-space: nowrap;
}
.cfo-desk-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem;
  background: linear-gradient(180deg, #fcfcfd, #f6f8fa);
}
.cfo-dmsg {
  width: fit-content;
  max-width: 92%;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border-top-left-radius: 4px;
  background: #fff;
  border: 1px solid rgba(16,20,26,0.06);
  box-shadow: 0 1px 4px rgba(25,28,31,0.05);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--rui-text);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.cfo-dmsg-me {
  align-self: flex-end;
  border-top-left-radius: 12px;
  border-top-right-radius: 4px;
  background: var(--rui-teal);
  border-color: var(--rui-teal);
  color: #fff;
}
.is-dash .cfo-dmsg { opacity: 1; transform: none; }
.is-dash .cfo-c1 { transition-delay: 1.6s; }
.is-dash .cfo-c2 { transition-delay: 2.3s; }
.is-dash .cfo-c3 { transition-delay: 3s; }
.cfo-desk-chat-compose {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-top: 1px solid rgba(16,20,26,0.07);
}
.cfo-desk-chat-compose span {
  flex: 1;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(16,20,26,0.1);
  font-size: 0.75rem;
  color: var(--rui-text-3);
  white-space: nowrap;
  overflow: hidden;
}
.cfo-desk-chat-compose i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--rui-teal);
  color: #fff;
  flex-shrink: 0;
}
.cfo-desk-chat-compose i svg { width: 14px; height: 14px; }

/* ── stepper dei tre atti, sotto lo stage ── */
.cfo-transform-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}
.cfo-tstep {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem 0.5rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--rui-border);
  background: var(--rui-white);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.cfo-tstep-num {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--rui-surface);
  color: var(--rui-text-3);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.35s ease, color 0.35s ease;
}
.cfo-tstep-num i { font-style: normal; transition: opacity 0.2s ease; }
.cfo-tstep-num svg {
  position: absolute;
  width: 13px;
  height: 13px;
  color: var(--rui-teal-dark);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.cfo-tstep-lbl {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rui-text-2);
  white-space: nowrap;
  transition: color 0.35s ease;
}
.cfo-tstep.is-on {
  border-color: rgba(0,168,126,0.45);
  box-shadow: 0 6px 18px rgba(0,168,126,0.12);
}
.cfo-tstep.is-on .cfo-tstep-num { background: var(--rui-teal); color: #fff; }
.cfo-tstep.is-on .cfo-tstep-lbl { color: var(--rui-dark); }
.cfo-tstep.is-done .cfo-tstep-num { background: var(--rui-teal-tint); }
.cfo-tstep.is-done .cfo-tstep-num i { opacity: 0; }
.cfo-tstep.is-done .cfo-tstep-num svg { opacity: 1; transform: scale(1); }
.cfo-tstep-line {
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--rui-border);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.cfo-tstep-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--rui-teal);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s ease;
}
.cfo-tstep-line.is-done::after { transform: scaleX(1); }

/* ── modalità statica (mobile o prefers-reduced-motion): tutto visibile ── */
.cfo-transform-stage.is-static,
.cfo-transform-stage.is-static * { transition: none !important; }
.is-static .cfo-bbl,
.is-static .cfo-desk-kpi,
.is-static .cfo-desk-panel,
.is-static .cfo-dmsg,
.is-static .cfo-chart-dot { opacity: 1; transform: none; }
.is-static .cfo-chart-pin { opacity: 1; transform: translate(-50%, -190%); }
.is-static .cfo-bbl-typing { display: none; }
.is-static .cfo-line-base { stroke-dashoffset: 0; }
.is-static .cfo-line-scen { clip-path: none; }
.is-static .cfo-line-area { opacity: 1; }

/* ── responsive ── */
/* sotto i 1190px la colonna chat renderebbe le card KPI più strette
   delle loro etichette: la chat vive già sul telefono agganciato */
/* sotto i 1250px la striscia scenario non ha spazio per l'etichetta */
@media (max-width: 1250px) {
  .cfo-desk-insight-lbl { display: none; }
}

@media (max-width: 1190px) {
  .cfo-desk-body { grid-template-columns: 154px minmax(0, 1fr); }
  .cfo-transform-stage .cfo-desk-chat { display: none; }
  .cfo-stage-desk { left: 316px; right: 28px; top: 56px; }
  .is-dash .cfo-stage-phone { left: 28px; top: 108px; }
}

@media (max-width: 900px) {
  .cfo-hero-transform { margin-top: 2.5rem; }
  .cfo-transform-stage {
    height: auto;
    padding: 0.9rem;
    border-radius: 24px;
  }
  .cfo-stage-scene { position: static; }
  .cfo-stage-phone {
    position: static;
    width: min(100%, 340px);
    margin: 0 auto;
    transform: none !important;
  }
  .cfo-stage-phone::after { display: none; }
  .cfo-stage-desk {
    position: static;
    margin-top: 1rem;
    transform: none !important;
    box-shadow: 0 14px 34px rgba(25,28,31,0.10);
  }
  .cfo-desk-body { grid-template-columns: 1fr; }
  .cfo-desk-side {
    flex-direction: row;
    align-items: center;
    padding: 0.5rem 0.6rem;
    border-right: 0;
    border-bottom: 1px solid rgba(16,20,26,0.07);
    overflow: hidden;
  }
  .cfo-desk-brand,
  .cfo-desk-user { display: none; }
  .cfo-desk-nav { flex-direction: row; }
  .cfo-desk-nav-item:nth-child(5),
  .cfo-desk-nav-item:nth-child(6) { display: none; }
  .cfo-transform-stage .cfo-desk-chat {
    display: flex;
    border-left: 0;
    border-top: 1px solid rgba(16,20,26,0.07);
  }
  .cfo-phone-screen { height: auto; min-height: 530px; }
  .cfo-chart-plot svg { height: 110px; }
  .cfo-tstep-line { display: none; }
  .cfo-transform-steps { gap: 0.55rem; margin-top: 1.2rem; }
  .cfo-tstep { padding: 0.45rem 0.9rem 0.45rem 0.5rem; }
}

@media (max-width: 560px) {
  .cfo-transform-stage { border-radius: 22px; padding: 0.7rem; }
  .cfo-phone-shell { padding: 9px; border-radius: 34px; }
  .cfo-phone-screen { border-radius: 27px; min-height: 500px; }
  .cfo-phone-island { top: 17px; width: 76px; margin-left: -38px; height: 20px; }
  .cfo-desk-kpis { grid-template-columns: 1fr; gap: 0.5rem; }
  .cfo-desk-kpi {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
  }
  .cfo-desk-kpi span,
  .cfo-desk-kpi em { margin: 0; }
  .cfo-desk-legend { display: none; }
  .cfo-desk-tr { grid-template-columns: minmax(0, 1fr) 58px 84px; gap: 0.4rem; font-size: 0.66rem; }
  .cfo-desk-tr > span:nth-child(3) { display: none; }
  .cfo-desk-range { display: none; }
  .cfo-desk-insight-lbl { display: none; }
  .cfo-desk-verdict { margin-left: 0; }
  .cfo-kpi-spark { flex: 1 0 100%; }
  .cfo-desk-nav-item:nth-child(3),
  .cfo-desk-nav-item:nth-child(4) { display: none; }
  .cfo-chart-pin { font-size: 0.62rem; }
  .cfo-desk-live { display: none; }
  .cfo-tstep-lbl { font-size: 0.8rem; }
  .cfo-phone-contact { font-size: 0.86rem; }
  .cfo-phone-waicons { gap: 0.6rem; }
  .cfo-phone-waicons svg { width: 18px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .cfo-hero-transform { animation: none; }
  .cfo-transform-stage,
  .cfo-transform-stage * { transition: none !important; animation: none !important; }
  .cfo-bbl,
  .cfo-desk-kpi,
  .cfo-desk-panel,
  .cfo-dmsg,
  .cfo-chart-dot { opacity: 1; transform: none; }
  .cfo-chart-pin { opacity: 1; transform: translate(-50%, -190%); }
  .cfo-bbl-typing { display: none; }
  .cfo-line-base { stroke-dashoffset: 0; }
  .cfo-line-scen { clip-path: none; }
  .cfo-line-area { opacity: 1; }
}

