:root {
  --al-ai-navy: #071120;
  --al-ai-ink: #0b1424;
  --al-ai-muted: #5d6b82;
  --al-ai-red: #ec1b2e;
  --al-ai-red-dark: #cf1324;
  --al-ai-line: #dbe3ef;
  --al-ai-panel: #f6f8fb;
  --al-ai-white: #ffffff;
  --al-ai-shadow: 0 22px 70px rgba(7, 17, 32, .22);
}

.al-ai-chat {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 2147482000;
  font-family: var(--font-ui, Arial, Helvetica, sans-serif);
  color: var(--al-ai-ink);
}

.has-cookie-consent .al-ai-chat {
  bottom: 196px;
}

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

.al-ai-chat__button {
  width: 92px;
  height: 66px;
  border: 0;
  border-radius: 10px;
  background: var(--al-ai-navy);
  color: var(--al-ai-white);
  box-shadow: var(--al-ai-shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 0;
  font-weight: 900;
}

.al-ai-chat__button span {
  color: #ffb21d;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
}

.al-ai-chat__button strong {
  font-size: 16px;
  line-height: 1.1;
}

.al-ai-chat__button:focus-visible,
.al-ai-chat__close:focus-visible,
.al-ai-chat__chips button:focus-visible,
.al-ai-chat__form textarea:focus-visible,
.al-ai-chat__send:focus-visible {
  outline: 3px solid rgba(29, 78, 216, .72);
  outline-offset: 3px;
}

.al-ai-chat__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(620px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 130px));
  background: var(--al-ai-white);
  border: 1px solid var(--al-ai-line);
  border-radius: 10px;
  box-shadow: var(--al-ai-shadow);
  overflow: hidden;
}

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

.al-ai-chat__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--al-ai-navy);
  color: var(--al-ai-white);
}

.al-ai-chat__header strong,
.al-ai-chat__header span {
  display: block;
}

.al-ai-chat__header span {
  margin-top: 2px;
  color: #c8d3e3;
  font-size: 12px;
  font-weight: 700;
}

.al-ai-chat__close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: transparent;
  color: var(--al-ai-white);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.al-ai-chat__messages {
  max-height: 430px;
  overflow: auto;
  padding: 16px;
  display: grid;
  gap: 10px;
  background: var(--al-ai-panel);
}

.al-ai-chat__msg {
  max-width: 86%;
  margin: 0;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-line;
}

.al-ai-chat__msg--bot {
  justify-self: start;
  background: var(--al-ai-white);
  border: 1px solid var(--al-ai-line);
  color: var(--al-ai-ink);
}

.al-ai-chat__msg--user {
  justify-self: end;
  background: var(--al-ai-red);
  color: var(--al-ai-white);
}

.al-ai-chat__msg--status {
  justify-self: start;
  color: var(--al-ai-muted);
  background: transparent;
  border: 0;
  padding: 0 2px;
  font-size: 13px;
}

.al-ai-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 0;
  background: var(--al-ai-white);
}

.al-ai-chat__chips button {
  border: 1px solid var(--al-ai-line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--al-ai-white);
  color: var(--al-ai-ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.al-ai-chat__form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--al-ai-line);
  background: var(--al-ai-white);
}

.al-ai-chat__form textarea {
  width: 100%;
  min-height: 92px;
  max-height: 190px;
  resize: vertical;
  border: 1px solid var(--al-ai-line);
  border-radius: 8px;
  padding: 12px 13px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--al-ai-ink);
  background: var(--al-ai-white);
}

.al-ai-chat__send {
  min-height: 92px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  background: var(--al-ai-red);
  color: var(--al-ai-white);
  cursor: pointer;
  font-weight: 900;
  font-size: 15px;
}

.al-ai-chat__send:disabled {
  cursor: wait;
  background: var(--al-ai-red-dark);
  opacity: .8;
}

.al-ai-chat__foot {
  padding: 0 14px 14px;
  color: var(--al-ai-muted);
  font-size: 11px;
  line-height: 1.35;
  background: var(--al-ai-white);
}

@media (max-width: 700px) {
  body:not([data-page="residential"]) .al-ai-chat.al-ai-chat--footer-visible {
    pointer-events: none;
  }

  body:not([data-page="residential"]) .al-ai-chat.al-ai-chat--footer-visible .al-ai-chat__button[aria-expanded="true"],
  body:not([data-page="residential"]) .al-ai-chat.al-ai-chat--footer-visible .al-ai-chat__panel:not([hidden]) {
    pointer-events: auto;
  }

  body:not([data-page="residential"]) .al-ai-chat.al-ai-chat--footer-visible .al-ai-chat__button[aria-expanded="false"] {
    visibility: hidden;
    pointer-events: none;
  }

  .al-ai-chat {
    right: 12px;
    bottom: 78px;
  }

  .has-cookie-consent .al-ai-chat {
    bottom: 228px;
  }

  .al-ai-chat__button {
    width: 82px;
    height: 60px;
  }

  .al-ai-chat__button span {
    display: none;
  }

  .al-ai-chat__panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 122px;
    width: auto;
    max-height: calc(100vh - 144px);
  }

  .has-cookie-consent .al-ai-chat__panel {
    bottom: 292px;
    max-height: calc(100vh - 316px);
  }

  .al-ai-chat__messages {
    max-height: 46vh;
  }

  .al-ai-chat__form {
    grid-template-columns: 1fr;
  }

  .al-ai-chat__form textarea {
    min-height: 104px;
  }

  .al-ai-chat__send {
    min-height: 48px;
    width: 100%;
  }
}

/* Global safety cleanup: hide only review widgets marked broken by JS. */
.is-broken-review-widget {
  display: none !important;
}

/* 20261103-chat-service-layout-1: keep controls visible as messages grow. */
body:not([data-page="residential"]) .al-ai-chat__panel:not([hidden]) {
  display: flex;
  flex-direction: column;
}
body:not([data-page="residential"]) .al-ai-chat__messages {
  min-height: 0;
  flex: 1 1 auto;
}
body:not([data-page="residential"]) .al-ai-chat__header,
body:not([data-page="residential"]) .al-ai-chat__chips,
body:not([data-page="residential"]) .al-ai-chat__form,
body:not([data-page="residential"]) .al-ai-chat__foot {
  flex-shrink: 0;
}
@media (max-width: 700px) {
  body:not([data-page="residential"]) .al-ai-chat__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
  }
  body:not([data-page="residential"]) .al-ai-chat__chips button {
    flex: 0 0 auto;
  }
}

body:not([data-page="residential"]) .al-ai-chat__foot a {
  color: var(--al-ai-red);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 20261103-ai-development-1 */
body .al-ai-chat__panel--development:not([hidden]) {
  width: min(360px, calc(100vw - 36px));
  min-height: 160px;
  padding: 40px 24px;
  align-items: center;
  justify-content: center;
}
body .al-ai-chat__panel--development .al-ai-chat__close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--al-ai-ink);
  border-color: var(--al-ai-line);
}
.al-ai-chat__development-message {
  margin: 0;
  color: var(--al-ai-ink);
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}
@media (max-width: 700px) {
  body .al-ai-chat__panel--development:not([hidden]) { width: auto; }
}
