/* B-3a · Font self-hosted (OFL 1.1, zero dipendenze CDN a runtime).
   Schibsted Grotesk = titoli/display · Hanken Grotesk = testi/body. */
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400; font-display: swap; src: url('/jervi4/fonts/schibsted-grotesk-400.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url('/jervi4/fonts/schibsted-grotesk-500.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 600; font-display: swap; src: url('/jervi4/fonts/schibsted-grotesk-600.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url('/jervi4/fonts/schibsted-grotesk-700.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400; font-display: swap; src: url('/jervi4/fonts/hanken-grotesk-400.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url('/jervi4/fonts/hanken-grotesk-500.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 600; font-display: swap; src: url('/jervi4/fonts/hanken-grotesk-600.woff2') format('woff2'); }

:root {
  --bg: #000000;
  --surface: #141414;
  --accent: #f0ece4;            /* veste sobria: oro rimosso, ora panna (= --text-primary) */
  --text-primary: #f0ece4;
  --text-secondary: #a59c92;
  --border: #2a2825;
  --btn-radius: 14px;
  --accent-line: rgba(240, 236, 228, 0.22);
  --accent-soft: rgba(240, 236, 228, 0.08);
  --focus-ring: rgba(240, 236, 228, 0.55);
  --scene-pad-x: clamp(1.5rem, 5.5vw, 3.25rem);
  --scene-max: min(92vw, 52rem);
}

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

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Hanken Grotesk', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.55;
  overflow-x: hidden;
}

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

/* Logo salone: layer fisso, mai touch, respira sul nero (solo CSS, file originale) */
.mirror-decoration {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.salon-logo-heart-wrap {
  position: relative;
  width: min(52vmin, 400px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.salon-logo-heart {
  width: 100%;
  max-width: min(52vmin, 400px);
  height: auto;
  display: block;
  object-fit: contain;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
  filter: invert(1);
  mix-blend-mode: lighten;
  transform-origin: center;
  animation: salon-logo-breathe 4.6s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes salon-logo-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.82;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes salon-logo-breathe-active {
  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.28;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.42;
  }
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: clamp(1.25rem, 4vh, 2rem) var(--scene-pad-x) clamp(0.75rem, 2.5vh, 1.5rem);
  transition: opacity 0.6s ease;
}

.app-shell.is-busy .mirror-stage {
  opacity: 0.92;
  transition: opacity 0.45s ease;
}

.app-shell.is-busy .salon-logo-heart {
  animation-duration: 2.3s;
}

/* Standby: logo protagonista */
.app-shell.ui-standby .salon-logo-heart-wrap {
  opacity: 1;
}

.app-shell.ui-standby .salon-logo-heart {
  animation: salon-logo-breathe 4.6s ease-in-out infinite;
}

/* Standby: niente fascia scura da pannello messaggi / overlay (gradienti ::before) */
.app-shell.ui-standby .dialogue-block {
  display: none !important;
}

.app-shell.ui-standby .messages::before {
  content: none !important;
}

.app-shell.ui-standby .scene-actions::before {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-shell.ui-standby .btn-primary#startBtn {
  min-height: 2.75rem;
  padding: 0.6rem 1.35rem;
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  border-width: 1px;
  background: rgba(240, 236, 228, 0.14);
}

/* Guida / conversazione / professional: logo presente, più discreto */
.app-shell.ui-guiding .salon-logo-heart,
.app-shell.ui-speaking .salon-logo-heart,
.app-shell.ui-professional .salon-logo-heart {
  animation: salon-logo-breathe-active 3.5s ease-in-out infinite;
}

.app-shell.ui-guiding .salon-logo-heart-wrap,
.app-shell.ui-speaking .salon-logo-heart-wrap,
.app-shell.ui-professional .salon-logo-heart-wrap {
  opacity: 0.92;
}

/* Proposal: logo quasi assente */
.app-shell.ui-proposal .salon-logo-heart-wrap {
  opacity: 0.2;
}

.app-shell.ui-proposal .salon-logo-heart {
  animation: none;
  transform: scale(0.88);
  opacity: 0.35;
}

/* Scena: griglia verticale, non colonna form */
.mirror-stage.ambient-scene {
  width: var(--scene-max);
  max-width: 100%;
  margin: 0 auto;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  min-height: min(100dvh - 6rem, 100%);
  align-content: stretch;
  gap: 0;
  padding: 0;
  background: transparent;
}

.stage-header {
  flex-shrink: 0;
  text-align: center;
  padding: 0 0.25rem clamp(0.5rem, 2vh, 1rem);
  z-index: 2;
  position: relative;
}

.eyebrow {
  color: rgba(240, 236, 228, 0.55);
  letter-spacing: 0.48em;
  font-size: 0.58rem;
  font-weight: 500;
  text-transform: uppercase;
  margin: 0 0 0.45rem;
}

.stage-title {
  margin: 0;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.35;
  color: rgba(240, 236, 228, 0.72);
}

/* Dialogo: fascia nobile sotto il centro dello specchio */
.dialogue-block {
  position: relative;
  z-index: 2;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: min(36vh, 22rem);
  margin-top: clamp(-8vh, -4rem, -2rem);
}

.messages {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: min(12rem, 26vh);
  max-height: min(34vh, 480px);
  max-height: min(34dvh, 480px); /* B-3d (2) · P2-F: fallback viewport dinamico iOS (vh→dvh) */
  overflow-y: auto;
  overflow-x: hidden;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: clamp(1rem, 2.8vh, 1.75rem) clamp(0.25rem, 1.5vw, 0.5rem);
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition:
    min-height 0.55s ease,
    max-height 0.55s ease,
    padding 0.55s ease;
}

.messages::-webkit-scrollbar {
  width: 3px;
}

.messages::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(42, 40, 37, 0.35);
  border-radius: 3px;
}

.messages::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 155%;
  height: 145%;
  background: radial-gradient(
    ellipse 78% 68% at 50% 48%,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.45) 52%,
    transparent 78%
  );
  pointer-events: none;
}

.app-shell.ui-proposal .dialogue-block {
  padding-top: min(28vh, 18rem);
  margin-top: clamp(-6vh, -3rem, -1rem);
}

.app-shell.ui-proposal .messages {
  min-height: min(22rem, 48vh);
  max-height: min(56vh, 780px);
  max-height: min(56dvh, 780px); /* B-3d (2) · P2-F: fallback viewport dinamico iOS (vh→dvh) */
  padding-top: clamp(1.75rem, 5vh, 2.75rem);
  padding-bottom: clamp(1.75rem, 5vh, 2.75rem);
  padding-left: clamp(0.5rem, 2vw, 1rem);
  padding-right: clamp(0.5rem, 2vw, 1rem);
}

.app-shell.ui-proposal .messages::before {
  width: 175%;
  height: 160%;
  background: radial-gradient(
    ellipse 82% 75% at 50% 45%,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.52) 48%,
    transparent 76%
  );
}

/* Un solo blocco controlli attivo: stack centrale + reset fuori cluster */
.dynamic-control-stack {
  width: 100%;
  max-width: 36rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 2.5vh, 1.5rem);
  min-height: 0;
}

.dynamic-control-stack > [hidden] {
  display: none !important;
}

.flow-options-slot {
  margin: 0;
}

/* Azioni: cluster in basso, wrap, non lista verticale */
.scene-actions {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.65rem, 2vh, 1rem);
  padding: clamp(1rem, 3vh, 1.75rem) 0 clamp(0.25rem, 1vh, 0.75rem);
}

.scene-actions::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 130%;
  height: 120%;
  background: radial-gradient(
    ellipse 100% 80% at 50% 100%,
    rgba(0, 0, 0, 0.42) 0%,
    transparent 65%
  );
  pointer-events: none;
}

.controls,
.mode-box,
.composer-block .input-row,
.photo-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.35rem;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.controls-slot {
  margin: 0;
}

.btn-reset-outside {
  align-self: center;
  margin-top: 0.15rem;
  min-height: 2.65rem;
  padding: 0.5rem 1.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  font-weight: 500;
  opacity: 0.72;
  border-color: rgba(122, 115, 112, 0.28);
  background: transparent;
}

.btn-reset-outside:not(:disabled):hover {
  opacity: 0.95;
  border-color: rgba(240, 236, 228, 0.32);
}

.mode-box {
  margin: 0;
}

.composer-block {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 36rem;
  padding: 0 0.25rem;
  transition:
    opacity 0.55s ease,
    max-height 0.55s ease,
    margin 0.55s ease,
    padding 0.55s ease;
}

.composer-block::before {
  display: none;
}

/* Visibilità controllata da syncView / hidden — niente duplicati per stato UI */

.input-row {
  width: 100%;
}

.msg {
  max-width: 100%;
  padding: 0.9rem 0.85rem;
  margin-bottom: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.58;
  font-size: 1rem;
  font-weight: 400;
  border-radius: 0.2rem;
  transition: opacity 0.5s ease, transform 0.5s ease;
  animation: msg-in 0.55s ease forwards;
}

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

.msg:last-child {
  margin-bottom: 0;
}

.msg.assistant {
  background: rgba(12, 12, 12, 0.35);
  border: none;
  border-bottom: 1px solid rgba(240, 236, 228, 0.18);
  color: var(--text-primary);
  margin-right: auto;
}

.app-shell.ui-proposal .msg.assistant {
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.68;
  padding: 1.1rem 1rem 1.35rem;
  border-bottom-color: rgba(240, 236, 228, 0.32);
  max-width: 100%;
}

.app-shell[data-flow-state="HOME_ROUTINE"] .home-routine-scroll-hint {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  opacity: 0.58;
  margin-top: 1rem;
  padding-bottom: 0.85rem;
  color: rgba(240, 236, 228, 0.72);
}

/* HOME_ROUTINE — card prodotti (solo questo stato; scroll orizzontale compatto) */
.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
}

.app-shell:not([data-flow-state="HOME_ROUTINE"]) .routine-product-cards {
  display: none;
}

