/* One full-size character; the chat uses only its small face mark for attribution. */
:root {
  --amp-glass: color-mix(in srgb, var(--ha-paper) 88%, transparent);
  --amp-edge: color-mix(in srgb, var(--ha-white) 85%, transparent);
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.amp-chat-shell[hidden],
.ask-amp[hidden] {
  display: none !important;
}
body .ask-amp {
  position: fixed;
  z-index: 85;
  left: calc(100vw - 110px);
  top: calc(100dvh - 110px);
  right: auto;
  bottom: auto;
  width: 88px;
  height: 88px;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  isolation: isolate;
  transition: none;
  transform: none;
  touch-action: manipulation;
}
.ask-amp:before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/brand/assets/ask-amp-agent-expressions.png?v=3") 0 0/700%
    100% no-repeat;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 3px 2px rgba(var(--ha-ink-rgb), 0.14));
}
.amp-shove-arm {
  position: fixed;
  z-index: 84;
  background: url("/brand/assets/amp-push-hand-v2.webp?v=1") left center/100%
    100% no-repeat;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: 0 0;
}
.amp-shove-arm.is-shoving {
  visibility: visible;
}
.ask-amp.is-blinking:before {
  background-position: 50% 0;
}
.ask-amp.is-looking-left:before {
  background-position: 16.6667% 0;
}
.ask-amp.is-looking-right:before {
  background-position: 33.3333% 0;
}
.ask-amp.is-error:before {
  background-position: 100% 0;
}
.ask-amp.has-live-eyes {
  --amp-gaze-x: 0px;
  --amp-gaze-y: 0px;
}
.ask-amp.has-live-eyes.is-arriving {
  --amp-gaze-x: -3px;
  --amp-gaze-y: 0px;
  pointer-events: none;
}
.home-page .ask-amp.has-live-eyes:before {
  background: url("/brand/assets/ask-amp-character-v6.webp?v=1") 50% 50%/145%
    auto no-repeat;
}
.ask-amp.has-live-eyes .amp-eye {
  position: absolute;
  z-index: 2;
  top: 20.5%;
  width: 17%;
  aspect-ratio: 1;
  pointer-events: none;
}
.ask-amp.has-live-eyes .amp-eye-left {
  left: 17.5%;
}
.ask-amp.has-live-eyes .amp-eye-right {
  left: 57%;
}
.ask-amp.has-live-eyes .amp-eye:before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ha-ink);
  transform: translate(
    calc(-50% + var(--amp-gaze-x)),
    calc(-50% + var(--amp-gaze-y))
  );
  transition: transform 80ms linear;
}
.ask-amp.has-live-eyes.is-blinking .amp-eye:before,
.ask-amp.has-live-eyes.is-winking .amp-eye-right:before {
  width: 64%;
  height: 2px;
  aspect-ratio: auto;
  border-radius: 2px;
}
.ask-amp.has-live-eyes.is-shy .amp-eye:before {
  width: 30%;
  height: 26%;
  aspect-ratio: auto;
}
.ask-amp.has-live-eyes.is-happy:not(.is-winking):not(.is-blinking) .amp-eye:before {
  width: 58%;
  height: 35%;
  aspect-ratio: auto;
  background: transparent;
  border-top: 2px solid var(--ha-ink);
  border-radius: 50% 50% 0 0;
  transform: translate(-50%, -15%);
}
.ask-amp.is-walking:before {
  animation: amp-steps 0.42s ease-in-out infinite;
}
.ask-amp:focus-visible {
  outline: 3px solid var(--ha-bloom-deep);
  outline-offset: 5px;
  border-radius: 8px;
}
.amp-chat-is-open .ask-amp {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 85;
}
.amp-chat-shell {
  position: fixed;
  right: var(--ha-gutter, 24px);
  top: calc(var(--ha-header-height, 80px) + 24px);
  bottom: auto;
  z-index: 80;
  width: min(500px, calc(100vw - 40px));
  height: min(430px, calc(100dvh - var(--ha-header-height, 80px) - 48px));
  box-sizing: border-box;
  color: var(--ha-ink);
  font:
    14px/1.55 Manrope,
    var(--ha-font-sans),
    sans-serif;
  pointer-events: none;
}
.amp-chat-shell * {
  box-sizing: border-box;
}
.amp-chat-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--ha-paper) 96%, transparent);
  border: 1px solid var(--ha-bloom);
  border-radius: 22px;
  box-shadow:
    10px 12px 0 rgba(var(--ha-ink-rgb), 0.18),
    0 24px 56px rgba(var(--ha-ink-rgb), 0.18);
  backdrop-filter: blur(24px) saturate(0.9);
  overflow: hidden;
  pointer-events: auto;
  transform-origin: right bottom;
}
.amp-chat-shell:not([hidden]) .amp-chat-panel {
  animation: amp-chat-open 480ms cubic-bezier(0.2, 0.72, 0.2, 1) both;
}
.amp-chat-from-hero .amp-chat-shell:not([hidden]) .amp-chat-panel {
  animation: none;
}
.amp-chat-header {
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 50px;
  padding: 3px 8px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ha-ink) 13%, transparent);
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  pointer-events: auto;
}
.amp-chat-identity {
  font-size: 13px;
  margin: 0;
  color: var(--ha-ink);
  font-weight: 600;
}
.amp-chat-header-actions {
  display: flex;
  gap: 2px;
}
.amp-chat-icon-button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ha-ink);
  border-radius: 50%;
  cursor: pointer;
}
.amp-chat-icon-button:hover {
  background: color-mix(in srgb, var(--ha-ink) 8%, transparent);
}
.amp-chat-icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* One button, two glyphs: out to expand, in to shrink. */
.amp-chat-expand .amp-chat-icon-shrink,
.amp-chat-expand[aria-pressed="true"] .amp-chat-icon-grow {
  display: none;
}
.amp-chat-expand[aria-pressed="true"] .amp-chat-icon-shrink {
  display: block;
}
/* Pull the panel bigger from its bottom-right corner. It sits inside the
   panel's rounded corner, clear of the send button and the privacy note. */
