:root {
  --quilia-ink: #070707;
  --quilia-white: #f7f7f5;
  --quilia-ease: cubic-bezier(.16, 1, .3, 1);
}

/* Mantiene costante la larghezza quando l'overlay blocca/sblocca lo scroll. */
html, body {
  scrollbar-width: none;
  scrollbar-gutter: auto;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.ai-hero {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100dvh;
  overflow: clip;
  isolation: isolate;
  color: var(--quilia-white);
  background: #000;
}

.ai-hero[hidden] { display: none !important; }

.ai-hero::before {
  position: absolute;
  inset: -8% -5%;
  z-index: -2;
  content: '';
  pointer-events: none;
  opacity: 0;
  background: url('/wp-content/themes/bricks-child/assets/images/ai-q-background.png') center / cover no-repeat;
  filter: blur(.2px);
}

.ai-hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: '';
  pointer-events: none;
  /* background:
    radial-gradient(ellipse at 50% 47%, transparent 0 25%, rgba(0, 0, 0, .1) 50%, rgba(0, 0, 0, .34) 100%),
    linear-gradient(105deg, rgba(255, 255, 255, .025), transparent 28%, rgba(0, 0, 0, .24) 76%); */
}

.hero-copy {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 120px 5vw 70px;
  pointer-events: none;
}

.hero-copy[hidden] { display: none !important; }

.hero-copy .copy-inner {
  width: min(100%, 1100px);
  text-align: center;
}

.hero-copy .i-title {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: Barlow, system-ui, sans-serif;
  font-size: clamp(64px, 6.667vw, 128px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.035em;
  text-wrap: balance;
  font-style:italic;
  text-shadow: none;
  filter: none;
}

.hero-copy .i-title__line,
.hero-copy .i-sub {
  opacity: 0;
  transform: translateY(32px);
}

.hero-copy .i-title__line { display: block; }
.hero-copy .i-title__highlight { display: inline-block; color:#6a6a6a; padding: 0 4px;}

.hero-copy .i-sub {
  max-width: 804px;
  margin: 34px auto 0;
  color: #d9d9d9;
  font-family: Barlow, system-ui, sans-serif;
  font-size: clamp(16px, 1.25vw, 24px);
  font-weight: 500;
  line-height: 1.25;
}

.ai-hero .stage {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(.88);
  transform-origin: 50% 50%;
  transition:
    clip-path 1.45s var(--quilia-ease),
    opacity .9s ease,
    transform 1.45s var(--quilia-ease),
    filter 1.1s ease;
}

.ai-hero .stage > canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ai-hero.phase-copy .stage,
.ai-hero.phase-model .stage,
.ai-hero.phase-greeting .stage,
.ai-hero.phase-ready .stage,
.ai-hero.split .stage {
  opacity: 1;
  transform: scale(1);
}

.ai-greeting {
  position: absolute;
  top: 19.7%;
  left: 55%;
  z-index: 4;
  display: flex;
  width:fit-content;
  min-height: fit-content;
  align-items: center;
  padding: 24px 28px;
  opacity: 0;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 30px;
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, .13) 0%,
      rgba(255, 255, 255, .055) 31%,
      rgba(10, 10, 10, .18) 68%,
      rgba(255, 255, 255, .035) 100%);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 1px 0 0 rgba(255, 255, 255, .08),
    inset 0 -1px 0 rgba(0, 0, 0, .24);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
  transform: translate3d(0, 24px, 0) scale(.965);
  transform-origin: 0 100%;
  pointer-events: none;
}

.ai-greeting::before {
  position: absolute;
  inset: 1px;
  z-index: 0;
  content: '';
  border-radius: inherit;
  background:
    radial-gradient(circle at 13% 0%, rgba(255, 255, 255, .22), transparent 38%),
    linear-gradient(112deg, transparent 34%, rgba(255, 255, 255, .055) 49%, transparent 63%);
  opacity: .78;
  pointer-events: none;
}

.ai-greeting p {
  position: relative;
  z-index: 1;
  margin: 0;
  font: 500 clamp(15px, 1.25vw, 20px)/1.25 Barlow, system-ui, sans-serif;
}

.ai-hero.phase-greeting .ai-greeting,
.ai-hero.phase-ready .ai-greeting {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition: opacity .72s ease, transform 1s var(--quilia-ease);
}