.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-card {
  flex: 1 1 clamp(170px, 44vw, 232px);
  max-width: 232px;
  min-width: 170px;
  background: rgba(8, 8, 8, 0.45);
  border: 1px solid rgba(240, 236, 228, 0.22);
  border-radius: 10px;
  padding: 0.65rem 0.7rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

@media (max-width: 560px) {
  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-card {
    flex-basis: min(90vw, 232px);
    min-width: 0;
  }
}

.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-image-wrap {
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  width: 100%;
}

.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-meta {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.38;
  color: rgba(240, 236, 228, 0.88);
}

.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-phase {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-brandrow {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: rgba(240, 236, 228, 0.55);
}

.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-name {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-benefit {
  font-size: 0.78rem;
  color: rgba(240, 236, 228, 0.72);
}

.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-howto {
  font-size: 0.72rem;
  color: rgba(240, 236, 228, 0.58);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-price {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: rgba(240, 236, 228, 0.95);
  margin-top: 0.15rem;
}

/* CONSULTATION_SUMMARY — scheda premium strutturata (senza card prodotto/immagini) */
.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .msg.assistant {
  width: min(760px, 100%);
  max-width: 100%;
  padding: 0.75rem 0.75rem 0.95rem;
  border-bottom-color: rgba(240, 236, 228, 0.28);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-card {
  background: rgba(10, 10, 10, 0.62);
  border: 1px solid rgba(240, 236, 228, 0.24);
  border-radius: 12px;
  padding: clamp(0.95rem, 1.8vw, 1.3rem) clamp(0.9rem, 2.1vw, 1.4rem);
  width: min(680px, 100%);
  max-width: 100%;
  margin: 0 auto;
  max-height: min(62vh, 720px);
  max-height: min(62dvh, 720px); /* B-3d (2) · P2-F: fallback viewport dinamico iOS (vh→dvh) */
  overflow-y: auto;
  overflow-x: hidden;
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(247, 241, 231, 0.98);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-subtitle {
  margin: 0.42rem 0 0.9rem;
  text-align: center;
  font-size: clamp(0.86rem, 1.4vw, 1rem);
  color: rgba(240, 236, 228, 0.72);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-section {
  padding-top: 0.68rem;
  margin-top: 0.68rem;
  border-top: 1px solid rgba(240, 236, 228, 0.18);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-section-title {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: rgba(240, 236, 228, 0.9);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-items {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-item {
  margin: 0;
  padding: 0.22rem 0;
  font-size: clamp(0.9rem, 1.2vw, 1.02rem);
  line-height: 1.45;
  color: rgba(247, 241, 231, 0.92);
  border-bottom: 1px solid rgba(240, 236, 228, 0.1);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-item:last-child {
  border-bottom: 0;
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-commercial-cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(240, 236, 228, 0.22);
  border-radius: 14px;
  background: rgba(8, 8, 8, 0.46);
  overflow: hidden;
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-commercial-note {
  margin: 0;
  font-size: clamp(0.82rem, 1.2vw, 0.95rem);
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: rgba(247, 241, 231, 0.86);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-commercial-note-safe {
  color: rgba(240, 236, 228, 0.68);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-commercial-title {
  margin: 0.25rem 0 0;
  text-align: center;
  font-size: clamp(0.82rem, 1.25vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 236, 228, 0.94);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-booking-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-booking-link,
.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  min-height: 44px;
  border-radius: var(--btn-radius);
  text-align: center;
  text-decoration: none;
  line-height: 1.25;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease,
    border-color 0.22s ease;
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-booking-link {
  flex: 1 1 150px;
  padding: 0.68rem 0.9rem;
  border: 1px solid rgba(240, 236, 228, 0.34);
  background: rgba(12, 12, 12, 0.62);
  color: rgba(247, 241, 231, 0.94);
  font-size: clamp(0.82rem, 1.15vw, 0.94rem);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link {
  align-self: stretch;
  padding: 0.78rem 1rem;
  border: 1px solid rgba(240, 236, 228, 0.42);
  background: linear-gradient(135deg, rgba(240, 236, 228, 0.22), rgba(20, 20, 20, 0.34));
  color: rgba(247, 241, 231, 0.98);
  font-size: clamp(0.86rem, 1.2vw, 0.98rem);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-booking-link:active,
.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link:active {
  transform: scale(0.98);
  opacity: 0.9;
}

@media (max-width: 768px) {
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-commercial-cta {
    padding: 0.95rem 0.85rem;
    gap: 0.8rem;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-booking-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
    overflow-x: hidden;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-booking-link,
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    white-space: normal;
  }
}

body:has(.app-shell[data-flow-state="CONSULTATION_SUMMARY"]) .mirror-decoration {
  opacity: 0.05;
}

body:has(.app-shell[data-flow-state="CONSULTATION_SUMMARY"]) .salon-logo-heart-wrap {
  opacity: 0.06;
}

@media (min-width: 1025px) {
  .app-shell.ui-guiding .dialogue-block,
  .app-shell.ui-speaking .dialogue-block {
    padding-top: min(8vh, 4rem);
    margin-top: 0;
  }

  .app-shell.ui-guiding .messages,
  .app-shell.ui-speaking .messages {
    max-height: min(28vh, 380px);
  }

  body:has(.app-shell[data-flow-state="PROPOSAL_SALON"]) .mirror-decoration,
  body:has(.app-shell[data-flow-state="HOME_ROUTINE"]) .mirror-decoration,
  body:has(.app-shell[data-flow-state="CONSULTATION_SUMMARY"]) .mirror-decoration {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem 1.5rem 0 0;
  }

  body:has(.app-shell[data-flow-state="CONSULTATION_SUMMARY"]) .mirror-decoration {
    opacity: 1;
  }

  body:has(.app-shell[data-flow-state="PROPOSAL_SALON"]) .salon-logo-heart-wrap,
  body:has(.app-shell[data-flow-state="HOME_ROUTINE"]) .salon-logo-heart-wrap {
    width: min(18vmin, 90px);
    opacity: 0.72;
  }

  body:has(.app-shell[data-flow-state="CONSULTATION_SUMMARY"]) .salon-logo-heart-wrap {
    width: min(20vmin, 110px);
    opacity: 0.8;
  }

  body:has(.app-shell[data-flow-state="CONSULTATION_SUMMARY"]) .salon-logo-heart {
    filter: invert(1) brightness(1.25);
  }

  .app-shell[data-flow-state="PROPOSAL_SALON"] .dialogue-block,
  .app-shell[data-flow-state="HOME_ROUTINE"] .dialogue-block,
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .dialogue-block {
    padding-top: min(2vh, 1rem);
    margin-top: 0;
  }

  .app-shell[data-flow-state="PROPOSAL_SALON"] .messages,
  .app-shell[data-flow-state="HOME_ROUTINE"] .messages,
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .messages {
    max-height: min(72vh, 900px);
    overflow-y: auto;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-card {
    max-height: none;
    overflow-y: visible;
  }
}

.msg.user {
  margin-left: auto;
  background: rgba(20, 20, 20, 0.28);
  border: none;
  border-bottom: 1px solid rgba(122, 115, 112, 0.32);
  color: var(--text-primary);
  max-width: 94%;
}

.msg.system {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

/* CTA: touch ≥60px, pesi diversi */
.btn {
  min-height: 3.75rem;
  min-width: 3.75rem;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(240, 236, 228, 0.28);
  padding: 0.95rem 1.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.35);
  transition:
    opacity 0.45s ease,
    border-color 0.45s ease,
    background 0.45s ease,
    transform 0.35s ease;
}

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

.btn:not(:disabled):active {
  transform: scale(0.98);
}

.app-shell:not(.ui-professional) .flow-options-slot button.btn:active:not(:disabled) {
  background-color: #ffffff !important;
  color: #000000 !important;
  transform: scale(0.98);
  transition:
    background-color 0.1s ease,
    color 0.1s ease,
    transform 0.1s ease;
}

.btn-primary {
  background: rgba(240, 236, 228, 0.12);
  border-color: rgba(240, 236, 228, 0.45);
  color: var(--text-primary);
}

.btn-primary:not(:disabled):hover {
  border-color: rgba(240, 236, 228, 0.62);
  background: rgba(240, 236, 228, 0.18);
}

.btn-secondary,
.btn-mode {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(122, 115, 112, 0.38);
  color: rgba(240, 236, 228, 0.88);
  font-weight: 500;
}

.btn-secondary:not(:disabled):hover,
.btn-mode:not(:disabled):hover {
  border-color: rgba(240, 236, 228, 0.38);
  background: rgba(20, 20, 20, 0.45);
}

.btn-send {
  flex: 0 0 auto;
  min-width: 6.5rem;
  background: rgba(240, 236, 228, 0.1);
}

textarea#textInput {
  resize: none;
  overflow-y: hidden;
  line-height: 1.35;
  white-space: pre-wrap;
}

#textInput {
  flex: 1 1 14rem;
  min-height: 3.75rem;
  min-width: 12rem;
  border-radius: 999px;
  border: 1px solid rgba(122, 115, 112, 0.35);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  padding: 0.95rem 1.35rem;
  max-height: 3.75rem;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.03em;
  transition: border-color 0.45s ease, background 0.45s ease;
}

#textInput::placeholder {
  color: var(--text-secondary);
}

#textInput:focus {
  outline: none;
  border-color: rgba(240, 236, 228, 0.48);
  background: rgba(0, 0, 0, 0.55);
}

.app-shell.ui-professional .composer-block { max-width: min(72rem, 92vw); }
.app-shell.ui-professional .composer-block .input-row { align-items: stretch; }
.app-shell.ui-professional #textInput { min-height: 8rem; max-height: 16rem; font-size: 1.08rem; border-radius: 1.25rem; padding: 0.8rem 1.6rem; }
.app-shell.ui-professional .btn-send { min-height: 5.25rem; }

.photo-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.35rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 36rem;
  padding-top: 0.25rem;
}

.photo-status {
  flex: 1 1 100%;
  margin: 0;
  min-height: 1.35em;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: 0.04em;
}

.photo-consent-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 36rem;
  text-align: center;
}

.photo-consent-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.6vw, 1.28rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--text-primary);
}

.photo-consent-lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 28rem;
}

.photo-consent-legal {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 30rem;
}

.btn-photo-privacy-info {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
  vertical-align: baseline;
}

.btn-photo-privacy-info:hover {
  color: var(--text-primary);
}

.btn-photo-privacy-info:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 0.15rem;
}

.photo-primary-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
  max-width: 22rem;
  margin-top: 0.25rem;
}

.photo-primary-actions .btn {
  width: 100%;
  justify-content: center;
}

.photo-privacy-dialog {
  margin: auto;
  padding: 0;
  border: 1px solid rgba(240, 236, 228, 0.28);
  border-radius: 0.85rem;
  max-width: min(26rem, 92vw);
  width: calc(100% - 2rem);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.45);
  z-index: 120;
}

.photo-privacy-dialog::backdrop {
  background: rgba(6, 6, 6, 0.62);
  backdrop-filter: blur(2px);
}

.photo-privacy-dialog-inner {
  padding: 1.25rem 1.35rem 1.15rem;
}

.photo-privacy-dialog-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
}

.photo-privacy-dialog-body {
  font-size: 0.92rem;
  line-height: 1.58;
  color: var(--text-secondary);
}

.photo-privacy-dialog-body p {
  margin: 0 0 0.55rem;
}

.photo-privacy-dialog-body p:last-child {
  margin-bottom: 0;
}

.photo-privacy-dialog-policy-wrap {
  margin-top: 0.65rem !important;
}

.photo-privacy-policy-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.photo-privacy-policy-link:hover {
  color: var(--text-primary);
}

.photo-privacy-dialog-footer {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(122, 115, 112, 0.22);
  display: flex;
  justify-content: flex-end;
}

.vision-debug-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  max-height: 40vh;
  overflow: auto;
}

.vision-debug-panel hr {
  display: none;
}

.vision-debug-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.vision-debug-label {
  width: 100%;
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.vision-debug-label code {
  font-size: 0.75em;
  color: var(--accent);
}

.vision-debug-output {
  width: 100%;
  max-height: 18vh;
  overflow: auto;
  margin: 0;
  padding: 0.5rem;
  font-size: 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  color: var(--text-secondary);
  scrollbar-width: thin;
}

@media (max-height: 700px) {
  .dialogue-block {
    padding-top: min(30vh, 14rem);
  }
}

/* Tablet tuning: logo in alto a destra, dialogo più alto, più spazio ai bottoni */
@media (max-width: 1024px) {
  body:has(.app-shell.ui-guiding) .mirror-decoration,
  body:has(.app-shell.ui-speaking) .mirror-decoration,
  body:has(.app-shell.ui-professional) .mirror-decoration {
    align-items: flex-start;
    justify-content: flex-end;
    padding: clamp(0.75rem, 3vh, 1.5rem) clamp(0.85rem, 4vw, 1.5rem) 0 0;
  }

  body:has(.app-shell.ui-guiding) .salon-logo-heart-wrap,
  body:has(.app-shell.ui-speaking) .salon-logo-heart-wrap,
  body:has(.app-shell.ui-professional) .salon-logo-heart-wrap {
    width: min(22vmin, 110px);
    opacity: 0.78;
  }

  .app-shell.ui-guiding .dialogue-block,
  .app-shell.ui-speaking .dialogue-block,
  .app-shell.ui-professional .dialogue-block {
    padding-top: min(18vh, 10rem);
    margin-top: clamp(-3vh, -1.5rem, -0.5rem);
  }

  .app-shell.ui-guiding .messages,
  .app-shell.ui-speaking .messages,
  .app-shell.ui-professional .messages {
    min-height: min(8rem, 16vh);
    max-height: min(26vh, 360px);
    padding-top: clamp(0.65rem, 2vh, 1rem);
    padding-bottom: clamp(0.65rem, 2vh, 1rem);
  }

  .app-shell.ui-guiding .scene-actions,
  .app-shell.ui-speaking .scene-actions,
  .app-shell.ui-professional .scene-actions {
    gap: clamp(0.45rem, 1.5vh, 0.75rem);
    padding: clamp(0.65rem, 2vh, 1rem) 0 clamp(0.1rem, 0.5vh, 0.35rem);
  }

  .app-shell.ui-guiding .controls,
  .app-shell.ui-guiding .mode-box,
  .app-shell.ui-guiding .composer-block .input-row,
  .app-shell.ui-guiding .photo-box,
  .app-shell.ui-speaking .controls,
  .app-shell.ui-speaking .mode-box,
  .app-shell.ui-speaking .composer-block .input-row,
  .app-shell.ui-speaking .photo-box,
  .app-shell.ui-professional .controls,
  .app-shell.ui-professional .mode-box,
  .app-shell.ui-professional .composer-block .input-row,
  .app-shell.ui-professional .photo-box {
    gap: 0.65rem 0.85rem;
  }

  .app-shell.ui-guiding .msg.assistant,
  .app-shell.ui-speaking .msg.assistant,
  .app-shell.ui-professional .msg.assistant {
    font-size: clamp(1.22rem, 3.6vw, 1.36rem);
    line-height: 1.6;
  }

  body:has(.app-shell.ui-proposal) .mirror-decoration {
    align-items: flex-start;
    justify-content: flex-end;
    padding: clamp(0.75rem, 3vh, 1.5rem) clamp(0.85rem, 4vw, 1.5rem) 0 0;
  }

  body:has(.app-shell.ui-proposal) .salon-logo-heart-wrap {
    width: min(22vmin, 110px);
    opacity: 0.28;
  }

  .app-shell.ui-proposal .dialogue-block {
    padding-top: min(2vh, 1rem);
    margin-top: 0;
  }

  .app-shell.ui-proposal .messages {
    max-height: min(75vh, 940px);
    padding-top: clamp(0.75rem, 2vh, 1.25rem);
    padding-bottom: clamp(0.75rem, 2vh, 1.25rem);
  }

  .app-shell.ui-proposal .msg.assistant {
    font-size: clamp(1.1rem, 3.2vw, 1.25rem);
    line-height: 1.65;
  }

  /* HOME_ROUTINE: routine scrollabile nel viewport, CTA (#flowOptions) sempre raggiungibile */
  .app-shell[data-flow-state="HOME_ROUTINE"] .mirror-stage.ambient-scene {
    max-height: calc(100dvh - 4rem);
    overflow: hidden;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .dialogue-block {
    min-height: 0;
    overflow: hidden;
    justify-content: flex-start;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .scene-actions {
    flex-shrink: 0;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .dynamic-control-stack {
    flex-shrink: 0;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] #flowOptions {
    flex-shrink: 0;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .mirror-stage.ambient-scene {
    max-height: calc(100dvh - 4rem);
    overflow: hidden;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .dialogue-block {
    min-height: 0;
    overflow: hidden;
    justify-content: flex-start;
    padding-top: min(3vh, 1.3rem);
    margin-top: 0;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .scene-actions,
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .dynamic-control-stack,
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] #flowOptions {
    flex-shrink: 0;
  }
}

@keyframes jervi-reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* 27A-2 Tablet Luxury Redesign — FASE 1 CSS-only (tablet / iPad salone) */
@media (max-width: 1024px) {
  body:has(.app-shell[data-flow-state="HOME_ROUTINE"]),
  body:has(.app-shell[data-flow-state="CONSULTATION_SUMMARY"]) {
    background-color: #0a0a0a;
  }

  body:has(.app-shell[data-flow-state="HOME_ROUTINE"]) .mirror-decoration,
  body:has(.app-shell[data-flow-state="CONSULTATION_SUMMARY"]) .mirror-decoration {
    opacity: 0.045;
  }

  body:has(.app-shell[data-flow-state="HOME_ROUTINE"]) .salon-logo-heart-wrap,
  body:has(.app-shell[data-flow-state="CONSULTATION_SUMMARY"]) .salon-logo-heart-wrap {
    opacity: 0.42;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .mirror-stage.ambient-scene,
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .mirror-stage.ambient-scene {
    background: radial-gradient(
      ellipse 140% 90% at 50% 20%,
      rgba(28, 28, 28, 0.55) 0%,
      #0a0a0a 62%
    );
  }

  /* HOME_ROUTINE — boutique: card per prime, copy routine defilata */
  .app-shell.ui-proposal[data-flow-state="HOME_ROUTINE"] .messages > .msg.assistant {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    font-size: clamp(0.76rem, 2.5vw, 0.88rem);
    line-height: 1.68;
    letter-spacing: 0.04em;
    color: rgba(168, 162, 154, 0.92);
    font-style: normal;
    padding-bottom: 0.25rem;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-cards {
    order: -1;
    align-self: stretch;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    gap: 1rem;
    max-width: none;
    width: auto;
    margin-left: calc(-1 * clamp(0.5rem, 2vw, 1rem));
    margin-right: calc(-1 * clamp(0.5rem, 2vw, 1rem));
    margin-top: 0;
    padding: 0 clamp(0.5rem, 2vw, 1rem) 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-padding-inline: clamp(0.5rem, 2vw, 1rem) 2.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-cards::-webkit-scrollbar {
    display: none;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-card {
    flex: 0 0 auto;
    width: clamp(240px, 72vw, 340px);
    max-width: none;
    min-width: 0;
    scroll-snap-align: center;
    border-radius: 20px;
    padding: 1.05rem 1.1rem 1.2rem;
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.24);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
    gap: 0.55rem;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-image-wrap {
    height: 152px;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-meta {
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(245, 241, 232, 0.94);
    font-style: normal;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-phase {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: rgba(212, 175, 55, 0.88);
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-brandrow {
    font-size: 0.76rem;
    color: rgba(168, 162, 154, 0.88);
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-name {
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #f5f1e8;
    font-style: normal;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-benefit {
    font-size: 0.82rem;
    line-height: 1.52;
    color: rgba(245, 241, 232, 0.78);
    font-style: normal;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-howto {
    font-size: 0.78rem;
    line-height: 1.48;
    color: rgba(168, 162, 154, 0.82);
    font-style: normal;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-price {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: #d4af37;
    margin-top: 0.35rem;
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] .scene-actions {
    padding-bottom: clamp(0.35rem, 1.2vh, 0.75rem);
  }

  /* CONSULTATION_SUMMARY — Piano Salone premium */
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .msg.assistant {
    width: 100%;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-card {
    opacity: 0;
    animation: jervi-reveal 0.5s ease forwards;
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 20px;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
    padding: clamp(1.45rem, 3.5vw, 1.85rem) clamp(1.25rem, 3.5vw, 1.65rem);
    width: min(720px, 100%);
    max-height: min(58vh, 680px);
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-title {
    font-size: clamp(1.45rem, 4vw, 1.85rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    color: #f5f1e8;
    font-style: normal;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-subtitle {
    font-size: clamp(0.88rem, 2.2vw, 1rem);
    line-height: 1.55;
    color: rgba(168, 162, 154, 0.95);
    margin-bottom: 1.15rem;
    font-style: normal;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-section {
    margin-top: 1.15rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-section:first-of-type {
    margin-top: 0.5rem;
    border-top: none;
    padding-top: 0.35rem;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-section-title {
    font-size: clamp(0.72rem, 1.8vw, 0.82rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.95);
    font-weight: 600;
    font-style: normal;
    margin-bottom: 0.35rem;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"]
    .consultation-summary-section:first-of-type
    .consultation-summary-section-title {
    font-size: clamp(0.78rem, 2vw, 0.9rem);
    color: #e8c547;
    letter-spacing: 0.14em;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-items {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.65rem;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-item {
    margin: 0;
    padding: 0.78rem 1rem;
    font-size: clamp(0.94rem, 2.4vw, 1.06rem);
    line-height: 1.58;
    letter-spacing: 0.02em;
    color: #f5f5f5;
    font-style: normal;
    border: 1px solid rgba(212, 175, 55, 0.14);
    border-radius: 14px;
    background: rgba(14, 14, 14, 0.72);
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .msg.assistant:not(:has(.consultation-summary-card)) {
    font-size: clamp(0.95rem, 2.6vw, 1.08rem);
    line-height: 1.68;
    letter-spacing: 0.03em;
    color: rgba(245, 241, 232, 0.94);
    font-style: normal;
    padding: 1.25rem 0.85rem;
    background: rgba(20, 20, 20, 0.88);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .scene-actions {
    padding-bottom: clamp(0.35rem, 1.2vh, 0.85rem);
  }

  .app-shell[data-flow-state="HOME_ROUTINE"] #flowOptions .btn,
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] #flowOptions .btn {
    margin-top: 0.15rem;
  }
}

/* —— 27A-3: dashboard visibile solo tablet; PC usa ancora .consultation-summary-card —— */
.summary-dashboard-tablet {
  display: none;
}

/* 27A-3 Tablet Dashboard */
@media (max-width: 1024px) {
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .msg.assistant.has-tablet-dashboard {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: min(36rem, 100%);
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(0.35rem, 1.5vw, 0.75rem);
    padding-right: clamp(0.35rem, 1.5vw, 0.75rem);
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"]
    .msg.assistant.has-tablet-dashboard
    .consultation-summary-card {
    display: none;
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .msg.assistant.has-tablet-dashboard .summary-dashboard-tablet {
    display: flex;
    flex-direction: column;
    gap: clamp(1.15rem, 3vw, 1.65rem);
    width: 100%;
    max-width: min(34rem, 100%);
    margin: 0 auto;
    padding: clamp(1.1rem, 3vw, 1.5rem) clamp(0.85rem, 2.8vw, 1.25rem) clamp(1rem, 2.5vw, 1.35rem);
    transform: translateZ(0);
    opacity: 0;
    animation: jervi-reveal 0.55s ease forwards;
  }

  .summary-dashboard-hero {
    text-align: center;
    padding-bottom: 0.15rem;
  }

  .summary-dashboard-hero-title {
    margin: 0;
    font-size: clamp(1.35rem, 4.2vw, 1.85rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #f5f1e8;
    line-height: 1.28;
  }

  .summary-dashboard-hero-subtitle {
    margin: 0.65rem 0 0;
    font-size: clamp(0.88rem, 2.4vw, 1rem);
    line-height: 1.62;
    letter-spacing: 0.02em;
    color: rgba(168, 162, 154, 0.96);
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
  }

  .summary-dashboard-main {
    display: flex;
    flex-direction: column;
    gap: clamp(1.1rem, 2.8vw, 1.45rem);
  }

  .summary-services-hero {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .summary-services-hero-heading {
    margin: 0;
    font-size: clamp(0.72rem, 2vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.92);
    text-align: center;
  }

  .service-hero-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: clamp(1.1rem, 2.8vw, 1.35rem) clamp(1rem, 2.6vw, 1.3rem);
    border-radius: 20px;
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
  }

  .service-hero-name {
    font-size: clamp(1.05rem, 3vw, 1.22rem);
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #f5f1e8;
    line-height: 1.35;
    padding-right: 5.5rem;
  }

  .service-hero-benefit {
    margin: 0;
    font-size: clamp(0.86rem, 2.3vw, 0.95rem);
    line-height: 1.55;
    letter-spacing: 0.015em;
    color: rgba(245, 241, 232, 0.82);
  }

  .service-hero-badge {
    position: absolute;
    top: clamp(0.85rem, 2vw, 1rem);
    right: clamp(0.85rem, 2vw, 1rem);
    font-size: clamp(0.62rem, 1.6vw, 0.68rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.88);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 999px;
    padding: 0.28rem 0.55rem;
    background: rgba(10, 10, 10, 0.55);
  }

  .summary-insight-card {
    padding: clamp(0.95rem, 2.4vw, 1.15rem) clamp(1rem, 2.5vw, 1.2rem);
    border-radius: 16px;
    background: rgba(14, 14, 14, 0.72);
    border: 1px solid rgba(212, 175, 55, 0.14);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  }

  .summary-insight-heading {
    margin: 0 0 0.45rem;
    font-size: clamp(0.68rem, 1.8vw, 0.76rem);
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(168, 162, 154, 0.88);
  }

  .summary-insight-text {
    margin: 0;
    font-size: clamp(0.86rem, 2.2vw, 0.95rem);
    line-height: 1.58;
    letter-spacing: 0.02em;
    color: rgba(245, 241, 232, 0.88);
  }

  .summary-routine-pills {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .summary-routine-heading {
    margin: 0;
    font-size: clamp(0.72rem, 2vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.88);
    text-align: center;
  }

  .summary-routine-pills-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.55rem;
  }

  .routine-pill {
    display: inline-block;
    max-width: 100%;
    padding: 0.48rem 0.85rem;
    border-radius: 999px;
    font-size: clamp(0.82rem, 2.1vw, 0.9rem);
    letter-spacing: 0.02em;
    line-height: 1.35;
    color: rgba(245, 241, 232, 0.92);
    background: rgba(18, 18, 18, 0.88);
    border: 1px solid rgba(212, 175, 55, 0.2);
  }

  .summary-dashboard-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding-top: 0.25rem;
    padding-bottom: 0.15rem;
  }

  .summary-dashboard-btn-team {
    width: 100%;
    transform: translateZ(0);
    transition:
      transform 0.22s ease,
      opacity 0.22s ease,
      border-color 0.22s ease;
  }

  .summary-dashboard-btn-team:not(:disabled):active {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

/* 31D-E2 — Home mobile polish: scoped exclusively by runtime context. */
@media (max-width: 768px) {
  .app-shell[data-context="home"] {
    --home-card-bg: rgba(17, 17, 17, 0.88);
    --home-card-border: rgba(240, 236, 228, 0.2);
    --home-soft-text: rgba(245, 241, 232, 0.78);
    --home-muted-text: rgba(216, 209, 196, 0.72);
    padding: 0.7rem clamp(0.85rem, 4vw, 1.1rem) 0.6rem;
    overflow-x: hidden;
  }

  .app-shell[data-context="home"] .mirror-stage.ambient-scene {
    min-height: calc(100dvh - 1.3rem);
    gap: 0;
  }

  .app-shell[data-context="home"] .stage-header {
    padding: 0 0.15rem 0.42rem;
  }

  .app-shell[data-context="home"] .eyebrow {
    margin-bottom: 0.24rem;
    font-size: 0.52rem;
    letter-spacing: 0.34em;
  }

  .app-shell[data-context="home"] .stage-title {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    line-height: 1.25;
    color: rgba(245, 241, 232, 0.68);
  }

  .app-shell[data-context="home"] .dialogue-block {
    padding-top: min(28vh, 14rem);
    margin-top: clamp(-6vh, -2.2rem, -1rem);
  }

  .app-shell[data-context="home"] .messages {
    max-height: min(42vh, 430px);
    padding: 0.85rem 0.15rem 0.95rem;
  }

  .app-shell[data-context="home"] .msg.assistant {
    color: rgba(247, 241, 231, 0.9);
    line-height: 1.68;
  }

  .app-shell[data-context="home"] .scene-actions {
    gap: 0.72rem;
    padding: 0.55rem 0 0.35rem;
  }

  .app-shell[data-context="home"] .dynamic-control-stack {
    max-width: 100%;
    gap: 0.76rem;
  }

  .app-shell[data-context="home"] #flowOptions.flow-options-slot {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.62rem;
    width: 100%;
    max-width: min(100%, 23rem);
  }

  .app-shell[data-context="home"] #flowOptions.flow-options-slot[hidden] {
    display: none;
  }

  .app-shell[data-context="home"] #flowOptions .btn {
    width: 100%;
    min-height: 3.08rem;
    margin: 0;
    padding: 0.82rem 0.95rem;
    border-radius: 12px;
    border-color: rgba(240, 236, 228, 0.26);
    background: rgba(14, 14, 14, 0.72);
    color: rgba(247, 241, 231, 0.94);
    font-size: 0.9rem;
    line-height: 1.28;
    letter-spacing: 0.02em;
    text-align: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  }

  .app-shell[data-context="home"] #flowOptions .btn.flow-option-selected {
    border-color: rgba(240, 236, 228, 0.58);
    background: linear-gradient(135deg, rgba(240, 236, 228, 0.2), rgba(20, 20, 20, 0.86));
    color: #fff8ec;
    box-shadow: inset 0 0 0 1px rgba(240, 236, 228, 0.22), 0 10px 24px rgba(0, 0, 0, 0.24);
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .dialogue-block,
  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .dialogue-block {
    padding-top: 0;
    margin-top: 0;
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .messages,
  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .messages {
    max-height: none;
    padding: 0.25rem 0 0.75rem;
    overflow-x: hidden;
  }

  .app-shell[data-context="home"].ui-proposal[data-flow-state="HOME_ROUTINE"] .messages > .msg.assistant {
    gap: 0.82rem;
    font-size: 0.9rem;
    line-height: 1.66;
    letter-spacing: 0.015em;
    color: rgba(247, 241, 231, 0.9);
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-cards {
    order: -1;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.78rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 0 0.25rem;
    overflow-x: hidden;
    overflow-y: visible;
    scroll-snap-type: none;
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    scroll-snap-align: none;
    border-radius: 16px;
    padding: 0.9rem 0.95rem 1rem;
    background: var(--home-card-bg);
    border: 1px solid var(--home-card-border);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
    gap: 0.58rem;
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-image-wrap {
    height: 118px;
    margin-bottom: 0.1rem;
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-meta {
    gap: 0.32rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(247, 241, 231, 0.9);
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-phase {
    font-size: 0.68rem;
    letter-spacing: 0.13em;
    color: var(--text-secondary);
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-brandrow {
    font-size: 0.74rem;
    color: var(--home-muted-text);
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-name {
    font-size: 1rem;
    line-height: 1.34;
    color: #fff8ec;
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-benefit {
    font-size: 0.86rem;
    line-height: 1.48;
    color: rgba(247, 241, 231, 0.84);
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-howto {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--home-soft-text);
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-price {
    margin-top: 0.18rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: rgba(240, 236, 228, 0.96);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .msg.assistant.has-tablet-dashboard {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .msg.assistant.has-tablet-dashboard .summary-dashboard-tablet {
    gap: 1rem;
    max-width: 100%;
    padding: 0.65rem 0.15rem 0.85rem;
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .summary-dashboard-hero-title {
    font-size: clamp(1.22rem, 7vw, 1.55rem);
    letter-spacing: 0.035em;
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .summary-dashboard-hero-subtitle,
  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-text,
  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .service-hero-benefit {
    color: rgba(247, 241, 231, 0.84);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .service-hero-card,
  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-card {
    border-radius: 16px;
    background: var(--home-card-bg);
    border-color: var(--home-card-border);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .routine-pill {
    border-radius: 12px;
    background: rgba(14, 14, 14, 0.78);
    color: rgba(247, 241, 231, 0.9);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-commercial-cta {
    gap: 0.72rem;
    margin-top: 0.15rem;
    padding: 0.88rem;
    border-radius: 16px;
    background: rgba(12, 12, 12, 0.84);
    border-color: rgba(240, 236, 228, 0.22);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-commercial-note {
    font-size: 0.83rem;
    line-height: 1.5;
    color: rgba(247, 241, 231, 0.86);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-commercial-note-safe {
    color: var(--home-muted-text);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-commercial-title {
    margin-top: 0.12rem;
    font-size: 0.84rem;
    letter-spacing: 0.1em;
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-booking-links {
    gap: 0.6rem;
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-booking-link,
  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link {
    flex: 0 0 auto;
    width: 100%;
    min-height: 3.75rem;
    border-radius: 12px;
    padding: 0.76rem 0.9rem;
    font-size: 0.88rem;
    line-height: 1.25;
    letter-spacing: 0.02em;
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-booking-link {
    background: rgba(18, 18, 18, 0.78);
    border-color: rgba(240, 236, 228, 0.3);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link {
    background: linear-gradient(135deg, rgba(240, 236, 228, 0.28), rgba(20, 20, 20, 0.72));
    border-color: rgba(240, 236, 228, 0.45);
  }

  .app-shell[data-context="home"] .btn-reset-outside {
    min-height: 2.2rem;
    margin-top: 0.38rem;
    padding: 0.42rem 0.88rem;
    border-radius: 10px;
    border-color: rgba(245, 241, 232, 0.16);
    background: rgba(0, 0, 0, 0.14);
    color: rgba(245, 241, 232, 0.54);
    font-size: 0.68rem;
    letter-spacing: 0.11em;
    box-shadow: none;
    opacity: 0.78;
  }
}

/* 31D-E3 — Home mobile scroll/clipping fix, scoped only to Home. */
@media (max-width: 768px) {
  .app-shell[data-context="home"] .dialogue-block {
    overflow: visible;
  }

  .app-shell[data-context="home"] .messages {
    padding-top: max(1.15rem, calc(0.9rem + env(safe-area-inset-top)));
    padding-bottom: 1.35rem;
    scroll-padding-top: calc(1.25rem + env(safe-area-inset-top));
    overflow-y: auto;
  }

  .app-shell[data-context="home"] .messages > .msg {
    scroll-margin-top: calc(80px + env(safe-area-inset-top));
  }

  .app-shell[data-context="home"]:not([data-flow-state="HOME_ROUTINE"]):not([data-flow-state="CONSULTATION_SUMMARY"])
    .messages {
    overflow: visible;
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .messages,
  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .messages {
    padding-top: max(1rem, calc(0.75rem + env(safe-area-inset-top)));
    padding-bottom: calc(1.8rem + env(safe-area-inset-bottom));
    -webkit-mask-image: linear-gradient(
      to bottom,
      #000 0,
      #000 calc(100% - 2.1rem),
      rgba(0, 0, 0, 0.34) calc(100% - 0.55rem),
      transparent 100%
    );
    mask-image: linear-gradient(
      to bottom,
      #000 0,
      #000 calc(100% - 2.1rem),
      rgba(0, 0, 0, 0.34) calc(100% - 0.55rem),
      transparent 100%
    );
  }
}

/* 37A-1 — Salon CTA & Flow Buttons Luxury Polish */
.app-shell[data-context="salon"] #flowOptions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  justify-content: center;
}

.app-shell[data-context="salon"] #flowOptions button,
.app-shell[data-context="salon"] #flowOptions .btn {
  min-height: 48px;
  padding: 13px 28px;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(240, 236, 228, 0.72);
  background-color: rgba(12, 11, 17, 0.76);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.2), rgba(240, 236, 228, 0.07));
  color: rgba(255, 249, 224, 0.96);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  letter-spacing: 0.035em;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    background-image 160ms ease,
    box-shadow 160ms ease;
}

.app-shell[data-context="salon"] #flowOptions button:hover,
.app-shell[data-context="salon"] #flowOptions .btn:hover {
  border-color: rgba(240, 236, 228, 0.95);
  background-color: rgba(18, 16, 23, 0.86);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.3), rgba(240, 236, 228, 0.1));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(240, 236, 228, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.app-shell[data-context="salon"] #flowOptions button:active,
.app-shell[data-context="salon"] #flowOptions .btn:active {
  transform: scale(0.975);
}

.app-shell[data-context="salon"] #flowOptions button:focus-visible,
.app-shell[data-context="salon"] #flowOptions .btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

/* 37A-2 — Salon Flow Buttons Uniformity + Selected State */
.app-shell[data-context="salon"] #flowOptions {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  width: min(100%, 620px);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  gap: 14px;
}

.app-shell[data-context="salon"] #flowOptions button,
.app-shell[data-context="salon"] #flowOptions .btn,
.app-shell[data-context="salon"] #flowOptions .btn-mode {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 52px;
  padding: 14px 22px;
  text-align: center;
}

.app-shell[data-context="salon"] #flowOptions button.flow-option-selected,
.app-shell[data-context="salon"] #flowOptions button[aria-pressed='true'] {
  border-color: rgba(184, 140, 42, 0.98);
  background-color: rgba(240, 236, 228, 0.94);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.98), rgba(240, 236, 228, 0.88));
  color: rgba(22, 18, 10, 0.94);
  text-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    0 0 0 1px rgba(160, 120, 32, 0.4),
    0 14px 36px rgba(240, 236, 228, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.app-shell[data-context="salon"] #flowOptions button.flow-option-selected:hover,
.app-shell[data-context="salon"] #flowOptions button[aria-pressed='true']:hover {
  border-color: rgba(160, 120, 32, 0.98);
  background-color: rgba(244, 224, 150, 0.98);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.99), rgba(228, 202, 120, 0.92));
  color: rgba(14, 12, 8, 0.96);
  box-shadow:
    0 0 0 1px rgba(140, 105, 28, 0.45),
    0 16px 40px rgba(240, 236, 228, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.app-shell[data-context="salon"] #flowOptions button.flow-option-selected:focus-visible,
.app-shell[data-context="salon"] #flowOptions button[aria-pressed='true']:focus-visible {
  outline: 2px solid rgba(120, 88, 22, 0.88);
  outline-offset: 4px;
}

/* Continua (multi-select): slot separato da #flowOptions, classi distinte */
.app-shell[data-context="salon"] #concernContinueSlot,
.app-shell[data-context="salon"] #lastServiceContinueSlot {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  width: min(100%, 620px);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  gap: 0;
}

.app-shell[data-context="salon"] #concernContinueSlot .btn,
.app-shell[data-context="salon"] #lastServiceContinueSlot .btn {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 14px 22px;
  text-align: center;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(184, 140, 42, 0.95);
  background-color: rgba(240, 236, 228, 0.92);
  background-image: linear-gradient(180deg, rgba(255, 248, 224, 0.98), rgba(200, 170, 88, 0.82));
  color: rgba(18, 14, 8, 0.95);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: none;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    background-image 160ms ease,
    box-shadow 160ms ease;
}

.app-shell[data-context="salon"] #concernContinueSlot .btn:hover,
.app-shell[data-context="salon"] #lastServiceContinueSlot .btn:hover {
  border-color: rgba(160, 120, 32, 0.98);
  background-color: rgba(228, 202, 120, 0.98);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.99), rgba(240, 236, 228, 0.9));
}

.app-shell[data-context="salon"] #concernContinueSlot .btn:active,
.app-shell[data-context="salon"] #lastServiceContinueSlot .btn:active {
  transform: scale(0.975);
}

.app-shell[data-context="salon"] #concernContinueSlot .btn:focus-visible,
.app-shell[data-context="salon"] #lastServiceContinueSlot .btn:focus-visible {
  outline: 2px solid rgba(120, 88, 22, 0.88);
  outline-offset: 4px;
}

/* Ricomincia + Salta foto: secondari, fuori da #flowOptions */
.app-shell[data-context="salon"] #resetBtn.btn-reset-outside,
.app-shell[data-context="salon"] #photoSkipBtn {
  border-radius: var(--btn-radius);
  border: 1px solid rgba(240, 236, 228, 0.38);
  background-color: rgba(8, 8, 10, 0.35);
  background-image: none;
  color: rgba(245, 238, 220, 0.82);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.app-shell[data-context="salon"] #resetBtn.btn-reset-outside:hover,
.app-shell[data-context="salon"] #photoSkipBtn:hover {
  border-color: rgba(240, 236, 228, 0.55);
  background-color: rgba(16, 14, 18, 0.55);
  color: rgba(255, 249, 236, 0.92);
}

.app-shell[data-context="salon"] #resetBtn.btn-reset-outside:focus-visible,
.app-shell[data-context="salon"] #photoSkipBtn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* 37A-3B — Salon Unified Button System Black/White */
.app-shell[data-context="salon"] #flowOptions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-width: min(100%, 680px);
  margin-inline: auto;
  gap: 14px;
  align-items: stretch;
  justify-content: center;
}

.app-shell[data-context="salon"] #flowOptions button,
.app-shell[data-context="salon"] #flowOptions .btn,
.app-shell[data-context="salon"] #flowOptions .btn-mode {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 14px 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: rgba(10, 10, 12, 0.92);
  background-image: none;
  color: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-weight: 700;
  letter-spacing: 0.025em;
  text-align: center;
  text-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app-shell[data-context="salon"] #flowOptions button:hover,
.app-shell[data-context="salon"] #flowOptions .btn:hover,
.app-shell[data-context="salon"] #flowOptions .btn-mode:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background-color: rgba(20, 20, 23, 0.96);
  background-image: none;
}

.app-shell[data-context="salon"] #flowOptions button.flow-option-selected,
.app-shell[data-context="salon"] #flowOptions button[aria-pressed='true'] {
  border-color: rgba(255, 255, 255, 0.96);
  background-color: rgba(248, 246, 238, 0.96);
  background-image: none;
  color: rgba(8, 8, 10, 0.96);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  text-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app-shell[data-context="salon"] #flowOptions button.flow-option-selected:hover,
.app-shell[data-context="salon"] #flowOptions button[aria-pressed='true']:hover {
  background-color: rgba(255, 255, 255, 0.98);
  background-image: none;
  color: rgba(5, 5, 7, 0.98);
  border-color: rgba(255, 255, 255, 0.98);
}

.app-shell[data-context="salon"] #flowOptions button.flow-option-selected:focus-visible,
.app-shell[data-context="salon"] #flowOptions button[aria-pressed='true']:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.88);
  outline-offset: 4px;
}

.app-shell[data-context="salon"] #flowOptions button:active,
.app-shell[data-context="salon"] #flowOptions .btn:active {
  transform: scale(0.985);
}

.app-shell[data-context="salon"] #flowOptions button:focus-visible,
.app-shell[data-context="salon"] #flowOptions .btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.82);
  outline-offset: 4px;
}

.app-shell[data-context="salon"] #concernContinueSlot,
.app-shell[data-context="salon"] #lastServiceContinueSlot {
  max-width: min(100%, 680px);
  margin-inline: auto;
}

.app-shell[data-context="salon"] #concernContinueSlot .btn,
.app-shell[data-context="salon"] #lastServiceContinueSlot .btn {
  grid-column: 1 / -1;
  box-sizing: border-box;
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.96);
  background-color: rgba(255, 255, 255, 0.96);
  background-image: none;
  color: rgba(5, 5, 7, 0.98);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-shadow: none;
}

.app-shell[data-context="salon"] #concernContinueSlot .btn:hover,
.app-shell[data-context="salon"] #lastServiceContinueSlot .btn:hover {
  background-color: rgba(255, 255, 255, 1);
  background-image: none;
  color: rgba(0, 0, 0, 1);
}

.app-shell[data-context="salon"] #concernContinueSlot .btn:active,
.app-shell[data-context="salon"] #lastServiceContinueSlot .btn:active {
  transform: scale(0.985);
}

.app-shell[data-context="salon"] #concernContinueSlot .btn:focus-visible,
.app-shell[data-context="salon"] #lastServiceContinueSlot .btn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.35);
  outline-offset: 3px;
}

.app-shell[data-context="salon"] #resetBtn.btn-reset-outside,
.app-shell[data-context="salon"] #photoSkipBtn {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background-color: rgba(8, 8, 10, 0.72);
  background-image: none;
  color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  text-shadow: none;
}

.app-shell[data-context="salon"] #resetBtn.btn-reset-outside:hover,
.app-shell[data-context="salon"] #photoSkipBtn:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background-color: rgba(18, 18, 21, 0.88);
  background-image: none;
  color: rgba(255, 255, 255, 0.94);
}

.app-shell[data-context="salon"] #resetBtn.btn-reset-outside:focus-visible,
.app-shell[data-context="salon"] #photoSkipBtn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 3px;
}

/* 37A-4B — Salon Routine/Product Cards Luxury Grid */
.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: min(100%, 980px);
  margin: 0;
  margin-inline: auto;
  gap: 16px;
  padding: 0;
  overflow: visible;
  overflow-x: visible;
  overflow-y: visible;
  scroll-snap-type: none;
  scroll-padding-inline: 0;
  -webkit-overflow-scrolling: auto;
  width: 100%;
  align-items: stretch;
  justify-items: stretch;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-card {
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
  min-width: 0;
  flex: initial;
  scroll-snap-align: unset;
  min-height: 120px;
  padding: 1.05rem 1.15rem 1.15rem;
  border-radius: 18px;
  background-color: rgba(10, 10, 12, 0.9);
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  justify-content: flex-start;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"]
  .routine-product-card:has(.routine-product-image-wrap) {
  min-height: 160px;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-image-wrap {
  width: 100%;
  flex-shrink: 0;
  margin: 0 auto 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  max-height: 200px;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-meta {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.94);
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-phase {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-brandrow {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.74);
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-name {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.96);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-benefit {
  font-size: 0.86rem;
  line-height: 1.48;
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-howto {
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-price {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.88);
}

@media (max-width: 768px) {
  .app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-cards {
    grid-template-columns: 1fr;
    max-width: min(100%, 620px);
  }
}

/* 37A-5 — Salon Odd Items + Text Contrast Microfix */

@media (min-width: 481px) and (max-width: 1024px) {
  .app-shell[data-context="salon"] #flowOptions > button:last-child:nth-child(odd),
  .app-shell[data-context="salon"] #flowOptions > .btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    max-width: calc(50% - 7px);
  }

  .app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-cards > .routine-product-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    max-width: calc(50% - 8px);
  }
}

.app-shell[data-context="salon"]:not(.ui-professional) .msg.assistant,
.app-shell[data-context="salon"]:not(.ui-professional) .dialogue-block p {
  color: rgba(255, 255, 255, 0.96);
  font-weight: 500;
}

/* 37A-6A — Salon Consultation Summary Dashboard Polish */

.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .summary-dashboard-tablet {
  max-width: min(100%, 920px);
  margin-inline: auto;
}

.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .service-hero-card {
  padding: 18px 20px;
  border-radius: 20px;
  background-color: rgba(10, 10, 12, 0.9);
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .service-hero-name {
  color: rgba(255, 255, 255, 0.96);
  line-height: 1.18;
  letter-spacing: 0.01em;
}

.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-card {
  border-radius: 20px;
  background-color: rgba(10, 10, 12, 0.88);
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-card h3,
.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-card .summary-insight-title {
  color: rgba(255, 255, 255, 0.94);
  letter-spacing: 0.08em;
}

.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-card p,
.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-card .summary-insight-text {
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}

.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .summary-routine-pills {
  gap: 10px;
}

.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .routine-pill {
  background-color: rgba(255, 255, 255, 0.09);
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
}

@media (min-width: 769px) and (max-width: 1024px) {
  .app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .summary-dashboard-tablet {
    max-width: min(100%, 980px);
  }
}

/* 37A-7A — Salon HOME_ROUTINE Text Visibility Polish */

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .msg.assistant {
  color: rgba(255, 255, 255, 0.97);
  line-height: 1.68;
  letter-spacing: 0.005em;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .dialogue-block {
  color: rgba(255, 255, 255, 0.97);
  line-height: 1.68;
  white-space: pre-line;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .dialogue-block p {
  color: rgba(255, 255, 255, 0.97);
  line-height: 1.68;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .msg.assistant:not(:has(.routine-product-cards)) .dialogue-block {
  background-color: rgba(8, 8, 10, 0.36);
  background-image: none;
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 1024px) {
  .app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .dialogue-block {
    font-size: clamp(15px, 2vw, 18px);
  }
}

/* 37A-7B — Salon HOME_ROUTINE Editorial Routine Steps */

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-steps-lede {
  margin: 0 0 14px;
  max-width: min(100%, 760px);
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(14px, 1.65vw, 17px);
  line-height: 1.55;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-steps-editorial {
  width: min(100%, 760px);
  margin: 26px auto 20px;
  padding: 0;
  display: grid;
  gap: 14px;
  color: rgba(255, 255, 255, 0.98);
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-steps-title {
  font-size: clamp(15px, 1.7vw, 18px);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.98);
  margin: 0 0 4px;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-card {
  background: rgba(8, 8, 10, 0.58);
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-number {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  color: rgba(5, 5, 7, 0.96);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-phase {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-product {
  font-size: clamp(18px, 2.15vw, 24px);
  line-height: 1.18;
  font-weight: 900;
  color: rgba(255, 255, 255, 1);
  margin-bottom: 8px;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-benefit {
  font-size: clamp(14px, 1.75vw, 17px);
  line-height: 1.5;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.91);
  margin-bottom: 14px;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-meta {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-meta-row {
  display: grid;
  grid-template-columns: minmax(76px, 0.32fr) 1fr;
  gap: 10px;
  align-items: baseline;
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-meta-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-meta-value {
  font-size: clamp(13px, 1.55vw, 16px);
  line-height: 1.45;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
}

@media (max-width: 768px) {
  .app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-steps-editorial {
    width: min(100%, 92vw);
    margin-top: 20px;
    gap: 12px;
  }

  .app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-card {
    padding: 16px 16px;
    border-radius: 18px;
  }

  .app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-step-meta-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

/* 10A-1 — Desktop polish luxury */
/* 10A-1: Vercom-ready via clamp/max-width, no hardware-specific viewport assumptions */
@media (min-width: 1025px) {
  /* —— 1. Layout root (Home / Salone) —— */
  .app-shell[data-context="home"] .mirror-stage.ambient-scene {
    width: min(100%, 60rem);
    max-width: min(92vw, 60rem);
    margin-inline: auto;
  }

  .app-shell[data-context="salon"] .mirror-stage.ambient-scene {
    width: min(100%, 67.5rem);
    max-width: min(94vw, 67.5rem);
    margin-inline: auto;
  }

  .app-shell[data-context="home"] .dialogue-block,
  .app-shell[data-context="salon"] .dialogue-block {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
  }

  .app-shell[data-context="home"] .messages,
  .app-shell[data-context="salon"] .messages {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
  }

  .app-shell[data-context="home"] .dynamic-control-stack,
  .app-shell[data-context="salon"] .dynamic-control-stack {
    width: 100%;
    max-width: min(100%, 40rem);
    margin-inline: auto;
  }

  .app-shell[data-context="home"] .scene-actions,
  .app-shell[data-context="salon"] .scene-actions {
    width: 100%;
    max-width: min(100%, 40rem);
    margin-inline: auto;
  }

  /* —— 2. Logo / decorazione (flow guidato; stati finali restano su blocco 1025px legacy) —— */
  body:has(.app-shell.ui-guiding) .mirror-decoration,
  body:has(.app-shell.ui-speaking) .mirror-decoration,
  body:has(.app-shell.ui-professional) .mirror-decoration {
    align-items: flex-start;
    justify-content: flex-end;
    padding: clamp(0.85rem, 2vh, 1.35rem) clamp(1rem, 2.2vw, 1.75rem) 0 0;
  }

  body:has(.app-shell.ui-guiding) .salon-logo-heart-wrap,
  body:has(.app-shell.ui-speaking) .salon-logo-heart-wrap,
  body:has(.app-shell.ui-professional) .salon-logo-heart-wrap {
    width: clamp(90px, 9vmin, 140px);
    max-width: 140px;
    opacity: 0.52;
  }

  body:has(.app-shell.ui-guiding) .salon-logo-heart,
  body:has(.app-shell.ui-speaking) .salon-logo-heart,
  body:has(.app-shell.ui-professional) .salon-logo-heart {
    max-width: 100%;
  }

  .app-shell.ui-guiding .dialogue-block,
  .app-shell.ui-speaking .dialogue-block,
  .app-shell.ui-professional .dialogue-block {
    padding-top: min(16vh, 9rem);
    margin-top: clamp(-2vh, -1rem, 0);
  }

  .app-shell.ui-guiding .messages,
  .app-shell.ui-speaking .messages,
  .app-shell.ui-professional .messages {
    min-height: min(10rem, 22vh);
    max-height: min(32vh, 420px);
    padding-left: clamp(0.35rem, 1.2vw, 0.85rem);
    padding-right: clamp(0.35rem, 1.2vw, 0.85rem);
  }

  /* —— 3. Domande / messaggi —— */
  .app-shell[data-context="home"].ui-guiding .msg.assistant,
  .app-shell[data-context="home"].ui-speaking .msg.assistant,
  .app-shell[data-context="salon"].ui-guiding .msg.assistant,
  .app-shell[data-context="salon"].ui-speaking .msg.assistant,
  .app-shell[data-context="home"].ui-professional .msg.assistant,
  .app-shell[data-context="salon"].ui-professional .msg.assistant {
    max-width: min(42rem, 100%);
    margin-right: auto;
    font-size: clamp(1.05rem, 1.25vw, 1.28rem);
    line-height: 1.52;
    letter-spacing: 0.025em;
    padding: clamp(1rem, 1.8vh, 1.2rem) clamp(0.95rem, 1.5vw, 1.15rem);
  }

  .app-shell[data-context="home"] .msg.user,
  .app-shell[data-context="salon"] .msg.user {
    max-width: min(36rem, 92%);
  }

  /* —— 4. Bottoni flow (#flowOptions) —— */
  .app-shell[data-context="home"] #flowOptions.flow-options-slot,
  .app-shell[data-context="salon"] #flowOptions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(0.65rem, 1.2vh, 0.85rem);
    width: 100%;
    max-width: min(100%, 36rem);
    margin-inline: auto;
  }

  .app-shell[data-context="home"] #flowOptions .btn,
  .app-shell[data-context="home"] #flowOptions button,
  .app-shell[data-context="salon"] #flowOptions .btn,
  .app-shell[data-context="salon"] #flowOptions button,
  .app-shell[data-context="salon"] #flowOptions .btn-mode {
    box-sizing: border-box;
    width: 100%;
    min-height: clamp(56px, 5vh, 76px);
    padding: clamp(0.9rem, 1.5vw, 1.15rem) clamp(1.1rem, 2vw, 1.55rem);
    border-radius: 17px;
    font-size: clamp(0.95rem, 1.05vw, 1.08rem);
    line-height: 1.32;
    letter-spacing: 0.05em;
    text-align: center;
    cursor: pointer;
    transition:
      transform 0.18s ease,
      border-color 0.18s ease,
      background-color 0.18s ease,
      color 0.18s ease,
      box-shadow 0.18s ease;
  }

  .app-shell[data-context="home"] #flowOptions .btn,
  .app-shell[data-context="home"] #flowOptions button {
    border: 1px solid rgba(240, 236, 228, 0.32);
    background-color: rgba(12, 12, 12, 0.82);
    color: rgba(247, 241, 231, 0.94);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  }

  .app-shell[data-context="home"] #flowOptions .btn:hover,
  .app-shell[data-context="home"] #flowOptions button:hover {
    border-color: rgba(240, 236, 228, 0.48);
    background-color: rgba(22, 22, 22, 0.92);
  }

  .app-shell[data-context="salon"] #flowOptions .btn,
  .app-shell[data-context="salon"] #flowOptions button,
  .app-shell[data-context="salon"] #flowOptions .btn-mode {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(10, 10, 12, 0.92);
    background-image: none;
    color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    text-shadow: none;
  }

  .app-shell[data-context="salon"] #flowOptions .btn:hover,
  .app-shell[data-context="salon"] #flowOptions button:hover,
  .app-shell[data-context="salon"] #flowOptions .btn-mode:hover {
    border-color: rgba(255, 255, 255, 0.36);
    background-color: rgba(20, 20, 23, 0.96);
  }

  /* —— 5. Selected state (specificità scoped; vince su box-shadow inline JS) —— */
  .app-shell[data-context="home"] #flowOptions button.flow-option-selected,
  .app-shell[data-context="home"] #flowOptions button[aria-pressed='true'],
  .app-shell[data-context="salon"] #flowOptions button.flow-option-selected,
  .app-shell[data-context="salon"] #flowOptions button[aria-pressed='true'] {
    border-color: rgba(255, 255, 255, 0.96);
    background-color: rgba(248, 246, 238, 0.98);
    background-image: none;
    color: rgba(8, 8, 10, 0.96);
    box-shadow:
      0 14px 34px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(255, 255, 255, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.65);
    text-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .app-shell[data-context="home"] #flowOptions button.flow-option-selected:hover,
  .app-shell[data-context="home"] #flowOptions button[aria-pressed='true']:hover,
  .app-shell[data-context="salon"] #flowOptions button.flow-option-selected:hover,
  .app-shell[data-context="salon"] #flowOptions button[aria-pressed='true']:hover {
    background-color: rgba(255, 255, 255, 0.99);
    color: rgba(5, 5, 7, 0.98);
    border-color: rgba(255, 255, 255, 0.98);
  }

  /* —— 6. Continue / reset —— */
  .app-shell[data-context="salon"] #concernContinueSlot,
  .app-shell[data-context="salon"] #lastServiceContinueSlot {
    width: 100%;
    max-width: min(100%, 36rem);
    margin-inline: auto;
  }

  .app-shell[data-context="salon"] #concernContinueSlot .btn,
  .app-shell[data-context="salon"] #lastServiceContinueSlot .btn {
    min-height: clamp(56px, 5vh, 76px);
    border-radius: 17px;
    font-size: clamp(0.95rem, 1.05vw, 1.06rem);
    letter-spacing: 0.06em;
  }

  .app-shell[data-context="home"] .btn-reset-outside,
  .app-shell[data-context="salon"] .btn-reset-outside {
    max-width: min(100%, 36rem);
    margin-inline: auto;
    min-height: clamp(44px, 4vh, 52px);
    border-radius: 14px;
    font-size: clamp(0.72rem, 0.9vw, 0.8rem);
    letter-spacing: 0.1em;
  }

  /* —— 7. Composer / input / mic (non Pro Mode) —— */
  .app-shell[data-context="home"]:not(.ui-professional) .composer-block,
  .app-shell[data-context="salon"]:not(.ui-professional) .composer-block {
    max-width: min(100%, 36rem);
    margin-inline: auto;
  }

  .app-shell[data-context="home"]:not(.ui-professional) .composer-block .input-row,
  .app-shell[data-context="salon"]:not(.ui-professional) .composer-block .input-row {
    gap: clamp(0.65rem, 1.2vw, 0.95rem);
    align-items: stretch;
  }

  .app-shell[data-context="home"]:not(.ui-professional) #textInput,
  .app-shell[data-context="salon"]:not(.ui-professional) #textInput {
    flex: 1 1 auto;
    min-width: 0;
    min-height: clamp(56px, 5vh, 72px);
    max-height: clamp(56px, 5vh, 72px);
    border-radius: 17px;
    font-size: clamp(0.95rem, 1vw, 1.05rem);
    padding: clamp(0.85rem, 1.4vw, 1rem) clamp(1rem, 1.8vw, 1.35rem);
  }

  .app-shell[data-context="home"]:not(.ui-professional) .composer-block .btn-send,
  .app-shell[data-context="salon"]:not(.ui-professional) .composer-block .btn-send {
    min-height: clamp(56px, 5vh, 72px);
    min-width: clamp(5.5rem, 10vw, 7rem);
    border-radius: 17px;
    font-size: clamp(0.88rem, 1vw, 0.98rem);
    letter-spacing: 0.06em;
  }

  /* —— 8. Routine / riepilogo (no dashboard tablet su PC) —— */
  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-cards {
    max-width: min(100%, 52rem);
    margin-inline: auto;
    justify-content: center;
    gap: clamp(0.85rem, 1.5vw, 1.1rem);
  }

  .app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-card {
    flex: 1 1 clamp(200px, 28%, 260px);
    max-width: 280px;
  }

  .app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-cards {
    max-width: min(100%, 58rem);
    margin-inline: auto;
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-card,
  .app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-card {
    width: min(100%, 44rem);
    max-width: min(92vw, 44rem);
    margin-inline: auto;
    border-radius: 18px;
    padding: clamp(1.15rem, 2vh, 1.45rem) clamp(1.1rem, 2vw, 1.5rem);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-title {
    font-size: clamp(1.35rem, 2vw, 1.75rem);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-booking-links {
    max-width: min(100%, 28rem);
    margin-inline: auto;
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-booking-link,
  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link {
    min-height: clamp(52px, 4.5vh, 68px);
    border-radius: 16px;
    font-size: clamp(0.88rem, 1vw, 0.98rem);
    max-width: 100%;
  }

  .app-shell.ui-proposal .msg.assistant {
    font-size: clamp(1.05rem, 1.2vw, 1.22rem);
    line-height: 1.58;
    max-width: min(48rem, 100%);
  }
}

/* 10A-2 — Desktop guided-flow current question only */
@media (min-width: 1025px) {
  .app-shell:not(.ui-professional).ui-guiding:not([data-flow-state='PROPOSAL_SALON']):not([data-flow-state='HOME_ROUTINE']):not([data-flow-state='CONSULTATION_SUMMARY'])
    .messages
    .msg:not(:last-child),
  .app-shell:not(.ui-professional).ui-speaking:not([data-flow-state='PROPOSAL_SALON']):not([data-flow-state='HOME_ROUTINE']):not([data-flow-state='CONSULTATION_SUMMARY'])
    .messages
    .msg:not(:last-child) {
    display: none;
  }

  .app-shell:not(.ui-professional).ui-guiding:not([data-flow-state='PROPOSAL_SALON']):not([data-flow-state='HOME_ROUTINE']):not([data-flow-state='CONSULTATION_SUMMARY'])
    .messages,
  .app-shell:not(.ui-professional).ui-speaking:not([data-flow-state='PROPOSAL_SALON']):not([data-flow-state='HOME_ROUTINE']):not([data-flow-state='CONSULTATION_SUMMARY'])
    .messages {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .app-shell:not(.ui-professional).ui-guiding:not([data-flow-state='PROPOSAL_SALON']):not([data-flow-state='HOME_ROUTINE']):not([data-flow-state='CONSULTATION_SUMMARY'])
    .messages
    .msg.assistant:last-child,
  .app-shell:not(.ui-professional).ui-speaking:not([data-flow-state='PROPOSAL_SALON']):not([data-flow-state='HOME_ROUTINE']):not([data-flow-state='CONSULTATION_SUMMARY'])
    .messages
    .msg.assistant:last-child {
    margin-top: 0;
    margin-bottom: 0;
  }
}

/* B-2 · Fix collisione badge↔titolo nel riepilogo su telefoni stretti.
   Classi esclusive del riepilogo (.service-hero-*). Sotto 480px il badge esce
   dal posizionamento assoluto e diventa una pill in flusso sopra il titolo
   (indipendente dalla lunghezza della label); azzerata la riserva ora inutile. */
@media (max-width: 480px) {
  .service-hero-badge {
    position: static;
    order: -1;
    align-self: flex-start;
  }

  .service-hero-name {
    padding-right: 0;
  }
}

/* B-3a · Titoli/display → Schibsted Grotesk (solo font-family; nessun size/weight/spacing toccato). */
.eyebrow,
.stage-title,
.consultation-summary-title,
.consultation-summary-section-title,
.home-commercial-title,
.photo-consent-title,
.photo-privacy-dialog-title,
.routine-steps-title,
.summary-dashboard-hero-title,
.summary-insight-heading,
.summary-insight-title,
.summary-routine-heading,
.summary-services-hero-heading,
.service-hero-name {
  font-family: 'Schibsted Grotesk', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* B-3b · Fix P2-A — logo EG (decorazione "specchio") sovrapposto al titolo dell'header su
   telefoni stretti. Negli stati con header visibile il layer logo è ancorato in alto-destra
   (align-items:flex-start; justify-content:flex-end) con padding-top max ~24px → cade nella
   banda del titolo. Qui, SOLO su telefono (≤480px), spingo il layer SOTTO l'header così il
   logo non tocca più il titolo. Cambio una sola proprietà di posizionamento (padding-top);
   nessun cambio di font, dimensione/opacità del logo, altezze/scroll/viewport o metafora specchio. */
@media (max-width: 480px) {
  body:has(.app-shell.ui-guiding) .mirror-decoration,
  body:has(.app-shell.ui-speaking) .mirror-decoration,
  body:has(.app-shell.ui-professional) .mirror-decoration,
  body:has(.app-shell.ui-proposal) .mirror-decoration {
    padding-top: 6rem;
  }
}

/* B-3c · Polish controllato — bottone foto + tile prodotto. SOLO colore/superficie.
   Nessun cambio di font/tipografia, dimensioni, struttura, spacing, max-height/vh, scroll/viewport. */

/* 1) Bottone foto "Accetto e carico la foto" (#photoCaptureBtn): da oro (rimosso)
   a NEUTRO scuro editoriale. Scoped per id → non tocca .btn-primary globale (standby/CTA/dialog). */
#photoCaptureBtn {
  background: #1c1c1c;
  border-color: rgba(240, 236, 228, 0.26);
  color: var(--text-primary);
}
#photoCaptureBtn:not(:disabled):hover {
  background: #242424;
  border-color: rgba(240, 236, 228, 0.42);
}

/* 2) Tile prodotto in HOME_ROUTINE: i JPEG hanno fondo bianco → rettangoli bianchi netti sul nero.
   Cornice scura arrotondata + bordo sottile coerente (box-shadow inset, niente border reale = nessuno
   shift di layout) + vignetta radiale (::after) che sfuma i bordi bianchi nel tema. La foto e il
   prodotto restano intatti/nitidi; nessun cambio di dimensioni/struttura/spacing. */
.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-image-wrap {
  position: relative;
  background: #101010;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(240, 236, 228, 0.16);
}
.app-shell[data-flow-state="HOME_ROUTINE"] .routine-product-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(ellipse at center, rgba(16, 16, 16, 0) 50%, rgba(16, 16, 16, 0.62) 100%);
}

/* R1 — Summary dashboard desktop
   Estende la dashboard riepilogo (DOM già costruito sempre da appendConsultationSummaryCard) anche a
   desktop >1024px, nascondendo lì la card testuale .consultation-summary-card. APPEND-ONLY: non modifica
   i blocchi 27A-2 / 27A-3 / 37A-6A / B-*. Scope: TUTTI i contesti (home/salon/postazione), SOLO stato
   CONSULTATION_SUMMARY. Nessun !important, nessun selettore nudo globale (tutto sotto has-tablet-dashboard
   o .summary-dashboard-tablet). Le regole-veste dei componenti sono REPLICATE con valori IDENTICI al
   blocco 27A-3 (@media max-width:1024px) perche' quelle vivono solo sotto i 1024px: senza replica la
   dashboard su PC uscirebbe spoglia. Nessun nuovo colore/font/dimensione testo. Specificita' delle vesti
   = (0,2,0), inferiore al polish salon 37A-6A (0,4,0): salon mantiene la sua cosmetica, home riceve la
   veste base. Adattamento desktop SOLO layout/larghezza/spaziatura: container 68rem centrato + card
   servizio su griglia 2 colonne (auto-fit minmax; l'ultima dispari occupa la riga, come pattern 37A-5);
   pill routine in riga con wrap. */
@media (min-width: 1025px) {
  /* reveal/hide: dashboard al posto della card testuale (il fallback testo resta se la dashboard manca) */
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .msg.assistant.has-tablet-dashboard {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: 68rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(0.5rem, 1.5vw, 1rem);
    padding-right: clamp(0.5rem, 1.5vw, 1rem);
  }

  .app-shell[data-flow-state="CONSULTATION_SUMMARY"]
    .msg.assistant.has-tablet-dashboard
    .consultation-summary-card {
    display: none;
  }

  /* NB: niente max-width qui -> salon resta 920px via 37A-6A; home riempie il container 68rem */
  .app-shell[data-flow-state="CONSULTATION_SUMMARY"] .msg.assistant.has-tablet-dashboard .summary-dashboard-tablet {
    display: flex;
    flex-direction: column;
    gap: clamp(1.15rem, 2.2vw, 1.65rem);
    width: 100%;
    margin: 0 auto;
    padding: clamp(1.4rem, 2.4vw, 2rem) clamp(1.1rem, 2vw, 1.6rem) clamp(1.25rem, 2vw, 1.7rem);
    transform: translateZ(0);
    opacity: 0;
    animation: jervi-reveal 0.55s ease forwards;
  }

  /* —— veste componenti: valori IDENTICI al 27A-3 (<=1024), scoped sotto .summary-dashboard-tablet —— */
  .summary-dashboard-tablet .summary-dashboard-hero {
    text-align: center;
    padding-bottom: 0.15rem;
  }
  .summary-dashboard-tablet .summary-dashboard-hero-title {
    margin: 0;
    font-size: clamp(1.35rem, 4.2vw, 1.85rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #f5f1e8;
    line-height: 1.28;
  }
  .summary-dashboard-tablet .summary-dashboard-hero-subtitle {
    margin: 0.65rem 0 0;
    font-size: clamp(0.88rem, 2.4vw, 1rem);
    line-height: 1.62;
    letter-spacing: 0.02em;
    color: rgba(168, 162, 154, 0.96);
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
  }
  .summary-dashboard-tablet .summary-dashboard-main {
    display: flex;
    flex-direction: column;
    gap: clamp(1.1rem, 2vw, 1.45rem);
  }

  /* desktop layout: griglia 2 colonne per le card servizio (auto-fit; la dispari finale a riga intera) */
  .summary-dashboard-tablet .summary-services-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 0.85rem;
  }
  .summary-dashboard-tablet .summary-services-hero-heading {
    grid-column: 1 / -1;
    margin: 0;
    font-size: clamp(0.72rem, 2vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.92);
    text-align: center;
  }
  .summary-dashboard-tablet .summary-services-hero .service-hero-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .summary-dashboard-tablet .service-hero-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: clamp(1.1rem, 2.8vw, 1.35rem) clamp(1rem, 2.6vw, 1.3rem);
    border-radius: 20px;
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
  }
  .summary-dashboard-tablet .service-hero-name {
    font-size: clamp(1.05rem, 3vw, 1.22rem);
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #f5f1e8;
    line-height: 1.35;
    padding-right: 5.5rem;
  }
  .summary-dashboard-tablet .service-hero-benefit {
    margin: 0;
    font-size: clamp(0.86rem, 2.3vw, 0.95rem);
    line-height: 1.55;
    letter-spacing: 0.015em;
    color: rgba(245, 241, 232, 0.82);
  }
  .summary-dashboard-tablet .service-hero-badge {
    position: absolute;
    top: clamp(0.85rem, 2vw, 1rem);
    right: clamp(0.85rem, 2vw, 1rem);
    font-size: clamp(0.62rem, 1.6vw, 0.68rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.88);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 999px;
    padding: 0.28rem 0.55rem;
    background: rgba(10, 10, 10, 0.55);
  }
  .summary-dashboard-tablet .summary-insight-card {
    padding: clamp(0.95rem, 2.4vw, 1.15rem) clamp(1rem, 2.5vw, 1.2rem);
    border-radius: 16px;
    background: rgba(14, 14, 14, 0.72);
    border: 1px solid rgba(212, 175, 55, 0.14);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  }
  .summary-dashboard-tablet .summary-insight-heading {
    margin: 0 0 0.45rem;
    font-size: clamp(0.68rem, 1.8vw, 0.76rem);
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(168, 162, 154, 0.88);
  }
  .summary-dashboard-tablet .summary-insight-text {
    margin: 0;
    font-size: clamp(0.86rem, 2.2vw, 0.95rem);
    line-height: 1.58;
    letter-spacing: 0.02em;
    color: rgba(245, 241, 232, 0.88);
  }
  .summary-dashboard-tablet .summary-routine-pills {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }
  .summary-dashboard-tablet .summary-routine-heading {
    margin: 0;
    font-size: clamp(0.72rem, 2vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.88);
    text-align: center;
  }
  /* pill routine in riga con wrap */
  .summary-dashboard-tablet .summary-routine-pills-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.55rem;
  }
  .summary-dashboard-tablet .routine-pill {
    display: inline-block;
    max-width: 100%;
    padding: 0.48rem 0.85rem;
    border-radius: 999px;
    font-size: clamp(0.82rem, 2.1vw, 0.9rem);
    letter-spacing: 0.02em;
    line-height: 1.35;
    color: rgba(245, 241, 232, 0.92);
    background: rgba(18, 18, 18, 0.88);
    border: 1px solid rgba(212, 175, 55, 0.2);
  }
  .summary-dashboard-tablet .summary-dashboard-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding-top: 0.25rem;
    padding-bottom: 0.15rem;
  }
  .summary-dashboard-tablet .summary-dashboard-btn-team {
    width: 100%;
    transform: translateZ(0);
    transition:
      transform 0.22s ease,
      opacity 0.22s ease,
      border-color 0.22s ease;
  }
  .summary-dashboard-tablet .summary-dashboard-btn-team:not(:disabled):active {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

/* R1b — fix card dispari piena riga
   Nel blocco R1 la regola "ultima card a riga intera se dispari" usava
   .service-hero-card:last-child:nth-child(odd): NON scatta correttamente perche' il primo figlio
   della griglia .summary-services-hero e' l'heading (h3.summary-services-hero-heading), che falsa il
   conteggio di :nth-child (scatta sul numero PARI di card, non dispari). Le card sono <article>,
   l'heading e' <h3>: conto SOLO le card con :nth-of-type/:last-of-type. Stesso scope e stesso
   @media del blocco R1, nessun effetto <=1024px, nessun !important. */
@media (min-width: 1025px) {
  /* annulla l'effetto della regola R1 errata (su numero pari di card) */
  .summary-dashboard-tablet .summary-services-hero .service-hero-card:last-child:nth-child(odd) {
    grid-column: auto;
  }
  /* corretta: l'ultima card occupa la riga intera SOLO se il numero di card e' dispari */
  .summary-dashboard-tablet .summary-services-hero .service-hero-card:last-of-type:nth-of-type(odd) {
    grid-column: 1 / -1;
  }
}

/* R3 — Mobile luxury polish (APPEND-ONLY · SOLO PELLE: colore/superfici/bordi/focus/padding interni).
   Nessun cambio di layout/dimensioni/griglie/margini esterni/ordine. Nessun !important. Override dei
   blocchi esistenti per specificita' pari/superiore + source order. Valori derivati SOLO dalle variabili
   palette esistenti: --text-primary #f0ece4 (avorio rgb 240,236,228), --text-secondary #a59c92 (rgb
   165,156,146), --accent panna (oro rimosso). Nessun colore nuovo. ESCLUSI per scope: #startBtn /
   standby (non referenziati qui) e Pro Mode (regole con :not(.ui-professional) o stati di consulenza). */

/* 1) DISCIPLINA DELL'ORO — l'oro resta SOLO sui titoletti di sezione (gia' oro: non toccati qui);
   si toglie l'oro da prezzi (→avorio), bordi card (→neutro), badge (→testo oro tenue senza pill). */

/* 1a · prezzi card → avorio. (0,4,0) per battere le regole context+state esistenti (603/2016/2650). */
.app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-price,
.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-price {
  color: var(--text-primary);
}

/* 1b · badge servizio → testo panna tenue, niente pill/bordo, non sembra cliccabile.
   .summary-dashboard-tablet .service-hero-badge (0,2,0) batte 27A-3/≤480 (0,1,0) e vince su R1 per ordine.
   border-color/background trasparenti = nessuno shift (border-width invariato). */
.summary-dashboard-tablet .service-hero-badge {
  border-color: transparent;
  background: transparent;
  color: rgba(240, 236, 228, 0.85);
  font-weight: 600;
}

/* 1c · bordi card quasi invisibili + superficie leggermente piu' chiara (profondita'), solo colore. */
.app-shell[data-context="home"][data-flow-state="HOME_ROUTINE"] .routine-product-card,
.app-shell[data-context="salon"][data-flow-state="HOME_ROUTINE"] .routine-product-card {
  background: rgba(240, 236, 228, 0.045);
  border-color: rgba(240, 236, 228, 0.09);
}
.summary-dashboard-tablet .service-hero-card,
.summary-dashboard-tablet .summary-insight-card {
  border-color: rgba(240, 236, 228, 0.09);
}

/* 2) CTA PRIMARIE → piene avorio, testo quasi-nero #0e0d0b (contrasto ~16:1 su #f0ece4).
   #sendBtn scoped :not(.ui-professional) per non toccare il composer Pro. Flow-CTA via data-option-text
   (stringhe server esatte) a (1,4,0) per battere #flowOptions context (home 1902 / salon 2240, (1,3,0)). */
.app-shell:not(.ui-professional) #sendBtn,
.summary-dashboard-tablet .summary-dashboard-btn-team,
.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link,
.app-shell[data-context="home"] #flowOptions .btn[data-option-text="Scopri la tua routine personalizzata"],
.app-shell[data-context="salon"] #flowOptions .btn[data-option-text="Scopri la tua routine personalizzata"],
.app-shell[data-context="home"] #flowOptions .btn[data-option-text="Vai al riepilogo finale"],
.app-shell[data-context="salon"] #flowOptions .btn[data-option-text="Vai al riepilogo finale"] {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #0e0d0b;
}
.app-shell:not(.ui-professional) #sendBtn:not(:disabled):hover,
.summary-dashboard-tablet .summary-dashboard-btn-team:not(:disabled):hover,
.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link:hover {
  background: rgba(240, 236, 228, 0.92);
  border-color: rgba(240, 236, 228, 0.92);
  color: #0e0d0b;
}

/* 3) CTA SECONDARIE → ghost, bordo grigio discreto (da --text-secondary), testo avorio. */
#resetBtn,
.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .home-booking-link,
.app-shell[data-context="home"] #flowOptions .btn[data-option-text="Concludi consulenza"],
.app-shell[data-context="salon"] #flowOptions .btn[data-option-text="Concludi consulenza"] {
  background: transparent;
  border-color: rgba(165, 156, 146, 0.45);
  color: var(--text-primary);
}

/* 4) INPUT NOME — SOLO stato ASK_NAME (mai Pro Mode): piu' alto, bordo neutro, focus sobrio (no oro).
   (1,3,0) batte il base #textInput e l'override desktop (3157, (1,3,0)) per ordine. */
.app-shell[data-flow-state="ASK_NAME"]:not(.ui-professional) #textInput {
  min-height: 4.35rem;
  max-height: 4.35rem;
  border-color: rgba(165, 156, 146, 0.42);
}
.app-shell[data-flow-state="ASK_NAME"]:not(.ui-professional) #textInput:focus {
  border-color: rgba(240, 236, 228, 0.55);
  background: rgba(0, 0, 0, 0.55);
}

/* R4 — Button system + ASK_NAME + chips + shop CTA (APPEND-ONLY · solo pelle + ordine intro).
   Nessun !important. Valori derivati dalla palette esistente (--text-primary #f0ece4, --text-secondary
   #a59c92, --accent). Override per specificita' pari/superiore + source order. ESCLUSI: #startBtn/standby
   (mai referenziato), Pro Mode (:not(.ui-professional)). Raggio unico 0.75rem per i controlli del flow. */

/* 0) FIX ORDINE INTRO — causa reale: .routine-product-cards ha order:-1 (regola "boutique cards-first"
   pre-R2, ~1412/1947) dentro .msg.assistant reso flex-column su <=1024 → le card precedevano il text-node
   intro (la mia nota R3 guardava solo il DOM, non 'order'). Ora l'intro e' <p class="routine-cards-intro">
   (app.js) e order:-2 la riporta sopra le card. Su desktop (no flex) vince comunque l'ordine DOM. */
.app-shell[data-flow-state="HOME_ROUTINE"] .routine-cards-intro {
  order: -2;
  margin: 0 0 0.15rem;
}

/* 1) RAGGIO UNICO 0.75rem — controlli del flow (primari e secondari), esclusi standby e Pro. */
.app-shell:not(.ui-professional) #sendBtn,
.summary-dashboard-tablet .summary-dashboard-btn-team,
.app-shell[data-context="home"] #flowOptions .btn,
.app-shell[data-context="salon"] #flowOptions .btn,
.app-shell[data-context="salon"] #flowOptions .btn-mode,
.app-shell[data-context="salon"] #flowOptions button.flow-option-selected,
.app-shell[data-context="salon"] #flowOptions button[aria-pressed='true'],
.app-shell[data-context="home"] #flowOptions .btn.flow-option-selected,
.app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link,
.app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-booking-link,
.app-shell[data-context="salon"] #resetBtn.btn-reset-outside,
.app-shell[data-context="home"] #resetBtn.btn-reset-outside {
  border-radius: 0.75rem;
}

/* 2) CHIP "A CASA" (.routine-pill) → etichette informative, NON bottoni: niente pillola/CTA, fondo piatto
   appena rialzato, bordo quasi nullo, testo secondario. (0,4,0) per battere i context (2053/2740). */
.app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .routine-pill,
.app-shell[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .routine-pill {
  border-radius: 0.4rem;
  background: rgba(240, 236, 228, 0.05);
  border-color: rgba(240, 236, 228, 0.07);
  color: var(--text-secondary);
}

/* 3) .home-shop-link (EG Shop) → CTA PRIMARIA piena avorio, testo quasi-nero (contrasto ~16:1).
   (0,4,0) per battere 2090/2106/3214 (oro spento) che superavano R3 (0,3,0). solido = niente gradiente. */
.app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link {
  background: var(--text-primary);
  background-image: none;
  border-color: var(--text-primary);
  color: #0e0d0b;
}
.app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link:hover {
  background: rgba(240, 236, 228, 0.92);
  background-image: none;
  border-color: rgba(240, 236, 228, 0.92);
  color: #0e0d0b;
}

/* 4) ASK_NAME — modulo premium (SOLO [data-flow-state="ASK_NAME"]:not(.ui-professional)).
   Campo full-width + Invia coerente impilato sotto. La pelle R3 (campo piu' alto, bordo neutro, focus
   sobrio) resta. NOTA: il grande vuoto verticale sopra NON e' toccato qui — e' la banda del logo
   "specchio" (B-3b) e ridurlo ricreerebbe l'overlap del rollback B-3d (vedi report). */
.app-shell[data-flow-state="ASK_NAME"]:not(.ui-professional) .input-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
}
.app-shell[data-flow-state="ASK_NAME"]:not(.ui-professional) #textInput {
  width: 100%;
  flex: 1 1 auto;
}
.app-shell[data-flow-state="ASK_NAME"]:not(.ui-professional) #sendBtn {
  width: 100%;
}

/* R5 — Presentation mode (APPEND-ONLY · puramente visivo). Al tap su "Mostra il piano al team" il JS
   aggiunge .jervi-presentation su .app-shell (unico antenato comune di dashboard e #resetBtn; mai body).
   Tutto scoped a [data-flow-state="CONSULTATION_SUMMARY"] → nessun altro stato toccato. Restano: hero,
   card servizi, obiettivo (insight), pill routine. Spariscono: azioni operative e Ricomincia. */

/* "Chiudi presentazione": nascosto fuori dalla modalità */
.summary-dashboard-tablet .jervi-presentation-close {
  display: none;
}

/* in presentazione: via le azioni operative (incluso il tasto stesso) e il Ricomincia */
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .summary-dashboard-actions,
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] #resetBtn {
  display: none;
}

/* in presentazione: un solo bottone ghost discreto (sistema R4, raggio 0.75rem) */
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin-top: 1.25rem;
  border-radius: 0.75rem;
  background: transparent;
  border-color: rgba(165, 156, 146, 0.45);
  color: var(--text-primary);
}

/* R6 — Presentation two-box + ASK_NAME calmer (APPEND-ONLY · solo pelle, vista normale invariata).
   NB: la classe .jervi-presentation (R5) sta su .app-shell; qui solo CSS scoped, l'handler R5 e il
   blocco R5 NON sono toccati. Guardia contenuti: .routine-pill contiene NOMI PRODOTTO (verificato). */

/* ---------- R6-A · Presentazione = pagina parrucchiere, due riquadri (solo nomi) ----------
   Tutto sotto .app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] → vista normale intatta. */

/* spariscono: sottotitolo hero, descrizioni servizi, insight (obiettivo / perché questa direzione) */
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .summary-dashboard-hero-subtitle,
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .service-hero-benefit,
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-card {
  display: none;
}

/* RIQUADRO 1 — servizi: box bordato, card appiattite a righe (solo nome) */
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .summary-services-hero {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid rgba(240, 236, 228, 0.12);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
}
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .service-hero-card {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 0.3rem 0;
}

/* RIQUADRO 2 — prodotti / A CASA: box bordato coi nomi prodotto (.routine-pill) */
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .summary-routine-pills {
  border: 1px solid rgba(240, 236, 228, 0.12);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
}

/* ---------- R6-B · ASK_NAME: Invia meno invadente ----------
   Override della larghezza R4 (width:100%): auto sul contenuto, centrato, min-width dignitoso.
   Pelle avorio + raggio 0.75rem (R3/R4) invariati. #textInput resta full-width. Niente .dialogue-block. */
.app-shell[data-flow-state="ASK_NAME"]:not(.ui-professional) #sendBtn {
  width: auto;
  min-width: 9rem;
  align-self: center;
}

/* R6b — Presentation products readable rows (APPEND-ONLY, dopo R6 → override pill efficace).
   Scoped a .app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] → vista normale intatta.
   Le .routine-pill non sono più chip: niente sfondo/bordo/ombra, diventano righe di solo nome prodotto,
   impilate e leggibili. Colore = stesso tono dei nomi servizio in salon (.service-hero-name = 37A-6A
   rgba(255,255,255,0.96)); presentazione esiste solo in salon (teamBtn). Resta il box .summary-routine-pills. */
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .summary-routine-pills-inner {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .routine-pill {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 0.1rem 0;
  color: rgba(255, 255, 255, 0.96);
}

/* ============================================================================
   Invia al team (PASSO 1 · SOLO postazione) — APPEND-ONLY, scoped a .jervi-presentation.
   Bottone avorio pieno (sistema R4, raggio 0.75rem) + box codice univoco sobrio sul tema
   scuro. Fuori dalla modalità presentazione TUTTO nascosto (mirror di .jervi-presentation-close).
   ============================================================================ */
.summary-dashboard-tablet .jervi-presentation-send,
.summary-dashboard-tablet .jervi-presentation-code,
.summary-dashboard-tablet .jervi-presentation-send-error {
  display: none;
}

/* "Invia al team": primario avorio pieno, coerente R4 */
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin-top: 1.25rem;
  padding: 0.7rem 1.5rem;
  border-radius: 0.75rem;
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
  color: #1c1a17;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-send:not(:disabled):hover {
  background: #fffdf8;
  border-color: #fffdf8;
}
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-send:disabled {
  opacity: 0.55;
}

/* box codice univoco: codice grande/monospace, contenitore sobrio */
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  align-self: center;
  margin-top: 1.25rem;
  padding: 1rem 1.5rem;
  border: 1px solid rgba(240, 236, 228, 0.18);
  border-radius: 0.75rem;
  background: rgba(240, 236, 228, 0.05);
}
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-code-value {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 2rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--text-primary);
}
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-code-hint {
  font-size: 0.9rem;
  color: rgba(240, 236, 228, 0.7);
}

/* messaggio errore sobrio (no alert nativi) */
.app-shell.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-send-error {
  display: block;
  align-self: center;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #e0a39a;
}

/* ============================================================================
   A CASA — riepilogo NORMALE (NON presentazione), SOLO salone/postazione (data-context="salon"),
   NON Home. APPEND-ONLY. Trasforma le voci prodotto da pill/scatolini bordati a RIGHE PULITE,
   imitando il modello presentazione (.jervi-presentation): niente bordo/sfondo/scatola, testo
   chiaro, spaziatura ariosa. Si tocca SOLO il look delle singole voci; il box .summary-routine-pills
   resta. Scope (0,5,0) con :not(.jervi-presentation) → batte 3685/2740/3520 senza !important e NON
   intacca presentazione, Home, standby, Pro o altri stati. ============================================ */
.app-shell:not(.jervi-presentation)[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .summary-routine-pills-inner {
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}
.app-shell:not(.jervi-presentation)[data-context="salon"][data-flow-state="CONSULTATION_SUMMARY"] .routine-pill {
  display: block;
  max-width: 100%;
  padding: 0.15rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(245, 241, 232, 0.94);
  line-height: 1.5;
  text-align: center;
}

/* ===== Pro recupera consulenza — PEZZO 2 (UI, solo Pro). Append scoped .pro-recover-* ===== */
.pro-recover-btn {
  margin-top: 0.75rem;
}

.pro-recover-view {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 2rem);
  padding-top: max(1.25rem, env(safe-area-inset-top));
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  min-height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #0c0c0d;
  color: rgba(245, 241, 232, 0.94);
}

.pro-recover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.pro-recover-title {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.pro-recover-close {
  flex: 0 0 auto;
  border-radius: 0.75rem;
}

.pro-recover-search {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(245, 241, 232, 0.18);
  background: #141416;
  color: rgba(245, 241, 232, 0.96);
  font-size: 1rem;
}
.pro-recover-search::placeholder {
  color: rgba(245, 241, 232, 0.45);
}

.pro-recover-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pro-recover-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(245, 241, 232, 0.1);
  background: #141416;
  color: inherit;
  cursor: pointer;
}
.pro-recover-row:hover,
.pro-recover-row:focus-visible {
  border-color: rgba(245, 241, 232, 0.28);
  background: #1a1a1d;
}
.pro-recover-row-name {
  font-size: 1.02rem;
  font-weight: 600;
  color: rgba(245, 241, 232, 0.97);
}
.pro-recover-row-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: rgba(245, 241, 232, 0.58);
}
.pro-recover-row-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.03em;
}

.pro-recover-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pro-recover-back {
  align-self: flex-start;
  border-radius: 0.75rem;
}

.pro-recover-empty {
  margin: 0.5rem 0;
  color: rgba(245, 241, 232, 0.6);
  font-size: 0.95rem;
}

/* ===== Pro recupera consulenza — PEZZO 2b: fix visibilità piano + rifinitura estetica =====
   Append-only, tutto scoped sotto .pro-recover-*. Nessuna regola globale/presentazione/riepilogo toccata. */

/* FIX VISIBILITÀ (regola chiave): il renderer .summary-dashboard-tablet è display:none di default
   (styles.css:1617), rivelato solo sotto .app-shell[data-flow-state="CONSULTATION_SUMMARY"].
   Nella vista pro è montato in .pro-recover-detail (su body) → lo riveliamo qui, scoped.
   Specificità (0,2,0) > globale (0,1,0): nessun !important necessario. display = flex, come il reveal normale. */
.pro-recover-detail .summary-dashboard-tablet {
  display: flex;
  flex-direction: column;
  gap: clamp(1.15rem, 3vw, 1.65rem);
  width: 100%;
}

/* Contenuto centrato e leggibile anche su tablet Pro larghi */
.pro-recover-header,
.pro-recover-search,
.pro-recover-list,
.pro-recover-detail {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
}

/* Header: filo di separazione + titolo elegante */
.pro-recover-header {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(245, 241, 232, 0.1);
  margin-bottom: 0.1rem;
}
.pro-recover-title {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 241, 232, 0.92);
}

/* Ricerca: focus pulito, transizione discreta */
.pro-recover-search {
  background: #131315;
  border-color: rgba(245, 241, 232, 0.14);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pro-recover-search:focus {
  outline: none;
  border-color: rgba(245, 241, 232, 0.4);
  background: #17171a;
}

/* Righe: più ariose, elevazione discreta, nome avorio in evidenza */
.pro-recover-row {
  padding: 1rem 1.15rem;
  gap: 0.35rem;
  border-color: rgba(245, 241, 232, 0.08);
  background: #141416;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
}
.pro-recover-row:hover,
.pro-recover-row:focus-visible {
  border-color: rgba(245, 241, 232, 0.24);
  background: #1a1a1d;
  outline: none;
}
.pro-recover-row:active {
  transform: scale(0.995);
}
.pro-recover-row-name {
  font-size: 1.05rem;
  letter-spacing: 0.005em;
  color: rgba(245, 241, 232, 0.97);
}
.pro-recover-row-meta {
  color: rgba(245, 241, 232, 0.5);
}
.pro-recover-row-code {
  color: rgba(245, 241, 232, 0.62);
}

/* Dettaglio: respiro attorno al piano; "Indietro" coerente */
.pro-recover-detail {
  gap: 1.25rem;
  padding-top: 0.25rem;
}
.pro-recover-back {
  align-self: flex-start;
}

/* Messaggi (caricamento/vuoto/errore): centrati e tenui */
.pro-recover-empty {
  text-align: center;
  padding: 1.5rem 0;
  color: rgba(245, 241, 232, 0.55);
}

/* ===== Pro recupera consulenza — PEZZO 2c: rispetto [hidden] + nascondi tasto team in pro =====
   Append in coda, tutto scoped .pro-recover-*. Nessuna regola globale toccata. */

/* FIX 1: il JS imposta search/list/detail .hidden=true, ma .pro-recover-list/-detail{display:flex}
   (autore, 0,1,0) battono la UA [hidden]{display:none}. Qui [hidden] scoped (0,2,0) torna a vincere.
   Include search (prevenzione) e detail (sparizione corretta al ritorno "Indietro"). */
.pro-recover-list[hidden],
.pro-recover-search[hidden],
.pro-recover-detail[hidden] {
  display: none;
}

/* FIX 2: il renderer storico crea "Mostra il piano al team" (.summary-dashboard-btn-team dentro
   .summary-dashboard-actions) per ogni contesto non-home → in pro va nascosto. Scoped alla sola vista pro;
   riepilogo normale e presentazione globali NON toccati. */
.pro-recover-detail .summary-dashboard-actions {
  display: none;
}

/* ===================================================================== */
/* PRO MODE v1 — Slice D · veste premium del contesto Pro.                */
/* Scoped: .app-shell.ui-professional + stati PRO_AREA_SELECT / PRO_INTAKE.*/
/* NESSUNA modifica a .messages/.msg/.btn/.composer globali: solo override.*/
/* I selettori includono #flowOptions per battere le regole salon (ID).   */
/* ===================================================================== */

/* --- FIX 1: area lettura come documento premium (no feritoia) --- */
.app-shell.ui-professional .messages {
  min-height: min(22rem, 44dvh);
  max-height: min(72dvh, 960px); /* GIRO 2-bis: un filo più alto, prima risposta non tagliata */
  padding-top: clamp(1.25rem, 3vh, 2rem);
  padding-bottom: clamp(1.25rem, 3vh, 2rem);
}
.app-shell.ui-professional .msg.assistant {
  line-height: 1.62;
  padding: 1.1rem 1.15rem;
}
@media (min-width: 1025px) {
  /* misura di lettura confortevole su desktop; su tablet si usa la larghezza piena */
  .app-shell.ui-professional .messages > .msg.assistant {
    max-width: 72ch;
    margin-right: auto;
  }
}
@media (max-width: 1024px) {
  /* batte la feritoia 26vh del blocco @media(max-width:1024px) esistente */
  .app-shell.ui-professional .messages {
    min-height: min(18rem, 38dvh);
    max-height: min(66dvh, 880px); /* GIRO 2-bis: +respiro su tablet, composer resta ancorato */
  }
}
@media (max-height: 760px) {
  /* schermi bassi/landscape: il composer ancorato non si sacrifica */
  .app-shell.ui-professional .messages {
    max-height: min(52dvh, 520px);
  }
}
@media (max-width: 560px) {
  .app-shell.ui-professional .messages {
    max-height: min(58dvh, 600px);
  }
}

/* --- GIRO 2-bis: tasti Pro nella STESSA FAMIGLIA di Postazione. ---
   Pro ha data-context="salon" + ui-professional: i tasti #flowOptions ereditano già le
   regole Postazione (pill, sfondo scuro, ombra morbida, padding). Qui NON ridisegno: tono
   solo l'oro per renderlo DISCRETO (no contorni gialli vistosi). Postazione resta intatta:
   queste regole vivono solo sotto .ui-professional. */
.app-shell.ui-professional #flowOptions button,
.app-shell.ui-professional #flowOptions .btn {
  border-color: rgba(240, 236, 228, 0.30);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.10), rgba(240, 236, 228, 0.03));
}
.app-shell.ui-professional #flowOptions button:not(:disabled):hover,
.app-shell.ui-professional #flowOptions .btn:not(:disabled):hover {
  border-color: rgba(240, 236, 228, 0.46);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.16), rgba(240, 236, 228, 0.05));
}
.app-shell.ui-professional #flowOptions button:focus-visible,
.app-shell.ui-professional #flowOptions .btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}
/* Gerarchia leggera dentro la stessa famiglia: area = presenza maggiore, intake = piu compatto. */
.app-shell.ui-professional[data-flow-state="PRO_AREA_SELECT"] #flowOptions button,
.app-shell.ui-professional[data-flow-state="PRO_AREA_SELECT"] #flowOptions .btn {
  min-height: 56px;
  font-size: 1.02rem;
}
.app-shell.ui-professional[data-flow-state="PRO_INTAKE"] #flowOptions button,
.app-shell.ui-professional[data-flow-state="PRO_INTAKE"] #flowOptions .btn {
  min-height: 48px;
}

/* reduced motion: niente entrata animata del messaggio in Pro */
@media (prefers-reduced-motion: reduce) {
  .app-shell.ui-professional .msg {
    animation: none;
  }
}

/* ===================================================================== */
/* PRO MODE v1 — Giro 2 · rifinitura ingresso Pro + tasto invia.          */
/* Scope: .app-shell.is-pro-context (hook solo-Pro, da app.js) per la      */
/* standby/ingresso (ui-standby è condiviso); .ui-professional per la QA.  */
/* NESSUNA modifica a .btn/.messages/.msg/.composer/.ui-standby globali.   */
/* ===================================================================== */

/* --- #1/#4: tasto START "Premi per iniziare" pulito, solo-Pro --- */
.app-shell.is-pro-context.ui-standby .btn-primary#startBtn {
  min-height: 3.25rem;
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(240, 236, 228, 0.30);
  background-color: rgba(12, 11, 17, 0.76);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.16), rgba(240, 236, 228, 0.05));
  color: rgba(255, 249, 224, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  white-space: normal;
}
.app-shell.is-pro-context.ui-standby .btn-primary#startBtn:not(:disabled):hover {
  border-color: rgba(240, 236, 228, 0.46);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.24), rgba(240, 236, 228, 0.08));
}
.app-shell.is-pro-context.ui-standby .btn-primary#startBtn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

/* --- #2: niente testo tagliato sull'ingresso Pro (header) --- */
.app-shell.is-pro-context.ui-standby .stage-header {
  overflow: visible;
  padding-bottom: clamp(0.65rem, 2.2vh, 1.15rem);
}
.app-shell.is-pro-context.ui-standby .eyebrow,
.app-shell.is-pro-context.ui-standby .stage-title {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.app-shell.is-pro-context.ui-standby .stage-title {
  line-height: 1.4;
  padding-bottom: 0.12em; /* niente clip dei discendenti */
}

/* --- #3: tasto INVIA in QA Pro, stessa famiglia (raggio adatto al pulsante alto) --- */
/* #sendBtn (ID) batte il raggio 999px globale di .btn senza toccarlo. */
.app-shell.ui-professional #sendBtn.btn-send {
  border-radius: 1.25rem;
  border: 1px solid rgba(240, 236, 228, 0.30);
  background-color: rgba(12, 11, 17, 0.76);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.16), rgba(240, 236, 228, 0.05));
  color: rgba(255, 249, 224, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.app-shell.ui-professional #sendBtn.btn-send:not(:disabled):hover {
  border-color: rgba(240, 236, 228, 0.46);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.24), rgba(240, 236, 228, 0.08));
}
.app-shell.ui-professional #sendBtn.btn-send:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* ===================================================================== */
/* PRO MODE v1 — Giro 2-bis · "Recupera consulenza" nella famiglia + frase d'ingresso. */
/* SOLO aspetto del bottone (logica initProRecover intatta). Scoped Pro.   */
/* ===================================================================== */
.app-shell.is-pro-context .pro-recover-btn {
  border-radius: var(--btn-radius);
  border: 1px solid rgba(240, 236, 228, 0.28);
  background-color: rgba(12, 11, 17, 0.72);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.12), rgba(240, 236, 228, 0.04));
  color: rgba(255, 249, 224, 0.94);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.app-shell.is-pro-context .pro-recover-btn:not(:disabled):hover {
  border-color: rgba(240, 236, 228, 0.44);
  background-image: linear-gradient(180deg, rgba(240, 236, 228, 0.18), rgba(240, 236, 228, 0.06));
}
.app-shell.is-pro-context .pro-recover-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