.amp-chat-resize {
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 2;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ha-ink-soft);
  cursor: nwse-resize;
  touch-action: none;
}
/* Two corner strokes, inside the panel's 22px radius. */
.amp-chat-resize:before {
  content: "";
  position: absolute;
  inset: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-bottom-right-radius: 3px;
  opacity: 0.65;
}
.amp-chat-resize:hover:before,
.amp-chat-resize:focus-visible:before {
  opacity: 1;
}
.amp-chat-shell.is-resizing .amp-chat-panel {
  animation: none;
  transition: none;
}
.amp-chat-thread {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 8px;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ha-ink-soft) transparent;
  mask-image: linear-gradient(
    transparent,
    black 24px,
    black calc(100% - 4px),
    transparent
  );
  pointer-events: auto;
  outline-offset: -4px;
}
.amp-chat-thread:focus-visible {
  mask-image: none;
}
.amp-chat-message {
  flex: none;
  display: flex;
  flex-direction: column;
  max-width: 82%;
  width: fit-content;
  margin: 0 0 10px;
  padding: 10px 14px 8px;
  border: 1px solid color-mix(in srgb, var(--ha-ink) 12%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--ha-paper) 82%, transparent);
  backdrop-filter: none;
  box-shadow:
    inset 0 1px 0 var(--ha-white),
    0 7px 24px rgba(var(--ha-ink-rgb), 0.055);
  font-size: 14px;
  line-height: 1.48;
}
.amp-chat-message-amp,
.amp-chat-message-human {
  align-self: flex-start;
  background: color-mix(
    in srgb,
    var(--ha-bloom) 18%,
    color-mix(in srgb, var(--ha-paper) 84%, transparent)
  );
  border-bottom-left-radius: 8px;
}
.amp-chat-message-visitor {
  align-self: flex-end;
  border-bottom-right-radius: 8px;
}
.amp-chat-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ha-ink);
}
.amp-chat-speaker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 650;
  color: var(--ha-ink-soft);
}
.amp-chat-message-amp .amp-chat-speaker:before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 26px;
  flex: none;
  background: url("/brand/assets/amp-face.svg") center/contain no-repeat;
}
.amp-chat-message-meta {
  align-self: flex-end;
  font-size: 10px;
  color: var(--ha-ink-soft);
  margin-top: 2px;
}
.amp-chat-composer {
  position: relative;
  pointer-events: auto;
  padding: 10px 12px 12px 92px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--ha-ink) 13%, transparent);
  background: color-mix(in srgb, var(--ha-paper) 24%, transparent);
  border-radius: 0;
}
.amp-chat-anchor {
  position: absolute;
  left: 10px;
  bottom: 5px;
  width: 74px;
  height: 74px;
  pointer-events: none;
}
.amp-chat-compose-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 2px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--ha-ink) 22%, transparent);
  border-radius: 20px;
  background: var(--ha-paper);
  backdrop-filter: none;
  box-shadow: inset 0 1px 0 var(--ha-white);
}
.amp-chat-attach,
.amp-chat-talk,
.amp-chat-send {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ha-ink);
  cursor: pointer;
}
.amp-chat-send {
  color: var(--ha-bloom-deep);
}
.amp-chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}
.amp-chat-attach svg,
.amp-chat-talk svg,
.amp-chat-send svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.amp-chat-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  max-height: 112px;
  resize: none;
  border: 0;
  background: transparent;
  padding: 11px 4px;
  color: var(--ha-ink);
  font:
    16px/1.4 Manrope,
    sans-serif;
  border-radius: 8px;
}
.amp-chat-input::placeholder {
  color: var(--ha-ink-soft);
  opacity: 1;
}
.amp-chat-input:disabled {
  color: var(--ha-ink-soft);
}
.amp-chat-attach:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Talk. Hidden until the adapter says voice is on; ember when live. */
.amp-chat-talk[hidden] {
  display: none;
}
.amp-chat-talk.is-live {
  background: var(--ha-bloom);
  color: var(--ha-ink);
  animation: amp-chat-talk-pulse 2.4s ease-in-out infinite;
}