.ai-launcher {
  position: absolute;
  bottom: 7.8%;
  right: clamp(28px, 5.2vw, 100px);
  z-index: 7;
  display: grid;
  grid-template-columns: 52px auto;
  gap: 22px;
  align-items: center;
  min-height: 76px;
  padding: 12px 18px 12px 12px;
  opacity: 0;
  color: #fff;
  border: 0;
  border-radius: 999px;
  background: transparent;
  transform: translateY(24px);
  cursor: pointer;
  pointer-events: none;
}

.ai-launcher__pulse,
.ai-launcher__icon {
  grid-area: 1 / 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

.ai-launcher__pulse {
  background: rgba(255, 255, 255, .5);
  filter: blur(9px);
  animation: quilia-breathe 2.8s ease-in-out infinite;
}

.ai-launcher__icon {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .92);
  background: rgba(4, 4, 4, .82);
  box-shadow: 0 0 0 7px rgba(255, 255, 255, .055), 0 0 28px rgba(255, 255, 255, .32);
  transition: transform .45s var(--quilia-ease), background .3s ease;
}

.ai-launcher__icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.ai-launcher__label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font: 500 clamp(15px, .94vw, 18px)/1.16 Barlow, system-ui, sans-serif;
  text-align: left;
}

.ai-launcher__label small {
  margin-top: 4px;
  color: rgba(255, 255, 255, .68);
  font-size: 13px;
}

.ai-hero.phase-ready .ai-launcher {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity .7s ease, transform 1s var(--quilia-ease);
}

.ai-launcher:hover .ai-launcher__icon,
.ai-launcher:focus-visible .ai-launcher__icon {
  background: rgba(255, 255, 255, .15);
  transform: scale(1.08) rotate(-5deg);
}

.ai-launcher:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 8px;
}

.ai-launcher:disabled { cursor: default; }

@keyframes quilia-breathe {
  0%, 100% { opacity: .38; transform: scale(.84); }
  50% { opacity: .92; transform: scale(1.34); }
}

.ai-exit {
  position: fixed;
  top: 30px;
  right: clamp(28px, 5.2vw, 100px);
  z-index: 60;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 8px;
  opacity: 0;
  color: #fff;
  border: 0;
  background: transparent;
  transform: translateY(-14px);
  cursor: pointer;
  pointer-events: none;
}

.ai-exit__label {
  display: inline-flex;
  overflow: hidden;
  max-width: 190px;
  opacity: .72;
  white-space: nowrap;
  font: 500 14px/1 Barlow, system-ui, sans-serif;
  transition: max-width .5s var(--quilia-ease), opacity .3s ease;
}

.ai-exit__char {
  display: inline-block;
  transform-origin: 50% 70%;
  will-change: transform, opacity;
}

.ai-exit__char.is-space { will-change: auto; }

.ai-exit svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .55s var(--quilia-ease);
}

.ai-exit:hover .ai-exit__label,
.ai-exit:focus-visible .ai-exit__label { opacity: 1; }
.ai-exit:hover svg { animation: none; transform: rotate(90deg) scale(1.06); }
.ai-exit:focus-visible { outline: 1px solid rgba(255,255,255,.8); outline-offset: 4px; }

.ai-hero.phase-ready .ai-exit__char:not(.is-space),
.ai-hero.split .ai-exit__char:not(.is-space) {
  animation: quilia-explore-letter 5.2s var(--quilia-ease) infinite;
  animation-delay: calc(var(--char-index) * 32ms);
}

.ai-hero.phase-ready .ai-exit svg,
.ai-hero.split .ai-exit svg {
  animation: quilia-explore-icon 5.2s var(--quilia-ease) infinite;
}

@keyframes quilia-explore-letter {
  0%, 8%, 34%, 100% {
    opacity: .76;
    transform: translateY(0) scale(1);
  }
  15% {
    opacity: 1;
    transform: translateY(-3px) scale(1.035);
  }
  23% {
    opacity: .88;
    transform: translateY(1px) scale(.995);
  }
}

@keyframes quilia-explore-icon {
  0%, 8% { transform: rotate(0deg) scale(1); }
  18% { transform: rotate(180deg) scale(1.1); }
  28%, 100% { transform: rotate(360deg) scale(1); }
}

.ai-hero.phase-ready .ai-exit,
.ai-hero.split .ai-exit {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity .6s ease, transform .8s var(--quilia-ease);
}