/* VESTE rifinitura A: i due tasti Pro della standby (#startBtn e .pro-recover-btn) condividono
   .controls-slot → stessa larghezza visiva (colonna, larghezza comune con max condiviso). Scoped Pro:
   Home/Postazione e .btn globale non toccati; logica initProRecover invariata (solo aspetto). */
.app-shell.is-pro-context .controls-slot {
  flex-direction: column;
  align-items: center;
}
.app-shell.is-pro-context .controls-slot #startBtn,
.app-shell.is-pro-context .controls-slot .pro-recover-btn {
  width: 100%;
  max-width: 22rem;
}

/* --- #3 GIRO 2-bis: frase d'ingresso (PRO_AREA_SELECT) ABBASSATA, sotto header/logo. --- */
.app-shell.ui-professional[data-flow-state="PRO_AREA_SELECT"] .messages {
  padding-top: clamp(2.25rem, 9vh, 5.5rem);
}

/* --- GATE 2 · LAYOUT PARERE PRO (PROFESSIONAL_QA) ---
   Problema: su tablet >=1025px lo stato Pro era escluso dal tuning ~810-820 (che riduce
   dialogue-block padding-top e messages max-height solo per ui-guiding/ui-speaking), quindi
   la colonna sforava il viewport: con parere lungo il body scrollava e la zona risposta
   (campo + Invia + Ricomincia) finiva sotto la piega.
   Fix SOLO CSS, scoped al solo parere testuale Pro (NON area select / intake / foto):
   - riduco il padding-top non scrollabile del dialogo (rif. ~8vh del blocco ~810-820), in dvh;
   - capo #messages in dvh mantenendo overflow-y:auto: la colonna entra nel viewport dinamico,
     #messages scrolla internamente, .scene-actions resta in basso (grid riga 3, NON fixed).
   Specificita (0,4,0): vince su .dialogue-block/.messages base e sui blocchi @media esistenti
   (.ui-professional ... a 0,3,0); ultima nel file -> nessuna media query la sovrascrive.
   Lo scroll automatico (app.js, messagesEl.scrollTop) non e toccato: #messages resta lo scroller. */
