:root {
  --ta-navy: #0d2c41;
  --ta-blue: #1d476e;
  --ta-yellow: #f2c94c;
  --ta-text: #183244;
  --ta-muted: #6e7f8a;
  --ta-line: #dfe7ec;
  --ta-bg: #f4f7f9;
  --ta-white: #fff;
}

.turismo-assistente,
.turismo-assistente * { box-sizing: border-box; }

.turismo-assistente {
  font-family: Raleway, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ta-text);
  line-height: 1.45;
}

.turismo-assistente--floating {
  position: fixed;
  z-index: 2147483000;
  bottom: 20px;
}
.turismo-assistente--right { right: 20px; }
.turismo-assistente--left { left: 20px; }

.turismo-assistente__launcher {
  border: 0;
  border-radius: 999px;
  min-height: 54px;
  padding: 8px 18px 8px 9px;
  background: var(--ta-navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 35px rgba(13,44,65,.23);
  transition: transform .18s ease, box-shadow .18s ease;
}
.turismo-assistente__launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(13,44,65,.28); }
.turismo-assistente__launcher-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ta-yellow); color: var(--ta-navy);
}
.turismo-assistente__launcher-icon svg { width: 22px; height: 22px; fill: currentColor; }

.turismo-assistente__panel {
  width: min(var(--ta-panel-width, 400px), calc(100vw - 28px));
  height: min(680px, calc(100dvh - 108px));
  min-height: 510px;
  background: var(--ta-white);
  border: 1px solid rgba(13,44,65,.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(9,34,49,.24);
  display: flex;
  flex-direction: column;
}
.turismo-assistente--floating .turismo-assistente__panel {
  position: absolute;
  bottom: 66px;
}
.turismo-assistente--right .turismo-assistente__panel { right: 0; }
.turismo-assistente--left .turismo-assistente__panel { left: 0; }
.turismo-assistente__panel[hidden] { display: none !important; }

.turismo-assistente--embedded { width: 100%; max-width: 880px; margin: 0 auto; }
.turismo-assistente--embedded .turismo-assistente__panel { width: 100%; height: 720px; max-height: 82vh; }

.turismo-assistente__header {
  min-height: 70px;
  padding: 12px 14px 12px 16px;
  background: linear-gradient(135deg, var(--ta-navy), var(--ta-blue));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.turismo-assistente__brand { display:flex; align-items:center; gap:11px; min-width:0; }
.turismo-assistente__brand-icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 50%; display:grid; place-items:center;
  background: var(--ta-yellow); color: var(--ta-navy); font-weight: 900;
}
.turismo-assistente__brand-icon--image { overflow:hidden; background:#fff; }
.turismo-assistente__brand-icon img { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.turismo-assistente__brand strong { display:block; font-size:14px; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.turismo-assistente__brand small { display:block; color:rgba(255,255,255,.72); font-size:11px; margin-top:2px; }
.turismo-assistente__close {
  width:34px; height:34px; border:0; border-radius:50%;
  background:rgba(255,255,255,.1); color:#fff; font-size:25px;
  line-height:1; cursor:pointer;
}

.turismo-assistente__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 14px 10px;
  background: linear-gradient(#f8fafb, #f4f7f9);
  overscroll-behavior: contain;
}
.turismo-assistente__message { margin: 0 0 13px; display:flex; flex-direction:column; }
.turismo-assistente__message--user { align-items:flex-end; }
.turismo-assistente__message--assistant { align-items:flex-start; }
.turismo-assistente__bubble {
  max-width: 90%;
  padding: 11px 13px;
  border-radius: 16px 16px 16px 4px;
  background:#fff;
  border:1px solid var(--ta-line);
  box-shadow:0 3px 12px rgba(25,63,85,.05);
  font-size:13.5px;
}
.turismo-assistente__message--user .turismo-assistente__bubble {
  color:#fff;
  background:var(--ta-blue);
  border-color:var(--ta-blue);
  border-radius:16px 16px 4px 16px;
}
.turismo-assistente__context {
  display:block;
  margin-top:9px;
  padding-top:9px;
  border-top:1px solid var(--ta-line);
  color:var(--ta-muted);
  font-size:12px;
}
.turismo-assistente__context strong { color:var(--ta-text); }
.turismo-assistente__bubble--error { border-color:#e4b9b9; color:#8c3030; background:#fffafa; }

.turismo-assistente__loading { display:flex; align-items:center; gap:5px; width:56px; }
.turismo-assistente__loading i {
  display:block; width:6px; height:6px; border-radius:50%; background:#78909d;
  animation: taPulse 1s infinite ease-in-out;
}
.turismo-assistente__loading i:nth-child(2){animation-delay:.12s}.turismo-assistente__loading i:nth-child(3){animation-delay:.24s}
@keyframes taPulse { 0%,100%{opacity:.3;transform:translateY(0)} 50%{opacity:1;transform:translateY(-3px)} }

.turismo-assistente__results {
  width:100%;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin-top:9px;
}
.turismo-assistente__card {
  min-width:0;
  background:#fff;
  border:1px solid var(--ta-line);
  border-radius:14px;
  overflow:hidden;
  text-decoration:none !important;
  color:var(--ta-text) !important;
  box-shadow:0 3px 12px rgba(25,63,85,.04);
  transition:transform .18s ease, box-shadow .18s ease;
}
.turismo-assistente__card:hover { transform:translateY(-2px); box-shadow:0 8px 20px rgba(25,63,85,.11); }
.turismo-assistente__card-media { display:block; aspect-ratio:16/10; background:#dfe7ec; overflow:hidden; }
.turismo-assistente__card-media img { display:block; width:100%; height:100%; object-fit:cover; }
.turismo-assistente__card-media--empty { display:grid; place-items:center; background:linear-gradient(135deg,var(--ta-navy),var(--ta-blue)); }
.turismo-assistente__card-media--empty span { width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--ta-yellow);color:var(--ta-navy);font-weight:900; }
.turismo-assistente__card-body { display:block; padding:10px; }
.turismo-assistente__card-type { display:block; color:var(--ta-blue); font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.055em; margin-bottom:4px; }
.turismo-assistente__card strong { display:block; font-size:12.5px; line-height:1.28; }
.turismo-assistente__card-locality { display:block; color:var(--ta-muted); font-size:10.5px; margin-top:3px; }
.turismo-assistente__card-excerpt {
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden;
  color:var(--ta-muted); font-size:10.5px; line-height:1.35; margin-top:6px;
}
.turismo-assistente__card-link { display:block; margin-top:8px; color:var(--ta-blue); font-size:10.5px; font-weight:800; }

.turismo-assistente__quick {
  flex:0 0 auto;
  display:flex;
  gap:7px;
  overflow-x:auto;
  padding:9px 12px;
  background:#fff;
  border-top:1px solid var(--ta-line);
  scrollbar-width:none;
}
.turismo-assistente__quick::-webkit-scrollbar { display:none; }
.turismo-assistente__chip {
  flex:0 0 auto;
  border:1px solid #ccdae2;
  background:#fff;
  color:var(--ta-blue);
  border-radius:999px;
  padding:7px 10px;
  font:inherit;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}
.turismo-assistente__chip:hover { background:#f5f8fa; border-color:#9fb7c5; }

.turismo-assistente__form {
  flex:0 0 auto;
  display:flex;
  align-items:flex-end;
  gap:8px;
  padding:10px 11px;
  background:#fff;
  border-top:1px solid var(--ta-line);
}
.turismo-assistente__form textarea {
  display:block;
  flex:1;
  resize:none;
  min-height:42px;
  max-height:108px;
  border:1px solid #cbd8df;
  border-radius:13px;
  padding:10px 11px;
  outline:none;
  background:#fff;
  color:var(--ta-text);
  font:inherit;
  font-size:13px;
  line-height:1.45;
}
.turismo-assistente__form textarea:focus { border-color:#7fa2b7; box-shadow:0 0 0 3px rgba(29,71,110,.08); }
.turismo-assistente__send {
  width:42px;height:42px;flex:0 0 42px;border:0;border-radius:12px;
  background:var(--ta-yellow);color:var(--ta-navy);display:grid;place-items:center;cursor:pointer;
}
.turismo-assistente__send svg { width:20px;height:20px;fill:currentColor; }
.turismo-assistente__send:disabled { opacity:.5; cursor:wait; }
.turismo-assistente__footer {
  flex:0 0 auto;
  padding:0 12px 9px;
  background:#fff;
  color:#899aa4;
  text-align:center;
  font-size:9.5px;
}

@media (max-width: 520px) {
  .turismo-assistente--floating { right:10px; left:10px; bottom:10px; }
  .turismo-assistente--floating .turismo-assistente__launcher { margin-left:auto; }
  .turismo-assistente--left .turismo-assistente__launcher { margin-left:0; }
  .turismo-assistente--floating .turismo-assistente__panel {
    position:fixed;
    inset:10px;
    width:auto;
    height:auto;
    min-height:0;
    max-height:none;
    border-radius:18px;
  }
  .turismo-assistente__results { grid-template-columns:1fr 1fr; }
  .turismo-assistente__launcher-text { display:none; }
  .turismo-assistente__launcher { padding:8px; min-height:54px; }
}

@media (max-width: 370px) {
  .turismo-assistente__results { grid-template-columns:1fr; }
}

/* v0.2 — contexto de navegación */
.turismo-assistente__header-actions {
  display:flex;
  align-items:center;
  gap:6px;
}
.turismo-assistente__reset {
  width:34px;
  height:34px;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.1);
  color:#fff;
  font:inherit;
  font-size:19px;
  line-height:1;
  cursor:pointer;
}
.turismo-assistente__reset:hover,
.turismo-assistente__close:hover { background:rgba(255,255,255,.18); }
.turismo-assistente__page-context {
  flex:0 0 auto;
  min-height:32px;
  padding:7px 13px;
  border-bottom:1px solid var(--ta-line);
  background:#fffdf5;
  color:#526874;
  font-size:10.5px;
  font-weight:700;
  display:flex;
  align-items:center;
  gap:7px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.turismo-assistente__page-context span:last-child {
  overflow:hidden;
  text-overflow:ellipsis;
}
.turismo-assistente__page-context-dot {
  width:7px;
  height:7px;
  flex:0 0 7px;
  border-radius:50%;
  background:var(--ta-yellow);
  box-shadow:0 0 0 3px rgba(242,201,76,.2);
}
.turismo-assistente__bubble--context-update {
  background:#fffdf5;
  border-color:#eadb9f;
  color:#4f6470;
}

/* v0.3 — presentadores visuales por tipo de contenido */
.turismo-assistente__results--smart {
  align-items:start;
}
.turismo-assistente__card--wide {
  grid-column:1 / -1;
}
.turismo-assistente__card--faq {
  border-left:4px solid var(--ta-yellow);
  background:#fffef8;
}
.turismo-assistente__faq-question {
  font-size:13px !important;
  line-height:1.35 !important;
}
.turismo-assistente__faq-answer {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:5;
  overflow:hidden;
  margin-top:8px;
  color:#40545f;
  font-size:11px;
  line-height:1.5;
}
.turismo-assistente__card-details {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.turismo-assistente__detail {
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:1px;
  padding:5px 7px;
  border-radius:8px;
  background:#f4f7f9;
  border:1px solid #e1e9ed;
  color:#536a76;
}
.turismo-assistente__detail small {
  font-size:8px;
  line-height:1.1;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:#7b8d97;
}
.turismo-assistente__detail b {
  max-width:130px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:9.5px;
  line-height:1.2;
  color:var(--ta-text);
}
.turismo-assistente__card--route .turismo-assistente__card-type,
.turismo-assistente__card--heritage .turismo-assistente__card-type,
.turismo-assistente__card--food .turismo-assistente__card-type,
.turismo-assistente__card--lodging .turismo-assistente__card-type,
.turismo-assistente__card--event .turismo-assistente__card-type,
.turismo-assistente__card--beach .turismo-assistente__card-type {
  display:inline-flex;
  align-items:center;
  min-height:20px;
  padding:3px 7px;
  border-radius:999px;
  background:#eef4f7;
}
.turismo-assistente__card--route .turismo-assistente__card-type { background:#eef6ee; color:#426d49; }
.turismo-assistente__card--heritage .turismo-assistente__card-type { background:#f7f1e7; color:#765c31; }
.turismo-assistente__card--food .turismo-assistente__card-type { background:#fff1ed; color:#8b5142; }
.turismo-assistente__card--lodging .turismo-assistente__card-type { background:#f0effa; color:#5b568b; }
.turismo-assistente__card--event .turismo-assistente__card-type { background:#fff7de; color:#7d6727; }
.turismo-assistente__card--beach .turismo-assistente__card-type { background:#eaf7fb; color:#317187; }
.turismo-assistente__card--video {
  display:block;
  overflow:hidden;
}
.turismo-assistente__video-player {
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:16/9;
  background:#07131a;
  overflow:hidden;
}
.turismo-assistente__video-player iframe,
.turismo-assistente__video-player video {
  display:block;
  width:100%;
  height:100%;
  border:0;
  object-fit:contain;
  background:#000;
}
.turismo-assistente__card-link--button {
  display:inline-flex;
  align-items:center;
  width:auto;
  margin-top:9px;
  padding:6px 9px;
  border-radius:8px;
  background:var(--ta-blue);
  color:#fff !important;
  text-decoration:none !important;
}
.turismo-assistente__card-link--button:hover {
  background:var(--ta-navy);
}

@media (max-width:520px) {
  .turismo-assistente__card-details { gap:5px; }
  .turismo-assistente__detail { flex:1 1 calc(50% - 5px); }
  .turismo-assistente__detail b { max-width:none; }
}

/* v0.4 — memoria conversacional visible */
.turismo-assistente__memory {
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:6px;
  overflow-x:auto;
  padding:7px 12px;
  border-bottom:1px solid var(--ta-line);
  background:#f8fbfc;
  scrollbar-width:none;
}
.turismo-assistente__memory[hidden] { display:none !important; }
.turismo-assistente__memory::-webkit-scrollbar { display:none; }
.turismo-assistente__memory-chip {
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  min-height:23px;
  padding:4px 8px;
  border:1px solid #d8e3e8;
  border-radius:999px;
  background:#fff;
  color:#536b77;
  font-size:9.5px;
  line-height:1;
  font-weight:800;
  white-space:nowrap;
}
.turismo-assistente__memory-chip:first-child {
  border-color:rgba(242,201,76,.65);
  background:#fffdf5;
  color:var(--ta-navy);
}

/* v0.6 · proximidad geográfica */
.turismo-asistente__chip--geo {
  font-weight: 700;
  border-style: solid;
}
.turismo-asistente__chip--geo::before {
  content: "◎";
  margin-right: 6px;
  font-size: .95em;
}
.turismo-asistente__detail:first-child small + b {
  white-space: nowrap;
}


/* v0.7 — planificador turístico */
.turismo-assistente__itinerary { display:block; margin-top:10px; border:1px solid var(--ta-line); border-radius:16px; overflow:hidden; background:#fff; }
.turismo-assistente__plan-head { padding:12px 14px; background:linear-gradient(135deg,var(--ta-navy),var(--ta-blue)); color:#fff; }
.turismo-assistente__plan-head strong { display:block; font-size:14px; line-height:1.3; }
.turismo-assistente__plan-kicker { display:block; margin-bottom:3px; color:var(--ta-yellow); font-size:9px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.turismo-assistente__plan-day { padding:12px; border-top:1px solid var(--ta-line); }
.turismo-assistente__plan-day:first-of-type { border-top:0; }
.turismo-assistente__plan-day h4 { margin:0 0 10px; color:var(--ta-navy); font-size:13px; }
.turismo-assistente__plan-stop { position:relative; display:grid; grid-template-columns:76px minmax(0,1fr); gap:9px; margin:0 0 10px; }
.turismo-assistente__plan-stop:last-child { margin-bottom:0; }
.turismo-assistente__plan-period { padding-top:9px; color:var(--ta-blue); font-size:9.5px; font-weight:900; line-height:1.2; text-transform:uppercase; letter-spacing:.035em; }
.turismo-assistente__plan-card { display:flex; min-width:0; overflow:hidden; border:1px solid var(--ta-line); border-radius:12px; background:#fff; }
.turismo-assistente__plan-thumb { display:block; flex:0 0 92px; min-height:108px; background:#eef3f6; }
.turismo-assistente__plan-thumb img { width:100%; height:100%; min-height:108px; object-fit:cover; display:block; }
.turismo-assistente__plan-content { min-width:0; flex:1; padding:9px 10px; }
.turismo-assistente__plan-title { display:block; color:var(--ta-text); font-size:12.5px; font-weight:800; line-height:1.28; text-decoration:none; }
.turismo-assistente__plan-title:hover { color:var(--ta-blue); }
.turismo-assistente__plan-note { display:block; margin-top:5px; color:var(--ta-muted); font-size:10px; line-height:1.35; }
.turismo-assistente__plan-content .turismo-assistente__card-details { margin-top:6px; }
.turismo-assistente__plan-extras { padding:12px; border-top:1px solid var(--ta-line); background:#f8fafb; }
.turismo-assistente__plan-extras > strong { display:block; margin-bottom:8px; color:var(--ta-navy); font-size:11px; }
.turismo-assistente__plan-warning { padding:10px 12px; border-top:1px solid var(--ta-line); background:#fffdf5; color:#6e6546; font-size:9.5px; line-height:1.4; }
@media (max-width:520px) {
  .turismo-assistente__plan-stop { grid-template-columns:64px minmax(0,1fr); gap:7px; }
  .turismo-assistente__plan-thumb { flex-basis:78px; min-height:100px; }
  .turismo-assistente__plan-thumb img { min-height:100px; }
}
@media (max-width:380px) {
  .turismo-assistente__plan-stop { display:block; }
  .turismo-assistente__plan-period { padding:0 0 5px; }
}

/* v0.7.9 · Conocimiento propio */
.turismo-assistente__card--knowledge{border-left:4px solid var(--ta-yellow);background:linear-gradient(180deg,#fff 0%,#fffdf4 100%)}
.turismo-assistente__card--knowledge .turismo-assistente__card-type{color:var(--ta-navy);font-weight:800}

/* v0.7.10: avatar robusto con fallback siempre disponible. */
.turismo-assistente__brand-icon { position:relative; overflow:hidden; }
.turismo-assistente__brand-fallback { position:relative; z-index:0; display:grid; place-items:center; width:100%; height:100%; }
.turismo-assistente__brand-icon img[data-ta-avatar-image] { position:absolute; inset:0; z-index:1; width:100%; height:100%; object-fit:cover; background:#fff; }
.turismo-assistente__brand-icon img[data-ta-avatar-image].is-broken { display:none; }