#brx-header {
  transition:
    opacity .8s ease,
    visibility .8s ease,
    transform 1s var(--quilia-ease);
}

body.quilia-intro-running #brx-header {
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  background: transparent;
  transform: translate3d(0, -22px, 0);
  pointer-events: none;
}

#ai-hero #chat-panel {
  --chat-field-right: clamp(28px, 3.4vw, 66px);
  position: absolute;
  inset: 17.6% 0 8% auto;
  z-index: 6;
  width: clamp(720px, 52vw, 1000px);
  opacity: 0;
  right: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg,
      rgba(5, 5, 5, 0) 0%,
      rgba(5, 5, 5, .28) 10%,
      rgba(5, 5, 5, .72) 28%,
      rgba(4, 4, 4, .94) 52%,
      rgba(3, 3, 3, .98) 100%);
  transform: translate3d(110%, 0, 0);
  pointer-events: none;
  transition: opacity .65s ease, transform 1.3s var(--quilia-ease);
}

/* #ai-hero #chat-panel::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: '';
  pointer-events: none;
  background:
    radial-gradient(ellipse at 70% 52%, rgba(255,255,255,.025), transparent 48%),
    linear-gradient(180deg, rgba(0,0,0,.12), transparent 17%, transparent 82%, rgba(0,0,0,.14));
} */

#ai-hero.split .stage { clip-path: inset(0); }

#ai-hero.split .ai-greeting,
#ai-hero.split .ai-launcher {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

#ai-hero.split #chat-panel {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

#ai-hero .chat-shell {
  position: relative;
  z-index: 1;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, .38);
  background: transparent;
}

#ai-hero .chat-head { display: none; }

#ai-hero .chat-main {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: 1fr auto;
}

#ai-hero .chat-body {
  position: relative;
  display: block;
  min-height: 0;
  overflow: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}

.msg {
  position: absolute;
  display: flex;
  margin: 0;
}

.msg.user { right: var(--chat-field-right); width: 59.05%; justify-content: flex-end; }
.msg.bot { left: 7.76%; width: 61.75%; }

.msg .bubble {
  width: 100%;
  min-height: 96px;
  padding: 25px 29px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 30px;
  background:
    linear-gradient(140deg, rgba(169,169,169,.29), rgba(89,89,89,.18));
  box-shadow: 5px 5px 10px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(14px);
  font: 500 clamp(13px, .84vw, 16px)/1.28 Barlow, system-ui, sans-serif;
}

.msg--top { top: 3.5%; opacity: .08; }
.msg--intro { top: 18.8%; opacity: .08; }
.msg--middle { top: 26%; opacity: .48; }
.msg--plain { top: 48.5%; }
.msg--last { top: 72%; }

.chat-body.is-demoing .demo-message {
  opacity: 0;
  filter: blur(6px);
  transform: translate3d(28px, 12px, 0) scale(.975);
  transform-origin: 50% 50%;
  will-change: opacity, filter, transform;
}

.chat-body.is-demoing .demo-message.bot {
  transform: translate3d(-22px, 12px, 0) scale(.975);
}

.chat-body.is-live {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: 24px var(--chat-field-right) 24px 7.8%;
}

.chat-body.is-live .msg {
  position: static;
  width: 100%;
  opacity: 1;
}

.chat-body.is-live .msg .bubble {
  width: min(548px, 78%);
  min-height: auto;
  padding: 20px 24px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 26px;
  background: linear-gradient(140deg, rgba(169,169,169,.29), rgba(89,89,89,.18));
  box-shadow: 5px 5px 10px rgba(0,0,0,.25);
  backdrop-filter: blur(14px);
  font-size: 16px;
  text-shadow: none;
}

/* Quilia usa un vetro freddo; i messaggi dell'utente restano neutri e più
   luminosi. */
.msg.bot .bubble {
  border-color: rgba(139, 210, 255, .2);
  background:
    linear-gradient(140deg, rgba(43, 62, 76, .72), rgba(14, 21, 27, .58));
  box-shadow:
    5px 5px 12px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(203, 235, 255, .11);
}

.msg.user .bubble {
  border-color: rgba(255, 255, 255, .16);
  background:
    linear-gradient(140deg, rgba(176, 176, 176, .4), rgba(88, 88, 88, .25));
  box-shadow:
    5px 5px 12px rgba(0, 0, 0, .24),
    inset 0 1px 0 rgba(255, 255, 255, .13);
}

.bubble audio { width: 100%; }