.app-shell.ui-professional[data-flow-state="PROFESSIONAL_QA"] .dialogue-block {
  padding-top: min(2dvh, 1rem);
  margin-top: 0;
  min-height: 0;
  overflow: hidden; /* 2a: non crescere col contenuto -> non spinge fuori la barra (riga 3) */
}

.app-shell.ui-professional[data-flow-state="PROFESSIONAL_QA"] .messages {
  /* GATE 2 GARANZIA barra: cap CALCOLATO che riserva SEMPRE header+barra+buffer+safe-area
     (R=22rem). Su Safari iOS il solo grid/flex non garantisce la barra: questo cap si'.
     Il parere riempie comunque lo spazio rimasto e scrolla DENTRO #messages (overflow-y:auto). */
  max-height: calc(100dvh - 22rem - env(safe-area-inset-bottom));
  min-height: 0;
  overflow-y: auto;
}

/* 2b: tetto strutturale al grid SOLO nel parere Pro -> il body non puo crescere/scrollare.
   Piu largo del cap del parere (1), quindi NON strozza: il parere riempie la riga, (1) e la
   cintura iOS. Scoped: non tocca il grid degli altri stati. */
.app-shell.ui-professional[data-flow-state="PROFESSIONAL_QA"] .mirror-stage {
  max-height: calc(100dvh - 6rem);
}

