/**
 * TuCasa Concierge — canonical approved visual shell.
 *
 * This file is self-contained and replaces the Core fallback stylesheet on
 * Clean. It changes no dialogue, persistence, search result, endpoint, route
 * or accessibility hook.
 */

.tucasa-concierge {
  --tc-concierge-blue: var(--tc-color-accent, #248fd0);
  --tc-concierge-blue-deep: color-mix(in srgb, var(--tc-color-accent, #248fd0) 78%, var(--tc-color-ink));
  --tc-concierge-ink: var(--tc-color-ink, #0f172a);
  --tc-concierge-muted: var(--tc-color-muted, #64748b);
  --tc-concierge-line: var(--tc-color-border, #e2e8f0);
  --tc-concierge-soft: var(--tc-color-surface-soft, #f8fafc);
  --tc-concierge-shadow: 0 20px 55px rgb(28 55 90 / 18%);
  position: fixed;
  right: 26px;
  bottom: 24px;
  z-index: 2147482000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  color: var(--tc-concierge-ink);
  font-family: var(--tc-font-interface);
}

.tucasa-concierge-cookie-blocked {
  visibility: hidden;
  pointer-events: none;
}

.tucasa-concierge .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tucasa-concierge .tucasa-concierge-launcher {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: var(--tc-radius-pill);
  background: rgb(255 255 255 / 96%);
  color: #233147;
  box-shadow: 0 12px 36px rgb(26 57 91 / 20%);
  font-size: var(--tc-type-small);
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform var(--tc-motion-fast) ease, box-shadow var(--tc-motion-fast) ease;
}

.tucasa-concierge .tucasa-concierge-launcher:hover {
  background: rgb(255 255 255 / 98%);
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgb(26 57 91 / 24%);
}

.tucasa-concierge .tucasa-concierge-launcher:active {
  transform: translateY(0) scale(0.98);
}

.tucasa-concierge .tucasa-concierge-launcher-avatar,
.tucasa-concierge .tucasa-concierge-avatar,
.tucasa-concierge .tucasa-concierge-message-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  color: transparent;
  background-color: var(--tc-color-surface);
  background-image: url("../../images/brand/favicon/tucasa-logo-favicon-57x57.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 72%;
  border: 1px solid #e3ebf3;
  box-shadow: 0 6px 18px rgb(28 75 110 / 10%);
}

.tucasa-concierge .tucasa-concierge-launcher-avatar {
  width: 37px;
  height: 37px;
  border-radius: 13px;
  background-color: #f8fbfe;
  background-size: 29px;
}

.tucasa-concierge .tucasa-concierge-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  display: grid;
  grid-template-rows: auto auto minmax(170px, 1fr) auto auto;
  width: min(352px, calc(100vw - 32px));
  height: min(532px, calc(100dvh - 165px));
  overflow: hidden;
  border: 1px solid rgb(214 224 235 / 95%);
  border-radius: 22px;
  background: rgb(255 255 255 / 98%);
  box-shadow: var(--tc-concierge-shadow);
  transform-origin: bottom right;
  animation: tucasa-clean-concierge-open 220ms ease both;
}

.tucasa-concierge .tucasa-concierge-panel[hidden],
.tucasa-concierge .tucasa-concierge-thinking[hidden],
.tucasa-concierge .tucasa-concierge-privacy-popover[hidden] {
  display: none;
}

.tucasa-concierge .tucasa-concierge-panel > header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 15px;
  background: linear-gradient(180deg, var(--tc-color-surface), #fbfdff);
  color: var(--tc-concierge-ink);
  border-bottom: 1px solid var(--tc-concierge-line);
}

.tucasa-concierge .tucasa-concierge-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.tucasa-concierge .tucasa-concierge-avatar {
  width: 43px;
  height: 43px;
  flex-basis: 43px;
  border-radius: 14px;
  background-size: 33px;
}

.tucasa-concierge .tucasa-concierge-panel h2 {
  margin: 0;
  color: var(--tc-concierge-ink);
  font-family: var(--tc-font-interface);
  font-size: var(--tc-type-body);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.tucasa-concierge .tucasa-concierge-identity p {
  position: relative;
  max-width: 265px;
  margin: 3px 0 0;
  padding-left: 14px;
  color: var(--tc-concierge-muted);
  font-size: var(--tc-type-micro);
  line-height: 1.35;
}

.tucasa-concierge .tucasa-concierge-identity p::before {
  position: absolute;
  top: 0.42em;
  left: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28b26b;
  box-shadow: 0 0 0 3px rgb(40 178 107 / 13%);
  content: "";
}

.tucasa-concierge .tucasa-concierge-panel > header > button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #536174;
  cursor: pointer;
  transition: background var(--tc-motion-fast) ease, color var(--tc-motion-fast) ease, transform var(--tc-motion-fast) ease;
}

.tucasa-concierge .tucasa-concierge-minimize svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tucasa-concierge .tucasa-concierge-panel > header > button:hover {
  background: #f0f4f8;
  color: var(--tc-concierge-blue-deep);
}

.tucasa-concierge .tucasa-concierge-panel > header > button:active {
  transform: scale(0.96);
}

.tucasa-concierge .tucasa-concierge-toolbar {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--tc-concierge-line);
  background: #fbfcfe;
}

.tucasa-concierge .tucasa-concierge-toolbar > [data-concierge-reset] {
  min-height: 30px;
  padding: 3px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667489;
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  cursor: pointer;
}

.tucasa-concierge .tucasa-concierge-toolbar > [data-concierge-reset]:hover {
  color: var(--tc-concierge-blue-deep);
  text-decoration-color: currentColor;
}


.tucasa-concierge .tucasa-concierge-messages {
  overflow-y: auto;
  padding: 16px 14px 18px;
  background:
    linear-gradient(rgb(248 250 253 / 96%), rgb(248 250 253 / 96%)),
    radial-gradient(circle at 20% 15%, rgb(36 143 208 / 8%), transparent 26%);
  scroll-behavior: smooth;
  scrollbar-color: #cad5e1 transparent;
  scrollbar-width: thin;
}

.tucasa-concierge .tucasa-concierge-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 12px;
}

.tucasa-concierge .tucasa-concierge-message.is-user {
  justify-content: flex-end;
}

.tucasa-concierge .tucasa-concierge-message-content {
  display: grid;
  gap: 8px;
  max-width: 79%;
}

.tucasa-concierge .tucasa-concierge-message-avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  margin-top: 0;
  border-radius: 9px;
  background-size: 21px;
  box-shadow: 0 4px 12px rgb(32 57 85 / 8%);
}

.tucasa-concierge .tucasa-concierge-bubble {
  padding: 10px 12px;
  border: 1px solid #e4ebf3;
  border-radius: 16px 16px 16px 6px;
  background: var(--tc-color-surface);
  color: #314055;
  box-shadow: 0 5px 16px rgb(43 70 98 / 6%);
  font-size: var(--tc-type-small);
  line-height: 1.5;
  white-space: pre-wrap;
}

.tucasa-concierge .tucasa-concierge-message.is-user .tucasa-concierge-bubble {
  border-color: transparent;
  border-radius: 16px 16px 6px;
  background: linear-gradient(135deg, var(--tc-concierge-blue), var(--tc-concierge-blue-deep));
  color: var(--tc-color-surface);
  box-shadow: 0 5px 16px rgb(29 127 190 / 12%);
}

.tucasa-concierge .tucasa-concierge-action {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 13px;
  background: #132f4c;
  color: var(--tc-color-surface);
  box-shadow: 0 7px 18px rgb(19 47 76 / 12%);
  font-size: var(--tc-type-small);
  font-weight: 800;
  text-decoration: none;
  transition: transform var(--tc-motion-fast) ease, background var(--tc-motion-fast) ease, box-shadow var(--tc-motion-fast) ease;
}

.tucasa-concierge .tucasa-concierge-action:hover {
  background: #1a3d60;
  color: var(--tc-color-surface);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgb(19 47 76 / 18%);
}

.tucasa-concierge .tucasa-concierge-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tucasa-concierge .tucasa-concierge-suggestions button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #d8e5ef;
  border-radius: var(--tc-radius-pill);
  background: var(--tc-color-surface);
  color: var(--tc-concierge-blue-deep);
  font-size: var(--tc-type-micro);
  font-weight: 750;
  cursor: pointer;
}

.tucasa-concierge .tucasa-concierge-suggestions button:hover {
  background: #f0f7fb;
}

.tucasa-concierge .tucasa-concierge-thinking {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  background: #f8fafc;
  color: #667489;
}

.tucasa-concierge .tucasa-concierge-thinking span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tc-concierge-blue);
  animation: tucasa-clean-concierge-dot 1s infinite ease-in-out;
}