.typing { display: inline-flex; gap: 6px; }
.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: tdot 1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes tdot {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

#ai-hero .composer {
  position: relative;
  width: min(548px, calc(100% - var(--chat-field-right) - 48px));
  margin: 0 var(--chat-field-right) 0 auto;
  padding: 0 0 2px;
}

#composerBox {
  position: relative;
  display: grid;
  min-height: 52px;
  grid-template-columns: 1fr 36px 36px;
  gap: 3px;
  align-items: center;
  padding: 7px 7px 7px 12px;
  border: 1px solid rgba(255, 255, 255, .84);
  border-radius: 40px;
  background: linear-gradient(100deg, rgba(255,255,255,.58), rgba(255,255,255,.25));
  box-shadow: 5px 5px 10px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255,255,255,.2);
  backdrop-filter: blur(18px) saturate(120%);
}

#composerBox .demo-draft {
  position: absolute;
  top: 50%;
  right: 88px;
  left: 16px;
  overflow: hidden;
  opacity: 0;
  color: rgba(8, 8, 8, .76);
  transform: translateY(-50%);
  pointer-events: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: 500 16px/1.25 Barlow, system-ui, sans-serif;
}

#composerBox.is-demo-typing .demo-draft { opacity: 1; }
#composerBox.is-demo-typing #chatText::placeholder { opacity: 0; }

#chatText {
  box-sizing: border-box;
  width: 100%;
  min-height: 20px;
  resize: none;
  overflow-y: hidden;
  padding: 7px 4px 6px;
  color: #080808;
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 16px/1.25 Barlow, system-ui, sans-serif;
}

#chatText::placeholder { color: rgba(0, 0, 0, .72); }

.icon-btn {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  color: #111;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: transform .25s var(--quilia-ease), opacity .2s ease, background .2s ease;
}

.icon-btn:hover { transform: scale(1.08); background: #f2f2f2; }
.send { font-size: 20px; line-height: 1; transform: rotate(45deg); }
.send:hover { transform: rotate(45deg) scale(1.08); }
.send:disabled { opacity: .45; pointer-events: none; }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

.fade-top {
  position: absolute;
  inset: -12px 48px auto 48px;
  height: 12px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.28), transparent);
}
#composerBox[data-overflow="1"] .fade-top { opacity: 1; }

#recordHint {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  padding: 9px 12px;
  opacity: 0;
  color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  background: rgba(20,20,20,.84);
  transform: translateY(8px);
  pointer-events: none;
  font: 500 12px/1.2 Barlow, system-ui, sans-serif;
}

#recordBar[hidden] { display: none !important; }
#recordBar {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  left: 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  color: #ffe2e2;
  border: 1px solid rgba(255,95,95,.45);
  border-radius: 16px;
  background: rgba(90,15,15,.86);
  font: 500 13px/1 Barlow, system-ui, sans-serif;
}

#recordBar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5757;
  animation: rec-pulse 1.4s infinite;
}

#recordBar .cancel {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: inherit;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 9px;
  background: rgba(255,255,255,.08);
}

@keyframes rec-pulse {
  70% { box-shadow: 0 0 0 11px rgba(255,87,87,0); }
}

.site-transition {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  pointer-events: none;
}

.site-transition span {
  display: block;
  background:
    linear-gradient(180deg, #252525 0%, #111 58%, #050505 100%);
  transform: scaleY(0);
  transform-origin: 50% 100%;
}

.site-transition span:nth-child(2) {
  background: linear-gradient(180deg, #303030 0%, #161616 62%, #070707 100%);
}

/* Il campo resta a schermo intero; solo il volto assume la posa dock. */
.quilia-ai-dock {
  position: fixed;
  inset: 0;
  z-index: 99989;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  opacity: 1;
  filter: none;
  isolation: isolate;
  pointer-events: none;
}

.quilia-ai-dock > canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.quilia-ai-dock-hit {
  position: fixed;
  right: clamp(12px, 1.7vw, 32px);
  bottom: clamp(12px, 1.7vw, 32px);
  z-index: 99990;
  width: clamp(108px, 9vw, 170px);
  height: clamp(140px, 11.5vw, 220px);
  padding: 0;
  border: 0;
  border-radius: 44%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.quilia-ai-dock-hit[hidden] { display: none !important; }

.quilia-ai-dock-hit:focus-visible {
  outline: 1px solid rgba(255, 255, 255, .72);
  outline-offset: 5px;
}

@media (max-width: 767px) {
  .quilia-ai-dock-hit {
    right: 0px;
    bottom: 0px;
    width: 96px;
    height: 132px;
  }
}

.ai-hero.is-leaving .ai-exit,
.ai-hero.is-leaving .ai-launcher,
.ai-hero.is-leaving #chat-panel {
  pointer-events: none;
}

@media (max-width: 1024px) {
  .ai-greeting {
    top: 20%;
    right: 5vw;
    left: auto;
    width: min(283px, 38vw);
  }

  .ai-launcher { right: 5vw; bottom: 7%; left: auto; }

  #ai-hero.split .stage { clip-path: inset(0); opacity: .2; filter: blur(3px); }

  #ai-hero #chat-panel {
    inset: 13% 4vw 5% 4vw;
    width: auto;
  }

  #ai-hero .chat-shell {
    border-right: 0;
    background: linear-gradient(135deg, rgba(8,8,8,.72), rgba(15,15,15,.52));
    backdrop-filter: blur(12px);
  }
}