/* Safe-area iOS: "Ricomincia"/Invia non sotto la barra inferiore (home indicator).
   Scoped al parere Pro; env(safe-area-inset-bottom) e 0 dove non c'e notch -> nessun effetto altrove. */
.app-shell.ui-professional[data-flow-state="PROFESSIONAL_QA"] .scene-actions {
  padding-bottom: calc(clamp(0.25rem, 1vh, 0.75rem) + env(safe-area-inset-bottom));
}

/* === GATE 2 · RIDISEGNO BARRA DI RISPOSTA PRO (PROFESSIONAL_QA + brief santino) ===
   Scoped agli stati col composer testuale. Specificita (1,3,0)/(0,5,0) -> vince sugli
   override Pro 992-995 e non e sovrascritta da media query (regole ultime nel file).
   NON tocca le regole base globali (#textInput 966, .btn-send 953, .btn-reset-outside 403). */

/* (2) Campo compatto e scrollabile INTERNAMENTE (senza auto-resize JS il testo lungo
   verrebbe clippato): override scoped dell'overflow solo per questi due stati. */
.app-shell.ui-professional[data-flow-state="PROFESSIONAL_QA"] #textInput,
.app-shell.ui-professional[data-flow-state="PRO_TARGET_BRIEF"] #textInput {
  min-height: 4.5rem;
  max-height: 8rem;
  overflow-y: auto;
}