.tucasa-concierge .tucasa-concierge-thinking span:nth-child(2) {
  animation-delay: 140ms;
}

.tucasa-concierge .tucasa-concierge-thinking span:nth-child(3) {
  animation-delay: 280ms;
}

.tucasa-concierge .tucasa-concierge-thinking em {
  margin-left: 5px;
  font-size: var(--tc-type-micro);
  font-style: normal;
}

.tucasa-concierge .tucasa-concierge-composer {
  padding: 11px 12px 10px;
  border-top: 1px solid var(--tc-concierge-line);
  background: var(--tc-color-surface);
}

.tucasa-concierge .tucasa-concierge-composer form {
  display: flex;
  min-height: 47px;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border: 1px solid #dbe4ee;
  border-radius: 16px;
  background: #fbfcfe;
  transition: border-color var(--tc-motion-fast) ease, box-shadow var(--tc-motion-fast) ease, background var(--tc-motion-fast) ease;
}

.tucasa-concierge .tucasa-concierge-composer form:focus-within {
  border-color: color-mix(in srgb, var(--tc-concierge-blue) 55%, transparent);
  background: var(--tc-color-surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc-concierge-blue) 9%, transparent);
}

.tucasa-concierge .tucasa-concierge-panel textarea {
  width: 100%;
  min-height: 33px;
  max-height: 92px;
  flex: 1;
  box-sizing: border-box;
  resize: none;
  padding: 6px 0 4px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--tc-concierge-ink);
  font: inherit;
  font-size: var(--tc-type-small);
  line-height: 1.35;
}