/* Shown once, before the visitor has said anything, only when Talk is on.
   Sits above the details card and the compose row, so it never overlaps
   either, with a small caret pointing down toward the microphone. */
.amp-chat-talk-hint {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--ha-bloom);
  border-radius: 12px;
  background: var(--ha-paper);
  color: var(--ha-ink);
  font:
    600 12.5px/1.4 Manrope,
    sans-serif;
  text-align: left;
  cursor: pointer;
  animation: amp-chat-hint-fade 420ms ease;
}
.amp-chat-talk-hint[hidden] {
  display: none;
}
.amp-chat-talk-hint-caret {
  margin-left: 4px;
  color: var(--ha-bloom-deep);
  font-weight: 700;
}
@keyframes amp-chat-hint-fade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pencilled in as the visitor talks. The default is a compact disclosure at
   the bottom of the panel; the full hand-drawn note opens in place. */
.amp-chat-details {
  margin: 0 0 8px;
  padding: 0;
  border: 1px dashed var(--ha-bloom);
  border-radius: 12px;
  background: var(--ha-paper);
  overflow: hidden;
}
.amp-chat-details[hidden] {
  display: none;
}
.amp-chat-details-head {
  display: flex;
  align-items: center;
  gap: 4px;
}
.amp-chat-details-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 38px;
  padding: 6px 4px 6px 10px;
  border: 0;
  background: transparent;
  color: var(--ha-ink);
  text-align: left;
  cursor: pointer;
}
.amp-chat-details-caption {
  margin: 0;
  color: var(--ha-bloom-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.amp-chat-details-compact {
  min-width: 0;
  overflow: hidden;
  color: var(--ha-ink-soft);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.amp-chat-details-chevron {
  color: var(--ha-bloom-deep);
  font-size: 13px;
  transform: rotate(180deg);
}
.amp-chat-details-toggle[aria-expanded="true"] .amp-chat-details-chevron {
  transform: none;
}
.amp-chat-details-edit {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 12px;
  border: 1px solid var(--ha-bloom);
  border-radius: 14px;
  background: transparent;
  color: var(--ha-ink);
  font:
    650 11px/1.4 Manrope,
    sans-serif;
  cursor: pointer;
}
.amp-chat-details-edit:hover {
  background: color-mix(in srgb, var(--ha-bloom) 22%, transparent);
}
.amp-chat-details-list {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 10px;
  margin: 0;
  padding: 2px 10px 9px;
}
.amp-chat-details-body[hidden] {
  display: none;
}
.amp-chat-details-row {
  display: contents;
}
.amp-chat-details dt {
  font-size: 11px;
  font-weight: 650;
  color: var(--ha-ink-soft);
}
.amp-chat-details dd {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  min-height: 15px;
  color: var(--ha-ink);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.amp-chat-details dd.is-blank {
  display: block;
  height: 0;
  min-height: 0;
  margin: 8px 0 6px;
  border-bottom: 1px dotted color-mix(in srgb, var(--ha-ink) 38%, transparent);
}

/* The live strip sits above the compose row, inside the composer, so the
   handover card cannot hide the call controls. */
.amp-chat-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--ha-hairline);
  border-radius: 12px;
  background: var(--ha-paper);
  color: var(--ha-ink);
  font-size: 12px;
  line-height: 1.35;
}
.amp-chat-live[hidden] {
  display: none;
}
.amp-chat-live-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ha-bloom-deep);
  animation: amp-chat-talk-pulse 1.6s ease-in-out infinite;
}
.amp-chat-live.is-connecting .amp-chat-live-dot,
.amp-chat-live.is-muted .amp-chat-live-dot {
  background: var(--ha-ink-soft);
}
.amp-chat-live.is-muted .amp-chat-live-dot {
  animation: none;
}
.amp-chat-live-text {
  flex: 1 1 auto;
  min-width: 0;
}
.amp-chat-live-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, var(--ha-ink) 22%, transparent);
  border-radius: 16px;
  background: var(--ha-white);
  color: var(--ha-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.amp-chat-live-button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--ha-ink) 12%, var(--ha-paper));
}
.amp-chat-live-button[hidden] {
  display: none;
}
.amp-chat-live-stop {
  background: var(--ha-ink);
  border-color: var(--ha-ink);
  color: var(--ha-paper);
}
.amp-chat-message-voice .amp-chat-speaker {
  color: var(--ha-ink-soft);
  font-size: 10.5px;
}
@keyframes amp-chat-talk-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ha-bloom) 45%, transparent); }
  50% { box-shadow: 0 0 0 6px transparent; }
}
.amp-chat-privacy-note {
  margin: 6px 4px 0;
  color: var(--ha-ink-soft);
  font-size: 10.5px;
  line-height: 1.35;
}
.amp-chat-privacy-note[hidden] {
  display: none;
}
.amp-chat-privacy-note a {
  color: inherit;
  text-underline-offset: 2px;
}
.amp-chat-notice {
  padding: 10px 12px;
  margin: 6px 0 0;
  border: 1px solid var(--ha-hairline);
  background: var(--ha-paper);
  color: var(--ha-ink);
  font-size: 12px;
  line-height: 1.5;
  border-radius: 12px;
}
.amp-chat-notice[hidden] {
  display: none;
}
.amp-chat-notice a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-weight: 650;
  color: var(--ha-bloom-deep);
}
.amp-chat-thinking {
  flex: none;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--amp-glass);
  padding: 12px 16px;
  border-radius: 18px;
  margin: 0 0 15px;
}
.amp-chat-thinking-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}
.amp-chat-thinking-wave i {
  width: 3px;
  height: 10px;
  border-radius: 2px;
  background: var(--ha-ink);
  animation: amp-level 0.8s ease-in-out infinite;
}
.amp-chat-thinking-wave i:nth-child(even) {
  animation-delay: -0.4s;
  height: 16px;
}
.amp-chat-attachment-preview {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 8px;
}
.amp-chat-attachment-preview:empty {
  display: none;
}
.amp-chat-attachment-chip {
  position: relative;
  flex: 0 0 100px;
  padding: 8px;
  background: var(--ha-paper);
  border-radius: 12px;
  min-height: 64px;
}
.amp-chat-attachment-chip img {
  width: 84px;
  height: 55px;
  object-fit: cover;
}
.amp-chat-attachment-chip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.amp-chat-remove-file {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 44px;
  min-height: 44px;
  background: var(--ha-paper);
  border: 1px solid var(--ha-hairline);
  border-radius: 50%;
  font-size: 23px;
  color: var(--ha-ink);
}
.amp-chat-files {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.amp-chat-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 9px;
  background: var(--ha-paper);
  max-width: 100%;
}
.amp-chat-file img {
  width: 36px;
  height: 36px;
  object-fit: cover;
}
.amp-chat-file-icon {
  font-size: 10px;
  font-weight: 750;
}
.amp-chat-file span {
  min-width: 0;
}
.amp-chat-file strong,
.amp-chat-file small {
  display: block;
  overflow-wrap: anywhere;
  font-size: 11px;
}
.amp-chat-file small {
  font-size: 10px;
  color: var(--ha-ink-soft);
}
.amp-chat-handover,
.amp-chat-confirm {
  flex: none;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--amp-edge);
  border-radius: 20px;
  background: var(--ha-paper);
  pointer-events: auto;
}
.amp-chat-handover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 12px;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.amp-chat-handover h3,
.amp-chat-confirm h3 {
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 12px;
}
.amp-chat-handover h3,
.amp-chat-handover-summary,
.amp-chat-handover-privacy,
.amp-chat-handover-actions,
.amp-chat-handover-contact,
.amp-chat-handover-preference,
.amp-chat-handover-summary-fold,
.amp-chat-handover-files {
  grid-column: 1 / -1;
}
/* The note's paperclip: same chip row as the composer's, a touch of space
   either side of it. */