/* (3) Barra meno larga, centrata (solo parere). */
.app-shell.ui-professional[data-flow-state="PROFESSIONAL_QA"] .composer-block {
  width: min(54rem, 92vw);
}

/* (4) Invia allineato al campo: annulla lo stretch (993) e pareggia l'altezza. */
.app-shell.ui-professional[data-flow-state="PROFESSIONAL_QA"] .composer-block .input-row {
  align-items: center;
}
.app-shell.ui-professional[data-flow-state="PROFESSIONAL_QA"] .btn-send {
  min-height: 4.5rem;
}

/* (5) Ricomincia piu defilato ma sempre visibile/toccabile (no display:none, no fixed). */
.app-shell.ui-professional[data-flow-state="PROFESSIONAL_QA"] .btn-reset-outside {
  opacity: 0.6;
}

/* ===================================================================== */
/* Prima Mossa 2 — ATTRACT MODE. Scope BLINDATO: .app-shell.is-postazione-context. */
/* Il layer esiste nel DOM per ogni contesto ma resta [hidden] (display:none) e     */
/* riceve pointer-events:auto SOLO sotto questo scope: Home/Salon/Pro non ricevono   */
/* la classe, quindi non vedono e non intercettano mai il layer.                     */
/* ===================================================================== */
.app-shell.is-postazione-context #attractLayer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh; /* fallback browser senza dvh */
  min-height: 100dvh;
  padding: max(env(safe-area-inset-top), 1.5rem)
    clamp(1.25rem, 5vw, 3rem)
    max(env(safe-area-inset-bottom), 1.5rem);
  background: var(--bg);
  background-image: radial-gradient(120% 90% at 50% 32%, rgba(240, 236, 228, 0.06), rgba(0, 0, 0, 0) 60%);
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-shell.is-postazione-context #attractLayer[hidden] {
  display: none;
  pointer-events: none;
}
.app-shell.is-postazione-context .attract-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 5vh, 3rem);
  text-align: center;
  max-width: min(90vw, 46rem);
}
.app-shell.is-postazione-context .attract-logo {
  width: clamp(90px, 22vw, 170px);
  height: auto;
  opacity: 0.55;
  /* Prima Mossa polish — respiro lento, solo transform, nessun layout shift. */
  animation: postazioneAttractBreath 10s ease-in-out infinite alternate;
}
/* Cinema C2 — stack: i due nodi frase sovrapposti nella stessa cella (grid 1/1) per il crossfade. */
.app-shell.is-postazione-context .attract-phrase-stack {
  display: grid;
  width: 100%;
  justify-items: center;
}
.app-shell.is-postazione-context .attract-phrase {
  grid-area: 1 / 1; /* A e B nella stessa cella → perfettamente allineati */
  width: 100%;
  margin: 0;
  color: rgba(255, 249, 224, 0.96);
  font-size: clamp(1.6rem, 5.2vw, 3.1rem);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 0.01em;
  min-height: 2.4em; /* riserva 2 righe: nessun layout shift tra frasi */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Cinema C2 — base: invisibile e leggermente in basso. transform NON transitionato di default
     → l'USCITA è solo fade (nessuna translate inversa vistosa). */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms ease;
  will-change: opacity;
}
.app-shell.is-postazione-context .attract-phrase.is-visible {
  /* INGRESSO: fade + risalita morbida (solo opacity/transform). */
  opacity: 1;
  transform: translateY(0);
  transition: opacity 700ms ease, transform 700ms ease;
}
.app-shell.is-postazione-context .attract-cta {
  margin: 0;
  color: rgba(240, 236, 228, 0.72);
  font-size: clamp(0.85rem, 2.4vw, 1.05rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  /* Prima Mossa polish — pulsazione più lenta e sobria, solo opacity. */
  animation: postazioneAttractCtaPulse 4.5s ease-in-out infinite;
}
@keyframes postazioneAttractCtaPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.82; }
}
@keyframes postazioneAttractBreath {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}
/* Landscape basso (tablet/telefono ruotato): comprime spazi e tipografia. */
@media (orientation: landscape) and (max-height: 560px) {
  .app-shell.is-postazione-context .attract-inner {
    gap: clamp(0.75rem, 3vh, 1.5rem);
  }
  .app-shell.is-postazione-context .attract-logo {
    width: clamp(70px, 12vw, 120px);
  }
  .app-shell.is-postazione-context .attract-phrase {
    font-size: clamp(1.3rem, 4.2vw, 2.2rem);
    min-height: 2em;
  }
}
/* Accessibilità: nessun fade/pulse con prefers-reduced-motion. */
@media (prefers-reduced-motion: reduce) {
  /* Cinema C2 — cambio secco: niente fade né translate. */
  .app-shell.is-postazione-context .attract-phrase,
  .app-shell.is-postazione-context .attract-phrase.is-visible {
    transition: none;
    transform: none;
  }
  .app-shell.is-postazione-context .attract-cta {
    animation: none;
    opacity: 0.72;
  }
  .app-shell.is-postazione-context .attract-logo {
    animation: none;
  }
}