.tucasa-concierge .tucasa-concierge-panel textarea::placeholder {
  color: #9aa6b5;
}

/*
 * The accessible button text remains in the markup. The visible paper-plane
 * is a single centered SVG background, avoiding the misaligned two-piece CSS
 * arrow that could protrude on some mobile renderers.
 */
.tucasa-concierge .tucasa-concierge-composer form button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  flex: 0 0 34px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 11px;
  appearance: none;
  background-color: #248fd0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.4 20.4 21.85 12 3.4 3.6 3 10.13 16.18 12 3 13.87z'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #248fd0, #1779ba);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 17px 17px, 100% 100%;
  color: transparent;
  box-shadow: 0 7px 18px rgb(29 127 190 / 22%);
  font-size: 0;
  line-height: 0;
  text-indent: -9999px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--tc-motion-fast) ease, box-shadow var(--tc-motion-fast) ease, filter var(--tc-motion-fast) ease;
}

.tucasa-concierge .tucasa-concierge-composer form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgb(29 127 190 / 28%);
  filter: saturate(1.04);
}

.tucasa-concierge .tucasa-concierge-composer form button:active {
  transform: translateY(0) scale(0.97);
}

.tucasa-concierge .tucasa-concierge-composer form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.tucasa-concierge .tucasa-concierge-privacy {
  position: relative;
  margin: 8px 2px 0;
}

.tucasa-concierge .tucasa-concierge-privacy-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8995a5;
  font-size: var(--tc-type-micro);
  text-decoration: none;
  cursor: pointer;
}

.tucasa-concierge .tucasa-concierge-privacy-trigger:hover {
  color: var(--tc-concierge-blue-deep);
}

.tucasa-concierge .tucasa-concierge-info-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.tucasa-concierge .tucasa-concierge-privacy-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 4;
  width: min(315px, calc(100vw - 56px));
  box-sizing: border-box;
  padding: 14px 34px 14px 15px;
  border: 1px solid var(--tc-concierge-line);
  border-radius: 15px;
  background: var(--tc-color-surface);
  color: var(--tc-concierge-muted);
  box-shadow: 0 15px 42px rgb(32 57 85 / 16%);
  font-size: var(--tc-type-micro);
  line-height: 1.55;
}

.tucasa-concierge .tucasa-concierge-privacy-popover strong {
  display: block;
  margin-bottom: 5px;
  color: var(--tc-concierge-ink);
}

.tucasa-concierge .tucasa-concierge-privacy-popover p {
  margin: 0 0 8px;
}

