:root {
  --bg: #000000;
  --surface: #141414;
  --accent: #c9a96e;
  --text-primary: #f0ece4;
  --text-secondary: #7a7370;
  --border: #2a2825;
  --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: system-ui, -apple-system, "Helvetica Neue", Arial, 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(201, 169, 110, 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(201, 169, 110, 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);
  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);
  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(201, 169, 110, 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(201, 169, 110, 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(201, 169, 110, 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(201, 169, 110, 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: rgba(201, 169, 110, 0.82);
}

.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;
  color: rgba(201, 169, 110, 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(201, 169, 110, 0.28);
}

.app-shell[data-flow-state="CONSULTATION_SUMMARY"] .consultation-summary-card {
  background: rgba(10, 10, 10, 0.62);
  border: 1px solid rgba(201, 169, 110, 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);
  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(201, 169, 110, 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;
  color: rgba(201, 169, 110, 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(201, 169, 110, 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(201, 169, 110, 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(201, 169, 110, 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: 999px;
  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(201, 169, 110, 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(201, 169, 110, 0.42);
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.22), rgba(78, 54, 24, 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: 999px;
  border: 1px solid rgba(201, 169, 110, 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(201, 169, 110, 0.12);
  border-color: rgba(201, 169, 110, 0.45);
  color: var(--text-primary);
}

.btn-primary:not(:disabled):hover {
  border-color: rgba(201, 169, 110, 0.62);
  background: rgba(201, 169, 110, 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(201, 169, 110, 0.38);
  background: rgba(20, 20, 20, 0.45);
}

.btn-send {
  flex: 0 0 auto;
  min-width: 6.5rem;
  background: rgba(201, 169, 110, 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(201, 169, 110, 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.82rem;
  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.82rem;
  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 rgba(201, 169, 110, 0.55);
  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(201, 169, 110, 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.88rem;
  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(201, 169, 110, 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(201, 169, 110, 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(201, 169, 110, 0.58);
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.2), rgba(20, 20, 20, 0.86));
    color: #fff8ec;
    box-shadow: inset 0 0 0 1px rgba(201, 169, 110, 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: rgba(201, 169, 110, 0.92);
  }

  .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;
    color: rgba(201, 169, 110, 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(201, 169, 110, 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(201, 169, 110, 0.3);
  }

  .app-shell[data-context="home"][data-flow-state="CONSULTATION_SUMMARY"] .home-shop-link {
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.28), rgba(55, 39, 18, 0.72));
    border-color: rgba(201, 169, 110, 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: 999px;
  border: 1px solid rgba(214, 190, 118, 0.72);
  background-color: rgba(12, 11, 17, 0.76);
  background-image: linear-gradient(180deg, rgba(214, 190, 118, 0.2), rgba(214, 190, 118, 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(238, 215, 137, 0.95);
  background-color: rgba(18, 16, 23, 0.86);
  background-image: linear-gradient(180deg, rgba(238, 215, 137, 0.3), rgba(214, 190, 118, 0.1));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(238, 215, 137, 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 rgba(238, 215, 137, 0.82);
  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(238, 215, 137, 0.94);
  background-image: linear-gradient(180deg, rgba(255, 246, 214, 0.98), rgba(214, 190, 118, 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(214, 190, 118, 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(255, 252, 236, 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(214, 190, 118, 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: 999px;
  border: 1px solid rgba(184, 140, 42, 0.95);
  background-color: rgba(214, 190, 118, 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(255, 252, 236, 0.99), rgba(214, 190, 118, 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: 999px;
  border: 1px solid rgba(214, 190, 118, 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(238, 215, 137, 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 rgba(238, 215, 137, 0.72);
  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(201, 169, 110, 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(201, 169, 110, 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;
  }
}