@media (max-width: 767px) {
  body:has(.quilia-home) .hero-copy {
    padding: 80px var(--mobile-gutter, 24px) 64px;
    place-items: center;
  }

  body:has(.quilia-home) .hero-copy .copy-inner { text-align: center; }

  body:has(.quilia-home) .hero-copy .i-title {
    align-items: center;
    font-size: clamp(40px, 11.5vw, 72px);
    line-height: 1.12;
  }

  body:has(.quilia-home) .hero-copy .i-sub {
    max-width: 30ch;
    margin: 24px auto 0;
    line-height: 1.5;
  }
}

@media (max-width: 767px) and (max-height: 500px) {
  body:has(.quilia-home) .hero-copy { padding-block: 48px 24px; }
  body:has(.quilia-home) .hero-copy .i-title { font-size: clamp(30px, 10svh, 48px); }
}

@media (min-width: 768px) and (max-height: 650px) {
  body:has(.quilia-home) .hero-copy { padding-block: 60px 32px; }
  body:has(.quilia-home) .hero-copy .i-title { font-size: clamp(32px, 9svh, 56px); }
  body:has(.quilia-home) .hero-copy .i-sub { margin-top: 16px; font-size: 15px; }
  body:has(.quilia-home) .ai-greeting { top: 15%; min-height: 0; padding: 12px 16px; }
  body:has(.quilia-home) .ai-greeting p { font-size: 15px; }
}

@media (max-width: 600px) {
  .ai-greeting {
    top: 19%;
    right: 16px;
    width: fit-content;
    min-height: fit-content;
    padding: 20px 22px;
    border-radius: 20px;
  }

  .ai-greeting p { font-size: 16px; }

  .ai-launcher {
    right:0;
    bottom: 24px;
    grid-template-columns: 1fr;
    gap: 14px;
    justify-items: center;
  }

  .ai-launcher__pulse,
  .ai-launcher__icon { width: 48px; height: 48px; }

  .ai-exit { top: 18px; right: 14px; }
  .ai-exit__label { display: none; }

  .quilia-ai-dock {
    inset: 0;
    width: 100vw;
    height: 100dvh;
  }

  .ai-hero.phase-ready .ai-launcher{
    width:100%;
  }
  .ai-launcher__label small{
    display:none;
  }
  .ai-launcher__label{
    align-items:center;
  }
  #ai-hero #chat-panel {
    --chat-field-right: 10px;
    inset: 92px 12px 20px;
  }
  #ai-hero .chat-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    padding: 8px 6px 18px;
  }
  #ai-hero .chat-body .msg { position: static; width: 100%; opacity: 1; }
  .msg .bubble { width: 88%; padding: 18px 20px; border-radius: 22px; }
  #ai-hero .composer { width: calc(100% - 20px); margin-left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-hero *,
  .ai-hero *::before,
  .ai-hero *::after,
  .quilia-ai-dock {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* L'AI si sovrappone alla pagina senza modificarne altezza o posizione. */
.ai-hero.quilia-ai-overlay {
  position: fixed;
  inset: 0;
  z-index: 99991;
  height: 100dvh;
  min-height: 0;
  transition: background-color 1.1s ease;
}
.ai-hero.quilia-ai-overlay.is-leaving {
  background-color: transparent;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .ai-hero.quilia-ai-overlay { transition: none; }
}