.tucasa-concierge .tucasa-concierge-privacy-popover a {
  color: var(--tc-concierge-blue-deep);
  font-weight: 800;
  text-underline-offset: 2px;
}

.tucasa-concierge .tucasa-concierge-privacy-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #f0f4f8;
  color: #536174;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.tucasa-concierge .tucasa-concierge-launcher:focus-visible,
.tucasa-concierge .tucasa-concierge-panel button:focus-visible,
.tucasa-concierge .tucasa-concierge-panel textarea:focus-visible,
.tucasa-concierge .tucasa-concierge-panel a:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
}

@keyframes tucasa-clean-concierge-open {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tucasa-clean-concierge-dot {
  0%, 60%, 100% {
    opacity: 0.45;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tucasa-concierge *,
  .tucasa-concierge .tucasa-concierge-panel {
    scroll-behavior: auto;
    animation: none;
  }
}


@media (min-width: 761px) {
  .tucasa-concierge.is-desktop-positioned {
    bottom: auto;
  }

  .tucasa-concierge.is-edge-left {
    align-items: flex-start;
  }

  .tucasa-concierge.is-edge-right {
    align-items: flex-end;
  }

  .tucasa-concierge.is-desktop-positioned .tucasa-concierge-launcher {
    touch-action: none;
    user-select: none;
    cursor: grab;
  }

  .tucasa-concierge.is-dragging .tucasa-concierge-launcher {
    cursor: grabbing;
  }

  .tucasa-concierge.is-desktop-positioned .tucasa-concierge-panel {
    position: absolute;
    top: auto;
    bottom: 62px;
  }

  .tucasa-concierge.is-edge-left .tucasa-concierge-panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
  }

  .tucasa-concierge.is-edge-right .tucasa-concierge-panel {
    right: 0;
    left: auto;
    transform-origin: bottom right;
  }
}

@media (max-width: 760px) {
  body.tc-drawer-open .tucasa-concierge,
  body.tc-search-open .tucasa-concierge {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .tucasa-concierge {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: auto;
    gap: 0;
    transition: opacity 140ms ease, visibility 140ms ease;
  }

  .tucasa-concierge .tucasa-concierge-launcher {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    position: relative;
    justify-content: center;
    gap: 0;
    padding: 3px;
    overflow: visible;
    border-radius: 15px;
    transition: transform var(--tc-motion-fast) ease, box-shadow var(--tc-motion-fast) ease;
  }

  .tucasa-concierge .tucasa-concierge-launcher-avatar {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 12px;
    background-size: 28px;
  }

  .tucasa-concierge .tucasa-concierge-launcher [data-concierge-open-label] {
    display: none;
    white-space: nowrap;
  }

  .tucasa-concierge.is-mobile-hint .tucasa-concierge-launcher [data-concierge-open-label] {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: block;
    width: max-content;
    max-width: calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right));
    padding: 8px 12px;
    border: 1px solid var(--tc-concierge-line);
    border-radius: var(--tc-radius-pill);
    background: rgb(255 255 255 / 98%);
    color: #233147;
    box-shadow: 0 10px 28px rgb(26 57 91 / 18%);
    animation: tucasa-clean-concierge-hint 180ms ease both;
  }

  .tucasa-concierge .tucasa-concierge-message-content {
    max-width: 84%;
  }

  .tucasa-concierge .tucasa-concierge-panel {
    position: fixed;
    top: max(7dvh, calc(env(safe-area-inset-top) + 8px));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(60px, calc(env(safe-area-inset-bottom) + 56px));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 20px;
    transform-origin: center bottom;
    animation-name: tucasa-clean-concierge-open-mobile;
  }
}


@keyframes tucasa-clean-concierge-hint {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tucasa-clean-concierge-open-mobile {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 420px) {
  .tucasa-concierge .tucasa-concierge-identity p {
    max-width: 210px;
    font-size: var(--tc-type-micro);
  }

  .tucasa-concierge .tucasa-concierge-panel {
    top: max(6dvh, calc(env(safe-area-inset-top) + 6px));
    right: max(6px, env(safe-area-inset-right));
    bottom: max(58px, calc(env(safe-area-inset-bottom) + 54px));
    left: max(6px, env(safe-area-inset-left));
    height: auto;
    max-height: none;
  }
}