.amp-chat-handover-files {
  display: grid;
  gap: 8px;
}
.amp-chat-handover-files .amp-chat-attachment-preview {
  margin-bottom: 0;
}
.amp-chat-handover-files .amp-chat-notice {
  margin: 0;
}
.amp-chat-handover-files .amp-chat-privacy-note {
  margin: 0;
}
.amp-chat-handover label {
  display: grid;
  gap: 6px;
  margin-top: 0;
  font-size: 13px;
  color: var(--ha-ink);
}
.amp-chat-handover label[hidden] {
  display: none;
}
.amp-chat-handover input,
.amp-chat-handover textarea,
.amp-chat-handover select {
  max-width: 100%;
  width: 100%;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--ha-ink-soft);
  background: var(--ha-white);
  border-radius: 8px;
  color: var(--ha-ink);
  font:
    16px/1.4 Manrope,
    sans-serif;
}
.amp-chat-handover-privacy {
  margin: 14px 0 0;
  color: var(--ha-ink-soft);
  font-size: 12px;
  line-height: 1.45;
}
/* The call note: contact details first, large and legible, because those are
   what the visitor must check before anything sends. */
.amp-chat-handover-contact {
  display: grid;
  gap: 10px;
}
.amp-chat-handover-contact-field input {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ha-ink);
  background: var(--ha-paper);
  border-color: var(--ha-ink);
}
/* A field just pencilled in live, unedited by the visitor, pulses once so
   they notice it without the form redrawing under them. */