/* Cinema C1-fix — logo header PNG bianco su trasparenza: neutralizza invert/blend (pensati per il
   JPEG nero). Selettore con classe wrapper in più (specificità 0,4,0) per VINCERE anche sulla regola
   summary body:has(...).salon-logo-heart (0,3,1) che ri-applicava invert (→ PNG nero, invisibile).
   height:auto preserva le proporzioni. Scoped Postazione: Home/Salon/Pro col JPEG restano invariati. */
.app-shell.is-postazione-context .salon-logo-heart-wrap .salon-logo-heart {
  filter: none;
}

/* ===================================================================== */
/* Cinema C1-fix3 — DESIGN: logo header CHIARAMENTE VISIBILE su Postazione in ogni schermata
   dopo l'attract. NB CRITICO: .mirror-decoration / .salon-logo-heart-wrap / .salon-logo-heart
   sono SIBLING di .app-shell (non discendenti), quindi la regola qui sopra (combinatore
   discendente .app-shell … .salon-logo-heart) NON matcha mai → filter:none non è mai stato
   applicato → il PNG bianco restava sotto invert(1) della base = nero = invisibile. Qui si usa
   la forma corretta body:has(.app-shell.is-postazione-context) …, come le regole di flusso/summary.
   Gated Postazione: Home/Salon/Pro (senza .is-postazione-context) restano IDENTICI. */

/* IMG — rimuove invert (il vero killer del PNG bianco), mantiene lighten (ereditato dalla base),
   ferma la breathe (che pilota l'opacity), presenza piena. Specificità (0,4,1) > summary invert (0,3,1). */
body:has(.app-shell.is-postazione-context) .salon-logo-heart-wrap .salon-logo-heart {
  filter: none;
  animation: none;
  opacity: 0.92;
}
/* WRAP — opacity piena + dimensione da header luxury. Specificità (0,4,1) > tablet/desktop/summary (0,3,1). */
body:has(.app-shell.is-postazione-context) .mirror-decoration .salon-logo-heart-wrap {
  opacity: 1;
  width: clamp(96px, 14vmin, 140px);
}
/* CONTENITORE — non dissolvere in riepilogo/routine (summary lo porta a 0.05/0.045). Specificità
   (0,3,1): pareggia le regole summary di .mirror-decoration e vince per ordine (blocco in coda al file). */
body:has(.app-shell.is-postazione-context) .mirror-decoration {
  opacity: 1;
}

/* ===================================================================== */
/* Prima Mossa polish — PRIMA MOSSA LUXURY. Scope ESATTO: contesto + stato.   */
/* Solo .app-shell.is-postazione-context[data-flow-state="POSTAZIONE_FIRST_MOVE"]. */
/* Specificità > regole salon #flowOptions .btn-mode → override solo qui;      */
/* altri stati Postazione e tutto Salon/Home restano intoccati.                */
/* Oro accento = #d4af37 (unico oro del progetto) in forma rgba(212,175,55,·). */
/* ===================================================================== */
.app-shell.is-postazione-context[data-flow-state="POSTAZIONE_FIRST_MOVE"] #flowOptions {
  gap: clamp(0.7rem, 2.4vh, 1.15rem);
}
.app-shell.is-postazione-context[data-flow-state="POSTAZIONE_FIRST_MOVE"] #flowOptions .btn-mode {
  min-height: clamp(64px, 9vh, 84px);
  padding: clamp(1rem, 2.6vh, 1.5rem) clamp(1.1rem, 4vw, 1.75rem);
  border-radius: var(--btn-radius);
  border: 1px solid rgba(212, 175, 55, 0.35); /* oro attenuato ~35% */
  white-space: normal;
  line-height: 1.25;
  transition: transform 140ms ease, border-color 140ms ease;
  -webkit-tap-highlight-color: transparent; /* niente flash grigio di sistema */
}
.app-shell.is-postazione-context[data-flow-state="POSTAZIONE_FIRST_MOVE"] #flowOptions .btn-mode:active {
  border-color: rgba(212, 175, 55, 1); /* oro pieno al tocco */
  transform: scale(0.98);
}
/* Viewport piccoli (smartphone portrait): comprime gap/padding, nessun overflow. */
@media (max-width: 480px) {
  .app-shell.is-postazione-context[data-flow-state="POSTAZIONE_FIRST_MOVE"] #flowOptions {
    gap: clamp(0.55rem, 1.8vh, 0.85rem);
  }
  .app-shell.is-postazione-context[data-flow-state="POSTAZIONE_FIRST_MOVE"] #flowOptions .btn-mode {
    min-height: 64px;
    padding: 0.9rem 1rem;
  }
}
/* Landscape basso (telefono ruotato): comprime altezza card e spazi. */
@media (orientation: landscape) and (max-height: 560px) {
  .app-shell.is-postazione-context[data-flow-state="POSTAZIONE_FIRST_MOVE"] #flowOptions {
    gap: clamp(0.5rem, 2vh, 0.8rem);
  }
  .app-shell.is-postazione-context[data-flow-state="POSTAZIONE_FIRST_MOVE"] #flowOptions .btn-mode {
    min-height: 56px;
    padding: 0.75rem 1rem;
  }
}
/* Reduced-motion: niente scale al tocco; resta il solo feedback bordo-oro. */
@media (prefers-reduced-motion: reduce) {
  .app-shell.is-postazione-context[data-flow-state="POSTAZIONE_FIRST_MOVE"] #flowOptions .btn-mode {
    transition: border-color 140ms ease;
  }
  .app-shell.is-postazione-context[data-flow-state="POSTAZIONE_FIRST_MOVE"] #flowOptions .btn-mode:active {
    transform: none;
  }
}

/* ===================================================================== */
/* C3A "Lettura e Routine" — restyle CSS-only SOLO Postazione, tablet-first.        */
/* Tutti i selettori gated .is-postazione-context (Postazione = tablet ≤1024),      */
/* dentro un @media (max-width:1024px) NUOVO in coda: fuori dal breakpoint           */
/* Postazione mantiene il look esistente (fallback PC sicuro). Nessun markup/JS,     */
/* nessun !important, nessuna ombra/glow/blur/animazione nuova.                      */
/* ===================================================================== */
@media (max-width: 1024px) {
  /* ---- C3A-P — PROPOSTA EDITORIALE (obbligatoria) ------------------------------- */
  /* Scope (0,5,0) batte .app-shell.ui-proposal .msg.assistant (0,4,0) [485/1300/3228]. */
  /* a-capo Gemini preservati da white-space:pre-wrap della base .msg → ritmo tra blocchi. */
  .app-shell.is-postazione-context.ui-proposal .msg.assistant {
    background: transparent;   /* via effetto bolla-chat grigia (.msg.assistant bg 0.35) */
    border: none;              /* via border-bottom da messaggio */
    max-width: 42ch;
    margin-left: auto;
    margin-right: auto;
    padding: 1.4rem 0.25rem 2rem;
    font-size: clamp(1.08rem, 2.7vw, 1.28rem);
    line-height: 1.72;
    letter-spacing: 0.015em;
    position: relative;        /* per ::before */
  }
  /* micro-linea d'apertura (pseudo ::before verificato LIBERO su .msg.assistant) */
  .app-shell.is-postazione-context.ui-proposal .msg.assistant::before {
    content: "";
    display: block;
    width: 48px;
    height: 1px;
    margin: 0 auto 1.15rem;
    background: rgba(240, 236, 228, 0.45);
  }

  /* ---- C3A-D1 — ROUTINE EDITORIALE (leggerezza) -------------------------------- */
  /* Scope (0,5,0) con .routine-steps-editorial in più batte salon (0,4,0) [2824-2864]. */
  .app-shell.is-postazione-context[data-flow-state="HOME_ROUTINE"] .routine-steps-editorial .routine-step-card {
    background: rgba(240, 236, 228, 0.035);
    border: 1px solid rgba(240, 236, 228, 0.10);
    box-shadow: none;          /* via ombra pesante: gerarchia da spazio+tipografia */
  }
  .app-shell.is-postazione-context[data-flow-state="HOME_ROUTINE"] .routine-steps-editorial .routine-step-phase {
    color: rgba(240, 236, 228, 0.72);   /* panna, mai giallo */
    letter-spacing: 0.2em;
  }
  .app-shell.is-postazione-context[data-flow-state="HOME_ROUTINE"] .routine-steps-editorial .routine-step-number {
    background: transparent;   /* pallino pieno bianco → contorno discreto */
    border: 1px solid rgba(240, 236, 228, 0.45);
    color: rgba(240, 236, 228, 0.92);
    font-weight: 700;
  }

  /* ---- C3A-D2 — CARD PRODOTTO / IMAGE-WELL (obbligatoria) ----------------------- */
  /* Scope (0,5,0) con .routine-product-cards in più batte salon (0,4,0) e base (0,3,0). */
  /* Card RESTA SCURA (non tocco il bg card): il panna sta SOLO nel well immagine.  */
  /* NB: sfondo panna DA VALIDARE in foto #3 col bianco prodotto (vedi report).     */
  .app-shell.is-postazione-context[data-flow-state="HOME_ROUTINE"] .routine-product-cards .routine-product-image-wrap {
    background: #f0ece4;       /* panna image-well */
    border-radius: 14px;
    padding: 0.55rem;
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.28);  /* micro-bordo oro accento */
  }
  /* neutralizza la vignette scura ::after (occupato) che sporcherebbe la panna */
  .app-shell.is-postazione-context[data-flow-state="HOME_ROUTINE"] .routine-product-cards .routine-product-image-wrap::after {
    background: none;
  }
  .app-shell.is-postazione-context[data-flow-state="HOME_ROUTINE"] .routine-product-cards .routine-product-image {
    max-width: 100%;
    box-sizing: border-box;
    object-fit: contain;
  }
  .app-shell.is-postazione-context[data-flow-state="HOME_ROUTINE"] .routine-product-cards .routine-product-phase {
    color: rgba(240, 236, 228, 0.78);   /* kicker panna spaziato, mai giallo */
    letter-spacing: 0.18em;
  }

  /* ---- C3A-T — CTA HOME_ROUTINE ("Vai al riepilogo finale", unico bottone dello stato) */
  /* Scope (1,4,0) batte .app-shell[data-context="salon"] #flowOptions .btn-mode (1,3,0) [2247]. */
  .app-shell.is-postazione-context[data-flow-state="HOME_ROUTINE"] #flowOptions .btn-mode {
    background: #f0ece4;
    background-image: none;
    color: rgba(18, 16, 12, 0.95);
    border: 1px solid #f0ece4;
    border-radius: 14px;
    letter-spacing: 0.03em;
    text-shadow: none;
  }
  .app-shell.is-postazione-context[data-flow-state="HOME_ROUTINE"] #flowOptions .btn-mode:active {
    transform: scale(0.98);
  }
  .app-shell.is-postazione-context[data-flow-state="HOME_ROUTINE"] #flowOptions .btn-mode:focus-visible {
    outline: 2px solid rgba(240, 236, 228, 0.55);
    outline-offset: 3px;
  }
}

/* ===================================================================== */
/* C3B "Riepilogo e Presentazione" — restyle CSS-only SOLO Postazione, tablet-first.        */
/* @media (max-width:1024px) NUOVO in coda. OGNI selettore con SCENA esplicita:              */
/*  · riepilogo normale → …:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] */
/*  · presentazione     → ….jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"]       */
/* Continuità valori C3A: panna #f0ece4/0.72, oro 0.28-0.40, radius 14/20, :active .98,      */
/* :focus-visible panna-soft. R6/R6b e R1 desktop NON toccate. Nessun !important/ombra nuova. */
/* ===================================================================== */
@media (max-width: 1024px) {

  /* ---- C3B-A — HERO + titoletti h3 (oro→panna) --------------------------------- */
  /* Normale: scope (0,5,0) batte base .summary-dashboard-hero-title (0,1,0) [1666]. */
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .summary-dashboard-hero-title {
    font-size: clamp(1.5rem, 5vw, 2.3rem);
    line-height: 1.1;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
  }
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .summary-dashboard-hero-subtitle {
    color: rgba(240, 236, 228, 0.72);
    max-width: 36ch;
    line-height: 1.62;
  }
  /* Presentazione: titolo più compatto (sottotitolo resta nascosto da R6, non lo tocco). */
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .summary-dashboard-hero-title {
    font-size: clamp(1.35rem, 4.4vw, 1.9rem);
    line-height: 1.12;
    letter-spacing: 0.04em;
  }
  /* h3 sezione oro→panna (services 1704 e routine 1789 erano oro). Scene esplicite. */
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .summary-services-hero-heading,
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .summary-routine-heading,
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-card .summary-insight-heading,
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .summary-services-hero-heading,
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .summary-routine-heading {
    color: rgba(240, 236, 228, 0.72);
    letter-spacing: 0.2em;
  }

  /* ---- C3B-B — CARD SERVIZI (SOLO riepilogo normale) --------------------------- */
  /* Scope (0,5,0) batte .app-shell[data-context="salon"][…SUMMARY] .service-hero-card (0,4,0) [2704]. */
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .summary-services-hero {
    gap: clamp(0.85rem, 2.4vw, 1.1rem);
  }
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .service-hero-card {
    border: 1px solid rgba(212, 175, 55, 0.30);
    border-radius: 20px;
    padding: clamp(1.15rem, 3vw, 1.5rem) clamp(1.1rem, 2.8vw, 1.4rem);
  }
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .service-hero-name {
    font-size: clamp(1.15rem, 3.4vw, 1.4rem);
  }
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .service-hero-benefit {
    color: rgba(240, 236, 228, 0.82);
    line-height: 1.6;
  }

  /* ---- C3B-C — INSIGHT (SOLO riepilogo normale) -------------------------------- */
  /* Scope (0,5,0) batte salon insight-card (0,4,0) [2721]; testo (0,6,0) batte (0,5,0) [2738]. */
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-card {
    border: 1px solid var(--border);
    border-radius: 20px;
  }
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .summary-insight-card .summary-insight-text {
    color: rgba(240, 236, 228, 0.82);
    line-height: 1.65;
  }

  /* ---- C3B-D — RIGHE "A CASA" (SOLO riepilogo normale; live conferma righe 3905) - */
  /* Solo tipografia/ritmo: NESSUN cambio display/flex, NESSUN chip/bordo/radius. Scope (0,5,0). */
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .summary-routine-pills-inner {
    gap: 0.6rem;
  }
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .routine-pill {
    color: rgba(240, 236, 228, 0.9);
    padding: 0.3rem 0;
    font-size: clamp(0.9rem, 2.3vw, 1rem);
    letter-spacing: 0.01em;
  }

  /* ---- C3B-E — SIGILLO EG (SOLO presentazione, stato di successo) --------------- */
  /* Scope (0,5,0) batte .app-shell.jervi-presentation[…SUMMARY] .jervi-presentation-code (0,3,0) [3860]. */
  /* NB: .jervi-presentation-send-error (errore) NON toccato → resta distinto dal sigillo. */
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-code {
    border: 1px solid rgba(212, 175, 55, 0.40);
    border-radius: 14px;
    padding: 1.25rem 1.6rem;
    background: rgba(10, 10, 12, 0.9);
  }
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-code-value {
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    letter-spacing: clamp(0.12em, 2vw, 0.3em);
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
    color: var(--text-primary);
  }
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-code-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
  }

  /* ---- C3B-F — BOTTONI PER FASE ------------------------------------------------ */
  /* Normale: .summary-dashboard-btn-team è già panna/radius14/:active .98 [3620+1831] → aggiungo solo focus. */
  .app-shell.is-postazione-context:not(.jervi-presentation)[data-flow-state="CONSULTATION_SUMMARY"] .summary-dashboard-btn-team:focus-visible {
    outline: 2px solid rgba(240, 236, 228, 0.55);
    outline-offset: 3px;
  }
  /* Presentazione pre-invio: send primario panna (già), allineo radius 14 + :active + focus. Scope (0,5,0) > (0,3,0) [3837]. */
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-send {
    border-radius: 14px;
    letter-spacing: 0.03em;
  }
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-send:active {
    transform: scale(0.98);
  }
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-send:focus-visible {
    outline: 2px solid rgba(240, 236, 228, 0.55);
    outline-offset: 3px;
  }
  /* close secondario outlined panna-soft (era grigio 0.45). Scope (0,5,0) > (0,3,0) [3749]. */
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-close {
    border-radius: 14px;
    border-color: rgba(240, 236, 228, 0.30);
  }
  .app-shell.is-postazione-context.jervi-presentation[data-flow-state="CONSULTATION_SUMMARY"] .jervi-presentation-close:focus-visible {
    outline: 2px solid rgba(240, 236, 228, 0.55);
    outline-offset: 3px;
  }
}

