.goccia-guide {
  position: fixed; left: max(14px, env(safe-area-inset-left));
  bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 84;
  width: min(460px, calc(100vw - 84px)); color: #101820;
  font-family: 'DM Sans', sans-serif;
}
.goccia-guide[hidden], .goccia-guide [hidden], .goccia-launcher[hidden] { display: none !important; }
.goccia-card {
  position: relative; padding: 16px; max-height: calc(100dvh - 100px); overflow: auto;
  background: #fff; border: 1px solid #b9d8ff; border-top: 4px solid #005dcc;
  border-radius: 12px; box-shadow: 0 14px 48px #002b5b30; overscroll-behavior: contain;
}
.goccia-intro { display: flex; align-items: center; gap: 13px; padding-right: 32px; }
.goccia-intro > div:last-child { min-width: 0; }
.goccia-portrait { position: relative; width: 150px; height: 269px; flex: none; }
.goccia-portrait img { display: block; width: 100%; height: 100%; object-fit: contain; }
.goccia-eyebrow { color: #005dcc; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
#goccia-title { font: 800 21px/1.18 'Manrope', sans-serif; margin: 6px 0; overflow-wrap: anywhere; }
#goccia-message { font-size: 13px; line-height: 1.5; margin: 9px 0 12px; overflow-wrap: anywhere; }
.goccia-close {
  position: sticky; float: right; top: 0; margin: -6px -6px 0 0; width: 36px; height: 36px;
  z-index: 2; border: 0; border-radius: 50%; background: #edf5ff; color: #005dcc;
  font: 25px/1 'DM Sans', sans-serif; cursor: pointer;
}
.goccia-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.goccia-action {
  display: flex; justify-content: center; align-items: center; min-width: 0; min-height: 40px;
  padding: 8px 9px; border: 1px solid #005dcc; border-radius: 5px; text-decoration: none;
  background: #005dcc; color: #fff; font: 700 12px/1.25 'DM Sans', sans-serif;
  text-align: center; cursor: pointer; overflow-wrap: anywhere;
}
.goccia-action.secondary { background: #fff; color: #005dcc; }
.goccia-tools button:disabled { color: #5e6d7d; cursor: default; text-decoration: none; }
.goccia-tools { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 10px; }
.goccia-tools button {
  min-height: 32px; padding: 3px 0; border: 0; background: none; color: #005dcc;
  font: 600 11px/1.35 'DM Sans', sans-serif; text-decoration: underline; cursor: pointer;
}
.goccia-voice-info { font-size: 10px; line-height: 1.35; margin: 6px 0 0; color: #4c6076; }
.goccia-voice-info summary { color: #005dcc; cursor: pointer; }
.goccia-voice-info p { font-size: 11px; line-height: 1.4; margin: 6px 0; }
.goccia-media-help { margin: 6px 0 0; font-size: 11px; line-height: 1.4; color: #254f79; }
.goccia-media-help:empty { display: none; }
.goccia-launcher {
  position: fixed; left: max(70px, calc(env(safe-area-inset-left) + 70px));
  bottom: max(14px, env(safe-area-inset-bottom)); z-index: 72;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid #005dcc;
  background: #fff; box-shadow: 0 3px 14px #0002; cursor: pointer; padding: 2px;
}
.goccia-launcher img { width: 100%; height: 100%; object-fit: contain; }
.goccia-guide button:focus-visible, .goccia-guide a:focus-visible, .goccia-launcher:focus-visible {
  outline: 3px solid #6cafff; outline-offset: 3px;
}
.goccia-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.goccia-target { outline: 3px solid #2d8cff !important; outline-offset: 5px !important; }
.goccia-walkthrough #goccia-title { font-size: 17px; }
.goccia-field-active .goccia-walkthrough #goccia-message { max-height: 48px; overflow: auto; }
.goccia-guide:not([hidden]) .goccia-portrait img { animation: goccia-arrive .45s ease-out; }
.goccia-speaking .goccia-portrait img { animation: goccia-breathe 1.6s ease-in-out infinite; }
@keyframes goccia-arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes goccia-breathe { 50% { transform: translateY(-3px); } }
@media (max-width: 600px) {
  .goccia-guide { left: 8px; width: calc(100vw - 82px); bottom: calc(68px + env(safe-area-inset-bottom)); }
  .goccia-card { padding: 11px; max-height: calc(100dvh - 90px); }
  .goccia-intro { gap: 9px; padding-right: 23px; }
  .goccia-portrait { width: 96px; height: 172px; }
  #goccia-title { font-size: 18px; }
  #goccia-message { font-size: 12px; }
  .goccia-action { min-height: 38px; padding: 7px 5px; font-size: 11px; }
  .goccia-walkthrough #goccia-title { font-size: 15px; }
  .goccia-close { width: 36px; height: 36px; margin: -4px -4px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .goccia-guide .goccia-portrait img { animation: none !important; transform: none; }
  .goccia-target { scroll-behavior: auto; }
}

/* The supplied character is free on the page; only the speech bubble is framed. */
.goccia-character {
  position: fixed; left: var(--goccia-x, calc(100vw - 165px)); top: var(--goccia-y, 105px);
  width: var(--goccia-size,150px); z-index: 86; pointer-events: none;
  transition: left .48s ease-in-out, top .48s ease-in-out, width .2s ease;
}
.goccia-character .goccia-portrait { width: 100%; height: auto; aspect-ratio: 1143 / 2048; }
.goccia-indication {
  position: fixed; padding: 2px 6px; border-radius: 8px; background: #005dcc; color: white;
  font: 700 10px/1.4 'DM Sans',sans-serif; box-shadow: 0 0 0 3px #fff;
}
.goccia-guide { width: min(350px,calc(100vw - 84px)); }
.goccia-card { border-top-width: 2px; }
.goccia-intro { padding-right: 32px; }
.goccia-voice-info { font-size: 10px; line-height: 1.3; }
@media (max-width:600px) {
  .goccia-character { width: var(--goccia-size,96px); }
  .goccia-guide { width: calc(100vw - 82px); }
  .goccia-walkthrough .goccia-voice-info { display: none; }
  .goccia-card { padding: 10px; }
}
@media (prefers-reduced-motion:reduce) {
  .goccia-character { transition: none !important; }
}

@media (max-width:600px) and (max-height:680px) {
  .goccia-walkthrough .goccia-eyebrow { display: none; }
  .goccia-walkthrough .goccia-card { padding: 8px; max-height: 205px; }
  .goccia-walkthrough #goccia-title { font-size: 13px; margin: 2px 28px 4px 0; }
  .goccia-walkthrough #goccia-message { max-height: 30px; overflow: auto; font-size: 11px; line-height: 1.35; margin: 4px 0 6px; }
  .goccia-walkthrough .goccia-action.secondary { display: none; }
  .goccia-walkthrough .goccia-actions { grid-template-columns: 1fr; }
  .goccia-walkthrough .goccia-action { min-height: 32px; padding: 5px; }
  .goccia-walkthrough .goccia-tools { margin-top: 5px; gap: 2px 8px; }
  .goccia-walkthrough .goccia-tools button { min-height: 27px; font-size: 10px; }
}

@media (max-width:600px) and (max-height:680px) {
  .goccia-card { max-height: 220px; }
}

.goccia-activate {
  width: 100%; min-height: 38px; margin: 4px 0 8px; padding: 7px 10px;
  border: 0; border-radius: 5px; background: #005dcc; color: #fff;
  font: 700 12px/1.35 'DM Sans',sans-serif; cursor: pointer;
}
.goccia-activate:focus-visible { outline: 3px solid #7fbeff; outline-offset: 2px; }

/* Richiamo discreto: il launcher resta compatto ma comunica chiaramente la sua funzione. */
.goccia-launcher:not([hidden]) { animation: goccia-launcher-pulse 2.8s ease-in-out infinite; }
.goccia-prompt {
  position: fixed; left: max(122px, calc(env(safe-area-inset-left) + 122px));
  bottom: max(18px, env(safe-area-inset-bottom)); z-index: 71;
  max-width: min(260px, calc(100vw - 150px)); padding: 9px 13px;
  border: 1px solid #005dcc; border-radius: 7px; background: #005dcc; color: white;
  box-shadow: 0 5px 18px #002b5b35; font: 700 11px/1.25 'DM Sans', sans-serif;
  pointer-events: none; white-space: nowrap;
}
.goccia-prompt::before { content: ''; position: absolute; left: -7px; bottom: 14px; width: 12px; height: 12px; background: #005dcc; border-left: 1px solid #005dcc; border-bottom: 1px solid #005dcc; transform: rotate(45deg); }
.goccia-prompt:not([hidden]) { animation: goccia-prompt-in .3s ease-out both; }
@keyframes goccia-launcher-pulse {
  0%, 100% { box-shadow: 0 3px 14px #0002, 0 0 0 0 #005dcc00; }
  50% { box-shadow: 0 4px 16px #0003, 0 0 0 8px #005dcc24; }
}
@keyframes goccia-prompt-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .goccia-prompt { left: 122px; max-width: calc(100vw - 138px); padding: 8px 10px; font-size: 10px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .goccia-launcher:not([hidden]), .goccia-prompt:not([hidden]) { animation: none !important; }
}