@keyframes amp-chat-field-flash {
  0% {
    box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--ha-bloom) 30%, transparent);
  }
  100% {
    box-shadow: inset 0 0 0 999px transparent;
  }
}
.amp-chat-handover input.amp-chat-field-flash {
  animation: amp-chat-field-flash 600ms ease;
}
/* The summary is secondary on a call: hidden by default behind the "See the
   message" button, the same editable textarea once opened, expanding in its
   own spot rather than jumping to wherever the button sits. */
.amp-chat-handover-summary-fold[hidden] {
  display: none;
}
.amp-chat-handover .amp-chat-check {
  display: flex;
  align-items: center;
  min-height: 44px;
}
.amp-chat-check input {
  min-height: 24px;
  width: 24px;
  height: 24px;
  accent-color: var(--ha-bloom-deep);
}
.amp-chat-handover-actions,
.amp-chat-confirm div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
/* The live strip takes a slice of the panel during a call, so the form gives a
   little back rather than pushing Continue out of sight. */
.amp-chat-shell:has(.amp-chat-live:not([hidden])) .amp-chat-handover {
  padding: 14px 16px;
  gap: 8px 12px;
}
.amp-chat-shell:has(.amp-chat-live:not([hidden])) .amp-chat-handover h3 {
  margin-bottom: 6px;
}
.amp-chat-shell:has(.amp-chat-live:not([hidden])) .amp-chat-handover-actions {
  margin-top: 10px;
}
.amp-chat-handover-offer {
  display: flex;
  justify-content: flex-start;
  margin: 12px 0 4px;
  pointer-events: auto;
}
.amp-chat-handover-is-open .amp-chat-thread,
.amp-chat-confirm-is-open .amp-chat-thread {
  padding: 12px;
  mask-image: none;
}
/* During a call the question is longer and the live strip takes room, so the
   composer folds away and leaves the panel to it. Mute and Stop stay. */