/* =========================================================================================
   CANTIERE SGUARDO — REGIA VISIVA (append additivo, in coda per vincere sui pari-specificità)
   Scoping assoluto:
   · Postazione  → .app-shell.is-postazione-context  (classe presente SOLO su Postazione;
                    Postazione condivide data-context="salon", quindi salon/pro reali NON hanno
                    questa classe → nessun leak. Specificità .app-shell.is-postazione-context…
                    = (0,3,0)+ batte le regole salon [data-context="salon"] … = (0,2,0)).
   · Home        → .app-shell[data-context="home"]    (solo Home; niente logica, solo veste).
   Nessuna regola qui usa [data-context="salon"] né .is-pro-context: Salon e Pro restano invariati.
   ========================================================================================= */

/* ---- OBIETTIVO 3 · POSTAZIONE — LA SCENA DELLE DOMANDE (tutti i viewport) --------------- */
/* La domanda è protagonista: tipografia display, spazio con intenzione, niente vuoto morto. */
.app-shell.is-postazione-context.ui-guiding .dialogue-block {
  justify-content: center;
  padding-top: clamp(1rem, 5vh, 3.5rem);
  padding-bottom: clamp(0.75rem, 3vh, 2rem);
  margin-top: 0;
  min-height: min(46vh, 30rem);
}
.app-shell.is-postazione-context.ui-guiding .messages {
  max-height: none;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: 0;
}
.app-shell.is-postazione-context.ui-guiding .messages::before,
.app-shell.is-postazione-context.ui-guiding .messages::after {
  display: none; /* niente maschere-gradiente: la domanda non scorre, non serve sfumare */
}
.app-shell.is-postazione-context.ui-guiding .msg.assistant {
  font-family: 'Schibsted Grotesk', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  font-size: clamp(1.45rem, 1rem + 2.4vw, 2.35rem);
  line-height: 1.16;
  letter-spacing: -0.012em;
  color: #f0ece4;
  max-width: 22ch;
  margin: 0 auto;
  text-align: center;
  text-wrap: balance;
  background: none;
  border: 0;
  padding: 0;
  box-shadow: none;
}
.app-shell.is-postazione-context.ui-guiding .msg.system {
  text-align: center;
  color: #a59c92;
}
/* Micro-motion di gusto: la domanda entra con un respiro (solo transform/opacity). */
@media (prefers-reduced-motion: no-preference) {
  .app-shell.is-postazione-context.ui-guiding .msg.assistant {
    animation: sguardo-question-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  @keyframes sguardo-question-in {
    from { opacity: 0; transform: translateY(0.6rem); }
    to   { opacity: 1; transform: none; }
  }
}
/* Bottoni-scelta in equilibrio con la domanda: pill panna, ariose, tocco ampio. */
.app-shell.is-postazione-context.ui-guiding #flowOptions {
  max-width: min(92vw, 40rem);
  margin-left: auto;
  margin-right: auto;
  gap: 0.7rem;
}
.app-shell.is-postazione-context.ui-guiding #flowOptions .btn,
.app-shell.is-postazione-context.ui-guiding #flowOptions .btn-mode {
  min-height: 52px;
  border-radius: 14px;
  letter-spacing: 0.01em;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}
@media (prefers-reduced-motion: no-preference) {
  .app-shell.is-postazione-context.ui-guiding #flowOptions .btn:active,
  .app-shell.is-postazione-context.ui-guiding #flowOptions .btn-mode:active {
    transform: scale(0.985);
  }
}

/* Desktop Postazione (≥1025): la stessa scena calda, non il layout freddo legacy. */
@media (min-width: 1025px) {
  .app-shell.is-postazione-context.ui-guiding .dialogue-block {
    min-height: min(52vh, 34rem);
    padding-top: clamp(2rem, 8vh, 6rem);
  }
  .app-shell.is-postazione-context.ui-guiding .msg.assistant {
    font-size: clamp(2rem, 1rem + 1.6vw, 2.8rem);
    max-width: 20ch;
  }
  .app-shell.is-postazione-context.ui-guiding #flowOptions {
    max-width: 44rem;
  }
}
/* Telefono Postazione stretto: la domanda resta leggibile, i tocchi comodi. */
@media (max-width: 430px) {
  .app-shell.is-postazione-context.ui-guiding .msg.assistant {
    font-size: clamp(1.35rem, 1rem + 4vw, 1.8rem);
    max-width: 18ch;
  }
  .app-shell.is-postazione-context.ui-guiding .dialogue-block {
    min-height: min(40vh, 24rem);
  }
}

/* ---- OBIETTIVO 1 · POSTAZIONE — SCHERMATA CONSENSO FOTO (dignitosa, editoriale) --------- */
.app-shell.is-postazione-context .photo-box .photo-consent-stack {
  max-width: min(92vw, 34rem);
  margin: 0 auto;
  text-align: center;
  padding: clamp(1rem, 4vw, 1.75rem);
  background: linear-gradient(180deg, rgba(20, 18, 16, 0.7), rgba(12, 11, 10, 0.7));
  border: 1px solid rgba(240, 236, 228, 0.14);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}
.app-shell.is-postazione-context .photo-box .photo-consent-title {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.2rem, 0.9rem + 1.6vw, 1.6rem);
  color: #f0ece4;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.app-shell.is-postazione-context .photo-box .photo-consent-legal {
  color: #a59c92;
  font-size: 0.94rem;
  line-height: 1.55;
}
.app-shell.is-postazione-context .photo-box .photo-primary-actions {
  margin-top: 1.1rem;
  gap: 0.7rem;
}
.app-shell.is-postazione-context .photo-box .photo-status:not(:empty) {
  margin-top: 0.9rem;
  color: #d8d1c4;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}
/* "Sto guardando i tuoi capelli…": pulsazione discreta e rispettosa (non un caricamento freddo). */
@media (prefers-reduced-motion: no-preference) {
  .app-shell.is-postazione-context .photo-box .photo-status:not(:empty) {
    animation: sguardo-status-breathe 1.8s ease-in-out infinite;
  }
  @keyframes sguardo-status-breathe {
    0%, 100% { opacity: 0.62; }
    50%      { opacity: 1; }
  }
}

/* ---- OBIETTIVO 2 · POSTAZIONE — IL PIANO IN MANO (QR + codice team) --------------------- */
.app-shell.is-postazione-context .jervi-presentation-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.4rem;
}
.jervi-plan-qr-title {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.05rem, 0.9rem + 1vw, 1.35rem);
  color: #f0ece4;
  letter-spacing: -0.005em;
}
.jervi-plan-qr {
  background: #f0ece4;             /* quiet zone chiara: massima leggibilità dello scan */
  color: #0b0b0b;                  /* i moduli SVG usano currentColor → nero su panna */
  padding: 14px;
  border-radius: 16px;
  line-height: 0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.jervi-plan-qr svg {
  display: block;
  width: clamp(150px, 42vw, 208px);
  height: auto;
}
.jervi-plan-qr-hint {
  color: #a59c92;
  font-size: 0.9rem;
  text-align: center;
  max-width: 26ch;
}
.jervi-presentation-code-label {
  margin-top: 0.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #a59c92;
}

/* =========================================================================================
   OBIETTIVO 4 · HOME — LA STESSA PELLE (solo veste; flusso/stati/copy invariati)
   ========================================================================================= */
/* Scena domande Home: stessa cura editoriale, mobile-first (Home è la superficie del telefono). */
.app-shell[data-context="home"].ui-guiding .dialogue-block {
  justify-content: center;
  padding-top: clamp(1rem, 5vh, 3rem);
  margin-top: 0;
  min-height: min(44vh, 26rem);
}
.app-shell[data-context="home"].ui-guiding .messages {
  max-height: none;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
}
.app-shell[data-context="home"].ui-guiding .messages::before,
.app-shell[data-context="home"].ui-guiding .messages::after {
  display: none;
}
.app-shell[data-context="home"].ui-guiding .msg.assistant {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(1.4rem, 1rem + 3.4vw, 2rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: #f0ece4;
  max-width: 20ch;
  margin: 0 auto;
  text-align: center;
  text-wrap: balance;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .app-shell[data-context="home"].ui-guiding .msg.assistant {
    animation: sguardo-question-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}
.app-shell[data-context="home"].ui-guiding #flowOptions {
  max-width: min(94vw, 32rem);
  margin-left: auto;
  margin-right: auto;
  gap: 0.65rem;
}
.app-shell[data-context="home"].ui-guiding #flowOptions .btn,
.app-shell[data-context="home"].ui-guiding #flowOptions .btn-mode {
  min-height: 50px;
  border-radius: 14px;
}
/* Lettura proposta/routine Home: respiro tipografico coerente (non tocca la struttura). */
.app-shell[data-context="home"].ui-proposal .msg.assistant {
  font-size: clamp(1.02rem, 0.95rem + 0.8vw, 1.18rem);
  line-height: 1.6;
  letter-spacing: 0.002em;
}
/* Desktop Home (≥1025): la Home non è più solo "mobile", regge anche il PC. */
@media (min-width: 1025px) {
  .app-shell[data-context="home"].ui-guiding .msg.assistant {
    font-size: clamp(1.9rem, 1rem + 1.4vw, 2.5rem);
    max-width: 22ch;
  }
  .app-shell[data-context="home"].ui-guiding #flowOptions {
    max-width: 40rem;
  }
}
/* Fine CANTIERE SGUARDO */

/* ============================================================================
   GRANDE OPERA — Atto III · Postazione + Home (APPEND-ONLY).
   Scope rigoroso: .app-shell.is-postazione-context · .app-shell[data-context="home"]
   (mai .ui-professional; data-context="salon" mai toccato). Solo pelle e
   micro-motion transform/opacity; keyframes univoci con prefisso go-.
   ============================================================================ */

/* —— GO-1 · Filigrana EG contenuta: mai tagliata dal bordo, mai sopra il testo — */
body:has(.app-shell.is-postazione-context) .mirror-decoration,
body:has(.app-shell[data-context="home"]:not(.ui-professional)) .mirror-decoration {
  overflow: hidden;
}
@media (max-width: 1023px) {
  body:has(.app-shell.is-postazione-context:not(.ui-standby)) .mirror-decoration,
  body:has(.app-shell[data-context="home"]:not(.ui-standby):not(.ui-professional)) .mirror-decoration {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem 1.15rem 0 0;
  }
  body:has(.app-shell.is-postazione-context:not(.ui-standby)) .salon-logo-heart-wrap,
  body:has(.app-shell[data-context="home"]:not(.ui-standby):not(.ui-professional)) .salon-logo-heart-wrap {
    width: 60px;
    opacity: 0.4;
  }
  body:has(.app-shell.is-postazione-context:not(.ui-standby)) .salon-logo-heart,
  body:has(.app-shell[data-context="home"]:not(.ui-standby):not(.ui-professional)) .salon-logo-heart {
    animation: none;
    transform: none;
  }
  /* Proposta / routine / riepilogo su schermi stretti: il contenuto è sovrano */
  body:has(.app-shell.is-postazione-context.ui-proposal) .mirror-decoration,
  body:has(.app-shell[data-context="home"].ui-proposal:not(.ui-professional)) .mirror-decoration {
    display: none;
  }
}

/* —— GO-2 · Ingresso Home: invito da boutique, non bottone da software ——— */
.app-shell[data-context="home"].ui-standby .btn-primary#startBtn {
  background: var(--panna, #f0ece4);
  color: #101010;
  border: 1px solid rgba(240, 236, 228, 0.9);
  min-height: 3.3rem;
  padding: 0.95rem 2.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 999px;
}
.app-shell[data-context="home"].ui-standby .btn-primary#startBtn:hover {
  background: #ffffff;
}
.app-shell[data-context="home"].ui-standby .controls-slot {
  display: flex;
  justify-content: center;
  padding-top: clamp(0.8rem, 5vh, 2.6rem);
}

/* —— GO-3 · Header Home: stesso respiro editoriale della Postazione ———— */
.app-shell[data-context="home"] .stage-title {
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* —— GO-4 · Dettatura vocale come gesto discreto (Home + Postazione) ——— */
.app-shell[data-context="home"]:not(.ui-professional) .input-row .btn-send[aria-label="Dettatura vocale"],
.app-shell.is-postazione-context .input-row .btn-send[aria-label="Dettatura vocale"] {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  min-height: 3rem;
  padding: 0;
  border-radius: 999px;
  align-self: center;
  font-size: 1rem;
  line-height: 1;
  border: 1px solid rgba(240, 236, 228, 0.28);
  background: transparent;
}

/* —— GO-5 · Micro-motion d'ingresso dei messaggi (reduced-motion rispettato) — */
@media (prefers-reduced-motion: no-preference) {
  .app-shell.is-postazione-context .messages > *,
  .app-shell[data-context="home"]:not(.ui-professional) .messages > * {
    animation: go-msg-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}
@keyframes go-msg-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* —— GO-6 · Consegna del piano sul telefono (SOLO Postazione) ——————————— */
.app-shell.is-postazione-context .jervi-plan-open-btn {
  display: block;
  width: fit-content;
  margin: 0.65rem auto 0;
  text-decoration: none;
  text-align: center;
  background: var(--panna, #f0ece4);
  color: #101010;
  border: 1px solid rgba(240, 236, 228, 0.9);
  border-radius: 999px;
  padding: 0.95rem 2.2rem;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.03em;
}
.app-shell.is-postazione-context .jervi-plan-share-btn {
  display: block;
  width: fit-content;
  margin: 0.65rem auto 0;
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid rgba(240, 236, 228, 0.3);
}

/* —— GO-7 · Logo PNG bianco anche su Home: neutralizza l'invert pensato per il
      JPEG nero (stesso principio del fix Cinema C1-fix3, qui gated Home).
      In coda al foglio: a parità di specificità vince sulle regole legacy. —— */
body:has(.app-shell[data-context="home"]:not(.ui-professional)) .salon-logo-heart {
  filter: none;
}

/* ============================================================================
   GO-8 · SCENA CONSENSO FOTO POSTAZIONE — tutto in un solo schermo tablet.
   APPEND-ONLY. Scope rigoroso: .app-shell.is-postazione-context.ui-guiding
   [data-flow-state="COLLECT_PHOTO"] (solo questa scena; Home/Salon/Pro e le
   altre domande Postazione NON sono raggiunti). Condizione: viewport con
   altezza ≤ 1080px (iPad verticale 1024 e orizzontale 768 inclusi).
   Zero !important; GO-1..GO-7 e reduced-motion intatti.
   ============================================================================ */
@media (max-height: 1080px) {
  /* Messaggio: da tetto 37.6px (clamp 1.45rem→2.35rem) a tetto 28px, interlinea
     compatta ma leggibile a distanza braccio; colonna un po' più larga così
     il testo guadagna in orizzontale ciò che perde in corpo. */
  .app-shell.is-postazione-context.ui-guiding[data-flow-state="COLLECT_PHOTO"] .msg.assistant {
    font-size: clamp(1.1rem, 0.85rem + 1.15vw, 1.75rem);
    line-height: 1.32;
    max-width: 34ch;
  }
  /* Blocco dialogo: niente riserva d'altezza da scena-domanda (46vh/30rem). */
  .app-shell.is-postazione-context.ui-guiding[data-flow-state="COLLECT_PHOTO"] .dialogue-block {
    min-height: 0;
    padding-top: clamp(0.6rem, 2.5vh, 1.4rem);
    padding-bottom: clamp(0.4rem, 1.5vh, 0.9rem);
  }
  /* Card privacy: respiro interno ridotto quanto basta. */
  .app-shell.is-postazione-context[data-flow-state="COLLECT_PHOTO"] .photo-box .photo-consent-stack {
    padding: clamp(0.75rem, 2vh, 1.15rem) clamp(0.9rem, 3vw, 1.4rem);
  }
  .app-shell.is-postazione-context[data-flow-state="COLLECT_PHOTO"] .photo-box .photo-consent-title {
    font-size: clamp(1.05rem, 0.85rem + 1.1vw, 1.3rem);
    margin-bottom: 0.35rem;
  }
  .app-shell.is-postazione-context[data-flow-state="COLLECT_PHOTO"] .photo-box .photo-consent-legal {
    font-size: 0.88rem;
    line-height: 1.45;
  }
  .app-shell.is-postazione-context[data-flow-state="COLLECT_PHOTO"] .photo-box .photo-primary-actions {
    margin-top: 0.7rem;
    gap: 0.55rem;
  }
  /* "Ricomincia" non deve spingere i bottoni primari fuori schermo. */
  .app-shell.is-postazione-context[data-flow-state="COLLECT_PHOTO"] .btn-reset-outside {
    margin-top: 0.45rem;
    min-height: 2.4rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }
}