.amp-chat-confirm-is-open:has(.amp-chat-live:not([hidden])) .amp-chat-composer {
  padding: 8px 12px;
}
.amp-chat-confirm-is-open:has(.amp-chat-live:not([hidden]))
  .amp-chat-composer
  > *:not(.amp-chat-live) {
  display: none;
}
.amp-chat-confirm-is-open .amp-chat-live {
  margin: 0;
}
/* The form takes the panel and the composer folds away with it, the pencilled-in
   details card included. During a call the live strip stays, so Mute and Stop
   are never out of reach while the visitor fills the form in. */
.amp-chat-handover-is-open .amp-chat-composer {
  display: none;
}
.amp-chat-handover-is-open .amp-chat-composer:has(.amp-chat-live:not([hidden])) {
  display: block;
  padding: 8px 12px;
}
.amp-chat-handover-is-open .amp-chat-composer > *:not(.amp-chat-live) {
  display: none;
}
.amp-chat-handover-is-open .amp-chat-live {
  margin: 0;
}
.amp-chat-button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--ha-ink);
  border-radius: 8px;
  background: var(--ha-ink);
  color: var(--ha-paper);
  font:
    600 13px/1.4 Manrope,
    sans-serif;
  cursor: pointer;
}
.amp-chat-button-secondary {
  background: transparent;
  color: var(--ha-ink);
}
/* Move the panel by its header. Desktop only: the phone layout pins it. */
@media (min-width: 761px) {
  .amp-chat-header {
    cursor: grab;
    touch-action: none;
  }
  .amp-chat-shell.is-dragging .amp-chat-header {
    cursor: grabbing;
  }
  .amp-chat-shell.is-dragging .amp-chat-panel {
    animation: none;
    transition: none;
  }
  .amp-chat-dragging,
  .amp-chat-dragging body {
    user-select: none;
  }
}
.amp-chat-shell :focus-visible {
  outline: 3px solid var(--ha-bloom-deep);
  outline-offset: 2px;
}
.goose-dialog .amp-chat-shell {
  position: fixed;
  right: 20px;
  top: 20px;
  bottom: 20px;
  width: min(470px, calc(100vw - 40px));
  z-index: 80;
}
.goose-dialog:has(.amp-chat-shell:not([hidden])) > .goose-ask-amp {
  visibility: hidden;
}
.goose-dialog > .goose-ask-amp {
  position: absolute;
  left: auto;
  right: 35px;
  top: 20px;
}
.goose-dialog[open] .ask-amp[data-amp-character] {
  position: fixed;
}
@keyframes amp-steps {
  0%,
  100% {
    transform: rotate(-3deg) translateY(0);
  }
  50% {
    transform: rotate(3deg) translateY(-3px);
  }
}
@keyframes amp-level {
  0%,
  100% {
    transform: scaleY(0.5);
  }
  50% {
    transform: scaleY(1);
  }
}
@keyframes amp-chat-open {
  0% {
    opacity: 0.25;
    transform: none;
    clip-path: inset(72% 0 0 0 round 22px);
  }
  58% {
    opacity: 1;
    transform: none;
    clip-path: inset(18% 0 0 0 round 22px);
  }
  100% {
    opacity: 1;
    transform: none;
    clip-path: inset(0 round 22px);
  }
}
@media (max-width: 760px) {
  .amp-chat-is-open body {
    position: fixed;
    top: var(--amp-page-scroll, 0);
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
  }
  .amp-chat-is-open .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }
  .amp-chat-shell,
  .goose-dialog .amp-chat-shell {
    left: 8px;
    right: 8px;
    top: calc(var(--ha-header-height, 70px) + 8px);
    bottom: 8px;
    width: auto;
    max-height: none;
    border-radius: 24px;
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--ha-ink) 96%, transparent),
      color-mix(in srgb, var(--ha-ink-raised) 94%, transparent)
    );
    backdrop-filter: blur(26px) saturate(0.9);
    padding: 8px 8px max(6px, env(safe-area-inset-bottom));
    pointer-events: auto;
  }
  .amp-chat-panel {
    height: 100%;
    border-radius: 18px;
  }
  /* The phone layout pins the panel to the viewport: there is no size to change. */
  .amp-chat-expand,
  .amp-chat-resize {
    display: none;
  }
  .amp-chat-header {
    padding-left: 12px;
  }
  .amp-chat-thread {
    padding: 12px 3px 8px;
    mask-image: linear-gradient(transparent, black 18px, black);
  }
  .amp-chat-message {
    font-size: 16px;
    padding: 10px 13px 8px;
    max-width: 88%;
    margin-bottom: 10px;
  }
  .amp-chat-composer {
    padding-left: 68px;
  }
  .amp-chat-anchor {
    left: 8px;
    width: 56px;
    height: 56px;
    bottom: 3px;
  }
  .amp-chat-compose-row {
    padding: 5px 3px;
    gap: 0;
  }
  .amp-chat-input {
    padding: 11px 0;
    font-size: 16px;
  }
  .amp-chat-attach,
  .amp-chat-send {
    min-width: 44px;
    width: 44px;
  }
  .amp-chat-notice {
    margin-left: 0;
  }
  .amp-chat-composer:has(.amp-chat-notice:not([hidden])) .amp-chat-anchor {
    bottom: auto;
    top: 0;
  }
  .amp-chat-handover {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
  .amp-chat-handover h3,
  .amp-chat-handover-summary,
  .amp-chat-handover-privacy,
  .amp-chat-handover-actions {
    grid-column: auto;
  }
  .amp-chat-handover-contact-field input {
    font-size: 17px;
  }
  .amp-chat-details {
    max-height: 150px;
  }
  .amp-chat-identity {
    font-size: 12px;
  }
  body .ask-amp {
    width: 64px;
    height: 64px;
  }
}
@media (max-width: 360px) {
  .amp-chat-composer {
    padding-left: 0;
    padding-top: 48px;
  }
  .amp-chat-anchor {
    left: 0;
    top: 0;
    bottom: auto;
    width: 44px;
    height: 44px;
  }
  .amp-chat-notice {
    margin-left: 0;
  }
  .amp-chat-message {
    max-width: 96%;
  }
  .amp-chat-composer:has(.amp-chat-notice:not([hidden])) .amp-chat-anchor {
    top: 0;
  }
  /* Three buttons do not fit one row this narrow: "See the message" takes its
     own row above Send and Keep chatting rather than wrapping after them. */
  .amp-chat-handover-actions [data-amp-see-message] {
    order: -1;
    flex: 1 1 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ask-amp.is-walking:before,
  .amp-chat-thinking-wave i,
  .amp-chat-talk.is-live,
  .amp-chat-live-dot,
  .amp-chat-talk-hint,
  .amp-chat-handover input.amp-chat-field-flash {
    animation: none;
  }
  .amp-chat-shell:not([hidden]) .amp-chat-panel {
    animation: none;
  }
  .amp-chat-thread {
    scroll-behavior: auto;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .amp-chat-shell,
  .amp-chat-message,
  .amp-chat-compose-row,
  .amp-chat-header {
    background: var(--ha-paper);
    backdrop-filter: none;
  }
}
@supports not (backdrop-filter: blur(1px)) {
  .amp-chat-message,
  .amp-chat-compose-row,
  .amp-chat-header {
    background: var(--ha-paper);
  }
}

@media (max-width: 760px) {
  .amp-chat-is-open body > main,
  .amp-chat-is-open body > .ha-footer {
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
  }
  .amp-chat-is-open body > main {
    transition: filter 180ms ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  .amp-chat-is-open body > main {
    transition: none;
  }
}
.amp-chat-composer:has(.amp-chat-notice:not([hidden])) .amp-chat-anchor {
  bottom: auto;
  top: 0;
}
.amp-chat-message-amp .amp-chat-speaker:before {
  width: 34px;
  height: 34px;
  background-image: url('/brand/assets/amp-face.svg?v=2');
}

/* Read the conversation without repeated identity rows or a timestamp on every bubble. */
.amp-chat-message { margin: 14px 0 0; padding: 10px 14px; box-shadow: none; }
.amp-chat-message:first-child { margin-top: 0; }
.amp-chat-message-continuation { margin-top: 4px; }
.amp-chat-message-amp .amp-chat-speaker::before { content: none; }
.amp-chat-message-meta { margin-top: 3px; font-size: 10px; line-height: 1.3; }
