/* ================================
   DeepSeek Inline · Layout ancho
   ================================ */
.ds-wrapper{
  max-width: 1200px;   /* coherente con el resto del sitio */
  margin: 0 auto;      /* centrado */
  /* padding-inline: 1rem; */  /* si más adelante querés respiración lateral */
}
@media (min-width: 1400px){
  .ds-wrapper{ max-width: 1280px; }
}

/* Sticky del aside solo en >=lg */
@media (min-width: 992px){
  .ds-aside{ position: sticky; top: 88px; }
}


/* ================================
   Timeline (aside)
   ================================ */
.ds-day{
  border: 1px solid #e5e7eb;
  border-radius: .9rem;
  background: #fff;
  overflow: hidden;
}
.ds-day + .ds-day{ margin-top: 1rem; }

.ds-day-head{
  padding: .9rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.ds-day-head:hover{ background: #eef4ff; }

.ds-day-date{
  display: flex; align-items: center; gap: .4rem;
  color: #64748b; font-weight: 600; font-size: .85rem;
}
.ds-day-date i{ color: #94a3b8; }

/* Contenedor de los ítems */
.ds-day-body{
  --pad-x: .75rem;
  padding: var(--pad-x);
  position: relative;
  border-radius: .75rem;
  overflow: hidden; /* para que el ::before respete el borde del contenedor */
}

/* ================================
   Días plegables (ds-collapsible la añade deepseek-inline.js;
   no afecta a /deepseek ni a las cajas CTA/spinner que reusan .ds-day)
   ================================ */
.ds-day.ds-collapsible{
  display: grid;
  grid-template-rows: auto 0fr;            /* head + body colapsado */
  transition: grid-template-rows .32s cubic-bezier(.22,.85,.35,1);
}
.ds-day.ds-collapsible.is-open{
  grid-template-rows: auto 1fr;
}
.ds-day.ds-collapsible > .ds-day-body{
  min-height: 0;                            /* obligatorio para que 0fr colapse */
  overflow: hidden;
  opacity: 0;
  padding-block: 0;                         /* el padding vertical se anima a la vez */
  transition: opacity .18s ease,
              padding-block .32s cubic-bezier(.22,.85,.35,1);
}
.ds-day.ds-collapsible.is-open > .ds-day-body{
  opacity: 1;
  padding-block: var(--pad-x);              /* recupera el .75rem original */
  transition-delay: .06s, 0s;               /* el contenido aparece tras empezar a abrir */
}

/* Cabecera: affordance */
.ds-day.ds-collapsible > .ds-day-head{
  user-select: none;
  transition: background .15s ease, border-color .32s ease;
}
.ds-day.ds-collapsible:not(.is-open) > .ds-day-head{
  border-bottom-color: transparent;         /* sin línea huérfana sobre el borde redondeado */
}
.ds-day-head:focus-visible{
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(37,99,235,.35);
}
.ds-day-titlewrap{ min-width: 0; }          /* permite text-truncate del título en flex */

/* Chip "N paradas" */
.ds-day-count{
  font-size: .75rem; font-weight: 600; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #475569; background: #fff;
  border: 1px solid #e8edf5;
  padding: .18rem .55rem; border-radius: 999px;
}

/* Chevron */
.ds-day-caret{
  color: #94a3b8; font-size: .9rem; line-height: 1;
  transition: transform .32s cubic-bezier(.22,.85,.35,1), color .15s ease;
}
.ds-day.is-open > .ds-day-head .ds-day-caret{ transform: rotate(180deg); }
.ds-day-head:hover .ds-day-caret{ color: #2563eb; }

@media (prefers-reduced-motion: reduce){
  .ds-day.ds-collapsible,
  .ds-day.ds-collapsible > .ds-day-body,
  .ds-day-caret{ transition: none; }
}


@media (min-width:992px){ #deepseekInline .ds-aside{ position:sticky; top:88px; } }
@media (max-width:991.98px){ #deepseekInline .ds-aside{ position:static; } }
/* --- DeepSeek: evita recortes del lado derecho / parte inferior --- */
/* Fondo coherente y margen inferior visual */
#deepseekInline {
  background: transparent;
  margin-top: 2rem;       /* separa del buscador superior */
  margin-bottom: 5rem;    /* espacio amplio antes del siguiente bloque */
  padding-bottom: 3rem;   /* un poco más de aire interno */
  overflow: visible !important;
}


#deepseekInline .row,
#deepseekInline main,
#deepseekInline article,
#deepseekInline .card,
#deepseekInline .card > .card-body {
  overflow: visible !important;   /* quita cualquier overflow:hidden heredado */
  height: auto;                   /* evita alturas fijas de algún reset */
}
#deepseekInline .ds-card {
  background: #fff;
  border-radius: 1rem;
  overflow: visible !important;
}

/* si en algún css anterior quedó esto, neutralízalo aquí */
#deepseekInline .ds-card { overflow: visible !important; }

/* opcional: si el aside stickeado empuja el layout en móvil */
@media (max-width: 991.98px){
  #deepseekInline .ds-aside{ position: static !important; }
}
@media (max-width: 768px){
  #deepseekInline { margin-bottom: 3rem; padding-bottom: 2rem; }
}
/* ----- Card detalle ----- */
#deepseekInline .ds-card { overflow: visible; }
#deepseekInline .ds-card .card-body { padding-bottom: 2rem; }

/* Pills y chips */
#deepseekInline .ds-pill{
  display:inline-flex; gap:.4rem; align-items:center;
  padding:.35rem .6rem; border-radius:999px;
  background:#fff; border:1px solid #e5e7eb;
  color:#111827; font-weight:600; font-size:.85rem;
}
#deepseekInline .ds-tags .badge{
  background:#f1f5f9; color:#0f172a; font-weight:600;
  border:1px solid #e5e7eb; border-radius:.6rem;
  padding:.25rem .5rem;
}

/* Score circular */
#deepseekInline .ds-score{ display:flex; align-items:center; gap:.6rem; }
#deepseekInline .ds-score .score{
  width:40px; height:40px; border-radius:50%; display:grid; place-items:center;
  background:conic-gradient(#22c55e 0 0deg,#e5e7eb 0);  /* se actualiza por JS */
  color:#0a0a0a; font-weight:700; font-size:.9rem;
}

/* Badge de hora */
#deepseekInline .time-badge{
  background:#1d4ed8; color:#fff; font-weight:700;
  border-radius:.6rem; padding:.35rem .65rem;
  box-shadow:0 6px 14px rgba(29,78,216,.25);
  font-size:.85rem;
}

#deepseekInline .ds-map img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: .75rem;
  display: block;
}
.ds-map{
  min-height: 220px;          /* asegura espacio para la imagen */
  border-radius: .75rem;
  background: linear-gradient(135deg,#f1f5f9,#e2e8f0);
  display: grid;
  place-items: center;
  color: #64748b;
  font-weight: 600;
}
/* “aire” al final (para que no quede pegado al footer) */
#deepseekInline { padding-bottom: 3rem; }
/* el resto de reglas (.tl-item, .time-badge, etc.) también con #deepseekInline delante */

/* ================================
   Hero (detalle) · Skeleton
   ================================ */
.ds-hero{
  display: block; width: 100%; height: 280px;
  object-fit: cover; background: #eef2f6;
}
.ds-hero.loading{
  background: linear-gradient(90deg,#eef2f6 25%,#f5f7fb 37%,#eef2f6 63%);
  background-size: 400% 100%;
  animation: dsShine 1.2s ease-in-out infinite;
}
@keyframes dsShine{
  0%{ background-position: 100% 0; }
  100%{ background-position: 0 0; }
}


/* ================================
   Lista timeline
   ================================ */
.tl-list{
  list-style: none;
  margin: 0;
  padding: 0;
}
.tl-list .tl-item:first-child{
  margin-top: 0 !important;
  padding-top: .1rem;
}
.tl-list .tl-item:last-child{
  margin-bottom: 0 !important;
  padding-bottom: .1rem;
}

.tl-item{
  /* saca el bloque hacia los bordes para que el activo cubra toda el área visual */
  margin: 2px calc(var(--pad-x) * -1);
  padding: .5rem var(--pad-x);
  border-radius: .75rem;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.tl-item:hover{
  background: #f8fbff;
  box-shadow: inset 0 0 0 9999px rgba(29,78,216,.03);
}
.tl-item.active{
  background: #eef5ff;
  box-shadow: 0 0 0 1px rgba(29,78,216,.22) inset;
}

/* Contenido + rail/punto */
.tl-content{
  position: relative;
  padding-left: 1.35rem; /* espacio para el punto */
}
.tl-content::before{
  content: "";
  position: absolute;
  left: .28rem; top: .35rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rail, #2563eb);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--rail, #2563eb) 30%, transparent);
}
.tl-content::after{
  content: "";
  position: absolute;
  left: .71rem; top: 1.7rem; bottom: -1rem; width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--rail, #d1d7e0) 0 8px,
    transparent 8px 14px
  );
  opacity: .8;
}
.tl-item:last-child .tl-content::after{ display: none; }

/* Colores por modo */
.tl-item.mode-walk { --rail:#2563eb; }
.tl-item.mode-metro{ --rail:#16a34a; }
.tl-item.mode-bus  { --rail:#f59e0b; }
.tl-item.mode-tram { --rail:#06b6d4; }
.tl-item.mode-car  { --rail:#64748b; }

/* Hora (badge) */
.time-badge{
  background:#1d4ed8; color:#fff; font-weight:700;
  border-radius:.6rem; padding:.35rem .65rem;
  box-shadow:0 6px 14px rgba(29,78,216,.25);
  font-size:.85rem;
}
.loading-overlay{
  position:fixed; inset:0; background:rgba(15,18,27,.55); z-index:1050;
  display:none; align-items:center; justify-content:center; backdrop-filter:saturate(120%) blur(3px);
}
.loading-box{
  background:#fff; color:#111; border-radius:12px; padding:16px 18px; min-width:260px;
  box-shadow:0 10px 30px rgba(0,0,0,.2);
}
@media (prefers-color-scheme: dark){
  .loading-box{ background:#1f2937; color:#f9fafb; }
}

/* ===== Nota persistente de itinerario recortado por plan ===== */
.ds-limit-note{
  display: flex; gap: .75rem; align-items: flex-start;
  margin-top: 1rem;
  padding: .9rem 1rem;
  border-radius: .9rem;
  background: #fffbeb;
  border: 1px solid rgba(217,119,6,.35);
}
.ds-limit-ico{
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  border-radius: .55rem;
  background: rgba(217,119,6,.14);
  color: #b45309; font-size: 1rem;
}
.ds-limit-body{ min-width: 0; font-size: .88rem; color: #5b4a1f; }
.ds-limit-body strong{ display: block; color: #92400e; margin-bottom: .2rem; }
.ds-limit-body p{ margin: 0 0 .5rem; }

/* =========================================
   Detalle como BOTTOM SHEET en móvil (<992px)
   El mismo <main.ds-detail-col> del grid de escritorio se fija
   abajo como hoja deslizable. Cerrada: transform + visibility
   (NO display:none — renderMap mide el ancho del mapa).
   En ≥992px nada de este bloque aplica.
   ========================================= */
html.ds-sheet-lock,
html.ds-sheet-lock body{ overflow: hidden; }  /* el JS solo lo activa en móvil */

/* Foco de teclado en paradas (los tl-item son role=button) */
.tl-item:focus-visible{
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(37,99,235,.4);
}

@media (max-width: 991.98px){

  main.ds-detail-col{
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1090;                   /* navbar 1000 · toasts 1080 */
    margin: 0;
    padding: 0 0 env(safe-area-inset-bottom);
    width: 100%;
    max-height: 86vh;                /* fallback */
    max-height: 86dvh;
    background: #fff;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -18px 50px rgba(2,6,23,.28);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateY(102%);
    visibility: hidden;
    transition: transform .34s cubic-bezier(.22,.85,.35,1),
                visibility 0s linear .34s;
  }
  main.ds-detail-col.is-open{
    transform: none;
    visibility: visible;
    transition: transform .34s cubic-bezier(.22,.85,.35,1),
                visibility 0s;
  }
  /* En el home, el bloque legacy "#deepseekInline main{overflow:visible!important}"
     ganaría por especificidad: este override id+clase lo neutraliza
     SOLO para el scroll (el resto de propiedades no chocan). */
  #deepseekInline main.ds-detail-col{ overflow-y: auto !important; }

  /* La card pierde su cromo dentro de la hoja (la hoja ya es la superficie) */
  .ds-detail-col .ds-card{
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
  }
  .ds-detail-col .ds-hero{ height: 210px; }

  /* Asa decorativa */
  .ds-sheet-grip{
    display: grid; place-items: center;
    padding: .55rem 0 .4rem;
    touch-action: none;              /* para el drag de cierre */
  }
  .ds-sheet-grip span{
    width: 44px; height: 5px; border-radius: 999px;
    background: #cbd5e1;
  }

  /* Cerrar: sticky para seguir visible al hacer scroll dentro de la hoja.
     El margin-bottom negativo lo superpone al hero sin ocupar alto. */
  .ds-sheet-close{
    position: sticky; top: .6rem; z-index: 7;
    display: grid; place-items: center;
    margin: 0 .75rem -2.4rem auto;
    width: 38px; height: 38px;
    border: 0; border-radius: 50%;
    background: rgba(15,23,42,.55);
    color: #fff; font-size: 1rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .ds-sheet-close:focus-visible{
    outline: 0;
    box-shadow: 0 0 0 3px rgba(96,165,250,.6);
  }

  /* Backdrop: tap fuera = cerrar (listener global en deepseek-inline.js) */
  .ds-sheet-backdrop{
    position: fixed; inset: 0;
    z-index: 1085;
    background: rgba(2,6,23,.45);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
  }
  .ds-sheet-backdrop.is-show{
    opacity: 1; visibility: visible;
    transition: opacity .25s ease, visibility 0s;
  }
}

@media (prefers-reduced-motion: reduce){
  .ds-detail-col,
  .ds-sheet-backdrop{ transition: none !important; }
}

/* ===== Navegación Anterior/Siguiente entre paradas (detalle) ===== */
.ds-stopnav{
  display: flex; justify-content: space-between; gap: .75rem;
  padding: .5rem .9rem;
  border-bottom: 1px solid #eef2f6;
  background: #fbfcfe;
}
.ds-stopnav-btn{
  display: inline-flex; align-items: center; gap: .5rem;
  max-width: 48%;
  padding: .3rem .5rem;
  border: 0; background: transparent; border-radius: .5rem;
  color: #1f2937; text-align: left;
  transition: background-color .15s ease, color .15s ease;
}
.ds-stopnav-next{ text-align: right; }
.ds-stopnav-btn:hover:not(:disabled){ background: rgba(37,99,235,.07); color: #1d4ed8; }
.ds-stopnav-btn:focus-visible{ outline: 0; box-shadow: 0 0 0 .2rem rgba(37,99,235,.18); }
.ds-stopnav-btn:disabled{ opacity: .35; }
.ds-stopnav-btn i{ color: #94a3b8; font-size: .85rem; flex-shrink: 0; }
.ds-stopnav-btn:hover:not(:disabled) i{ color: #2563eb; }
.ds-stopnav-txt{ display: grid; min-width: 0; line-height: 1.25; }
.ds-stopnav-txt small{
  font-size: .66rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: #94a3b8;
}
.ds-stopnav-txt > span{
  font-size: .82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== Distintivo "Día N" sobre el hero del detalle ===== */
.ds-card{ position: relative; }
.ds-day-flag{
  position: absolute; top: .75rem; left: .75rem; z-index: 6;
  background: #6d28d9; color: #fff;
  font-weight: 700; font-size: .78rem;
  padding: .28rem .65rem; border-radius: .5rem;
  box-shadow: 0 6px 14px rgba(109,40,217,.35);
  pointer-events: none;
}

/* =========================================
   Estado de carga POR DÍA (cabecera de .ds-day) — spec AgentUI
   Slot .ds-day-status convive con .ds-day-count y el chevron.
   Estados en .ds-day: .is-loading / .is-done / .is-failed
   ========================================= */
.ds-day-status{
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 600; line-height: 1;
  white-space: nowrap;
}
.ds-day-status-txt{ font-variant-numeric: tabular-nums; }

/* Cargando: barras tipo ecualizador (gradiente de marca) */
.ds-day-status.is-loading{ color: #6d28d9; }
.ds-day-bars{ display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.ds-day-bars i{
  display: block; width: 3px; height: 100%; border-radius: 2px;
  background: linear-gradient(180deg, #2563eb, #6d28d9);
  transform-origin: bottom;
  animation: dsDayBars 1s ease-in-out infinite;
}
.ds-day-bars i:nth-child(2){ animation-delay: .18s; }
.ds-day-bars i:nth-child(3){ animation-delay: .36s; }
@keyframes dsDayBars{
  0%, 100%{ transform: scaleY(.35); opacity: .65; }
  50%     { transform: scaleY(1);   opacity: 1; }
}

/* Listo: check verde que entra y se desvanece (sin ruido permanente) */
.ds-day-status.is-done{ color: #16a34a; font-size: .95rem; }
.ds-day-status.is-done .bi{
  display: inline-block;
  animation: dsDayCheck .9s cubic-bezier(.22,.85,.35,1) forwards;
}
@keyframes dsDayCheck{
  0%   { opacity: 0; transform: scale(.4); }
  35%  { opacity: 1; transform: scale(1); }
  70%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* Fallido: advertencia ámbar discreta + cabecera tintada */
.ds-day-status.is-failed{ color: #b45309; }
.ds-day-status.is-failed .bi{ font-size: .82rem; }
.ds-day.is-failed > .ds-day-head{ background: #fffbeb; }

/* Skeleton-shimmer en las paradas de un día aún cargando */
.tl-skel-line{
  display: block; height: .7rem; border-radius: 999px;
  background: linear-gradient(90deg,#eef2f6 25%,#f5f7fb 37%,#eef2f6 63%);
  background-size: 400% 100%;
  animation: dsShine 1.2s ease-in-out infinite;
}
.tl-item.is-skeleton .tl-time.tl-skel-line{ width: 3.2rem; margin-bottom: .15rem; }
.tl-skel-sub{ width: 70%; height: .6rem; }
.tl-item.is-skeleton{ cursor: default; }
.tl-item.is-skeleton:hover{ background: transparent; box-shadow: none; }

/* Indicador GLOBAL de progreso (hermano de elDays) */
.ds-progress{ margin: 0 0 1rem; }
.ds-progress-track{ height: 4px; border-radius: 999px; overflow: hidden; background: #e8edf5; }
.ds-progress-fill{
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg,#2563eb,#6d28d9);
  transition: width .45s cubic-bezier(.22,.85,.35,1);
}
.ds-progress-txt{ margin-top: .35rem; font-size: .76rem; font-weight: 600; color: #64748b; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce){
  .ds-day-bars i, .ds-day-status.is-done .bi, .tl-skel-line{ animation: none; }
  .ds-day-bars i{ transform: scaleY(.7); opacity: .85; }
  .ds-day-status.is-done .bi{ opacity: 1; }
  .ds-progress-fill{ transition: none; }
  .tl-skel-line{ background: #eef2f6; }
}

/* =========================================
   Cabecera de día en 2 filas: el TÍTULO ocupa la primera fila casi al
   completo (hasta 2 líneas) en vez de truncarse a nada compitiendo con
   el contador/fecha/estado; el contador + fecha bajan a una 2ª fila.
   ========================================= */
.ds-day-head{ display: block; }
.ds-day-head-top{ display: flex; align-items: flex-start; gap: .5rem; }
.ds-day-head-top .badge{ margin-top: .1rem; }
.ds-day-title{
  flex: 1 1 auto; min-width: 0;
  font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ds-day-head-end{
  display: inline-flex; align-items: center; gap: .4rem;
  flex-shrink: 0; margin-left: auto; padding-top: .1rem;
}
.ds-day-meta{
  display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .55rem;
  margin-top: .45rem;
}

/* =========================================
   Afinar día (✨) — disparador + panel inline
   Namespaced .ds-refine*. Reutiliza tokens del módulo y el
   lenguaje de .ds-limit-note / .ds-day-bars / .tl-skel-line.
   ========================================= */
.ds-refine-btn{
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem;
  font-size: .74rem; font-weight: 600; line-height: 1;
  color: #6d28d9;
  background: rgba(109,40,217,.07);
  border: 1px solid rgba(109,40,217,.18);
  border-radius: 999px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.ds-refine-btn:hover{ background: rgba(109,40,217,.13); border-color: rgba(109,40,217,.32); }
.ds-refine-btn:active{ transform: scale(.96); }
.ds-refine-btn:focus-visible{ outline: none; box-shadow: 0 0 0 .2rem rgba(139,92,246,.3); }
.ds-refine-btn .ds-refine-spark{ font-size: .8rem; line-height: 1; }
.ds-refine-lock{ font-size: .66rem; opacity: .8; margin-left: .05rem; }
.ds-refine-btn[aria-expanded="true"]{
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(109,40,217,.14));
  border-color: rgba(109,40,217,.4); color: #5b21b6;
}
.ds-refine-btn.is-locked{ color: #64748b; background: #f1f5f9; border-color: #e2e8f0; }
.ds-refine-btn.is-locked:hover{ background: #e9eef5; border-color: #cbd5e1; color: #475569; }
@media (max-width: 480px){
  .ds-refine-btn-txt{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ds-refine-btn{ padding: .28rem .4rem; }
}

.ds-refine-panel{ display: grid; grid-template-rows: 1fr; margin: 0 0 .85rem; }
.ds-refine-panel[hidden]{ display: none; }
.ds-refine-panel.is-collapsing{ grid-template-rows: 0fr; transition: grid-template-rows .26s cubic-bezier(.22,.85,.35,1); }
.ds-refine-inner{
  min-height: 0; overflow: hidden;
  border: 1px solid #e6e3f3; border-radius: .8rem;
  background: linear-gradient(180deg, #faf9ff, #f5f6ff);
  padding: .8rem .85rem;
}
.ds-refine-panel:not(.is-collapsing) .ds-refine-inner{ animation: dsRefineIn .28s cubic-bezier(.22,.85,.35,1); }
@keyframes dsRefineIn{ from{ opacity: 0; transform: translateY(-4px); } to{ opacity: 1; transform: translateY(0); } }
.ds-refine-head{ display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.ds-refine-title{ font-size: .82rem; font-weight: 700; color: #4c1d95; display: inline-flex; align-items: center; gap: .35rem; }
.ds-refine-title::before{ content: "✨"; font-size: .85rem; }
.ds-refine-x{
  border: 0; background: transparent; color: #94a3b8;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; font-size: .8rem;
  transition: background .15s ease, color .15s ease;
}
.ds-refine-x:hover{ background: rgba(100,116,139,.12); color: #475569; }
.ds-refine-x:focus-visible{ outline: none; box-shadow: 0 0 0 .2rem rgba(139,92,246,.3); }
.ds-refine-chips{ display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.ds-refine-chip{
  font-size: .76rem; font-weight: 600; line-height: 1;
  padding: .4rem .7rem; border-radius: 999px;
  color: #475569; background: #fff; border: 1px solid #e2e8f0; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.ds-refine-chip:hover{ border-color: #c7d2fe; background: #f5f7ff; color: #1e293b; }
.ds-refine-chip:active{ transform: scale(.96); }
.ds-refine-chip:focus-visible{ outline: none; box-shadow: 0 0 0 .2rem rgba(37,99,235,.22); }
.ds-refine-chip[aria-pressed="true"]{
  color: #fff; background: linear-gradient(135deg, #2563eb, #6d28d9);
  border-color: transparent; box-shadow: 0 4px 12px rgba(109,40,217,.25);
}
.ds-refine-field{ display: flex; gap: .5rem; align-items: stretch; }
.ds-refine-input{
  flex: 1 1 auto; min-width: 0; font-size: .82rem; padding: .5rem .7rem;
  border: 1px solid #d8def0; border-radius: .6rem; background: #fff; color: #0f172a;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ds-refine-input::placeholder{ color: #94a3b8; }
.ds-refine-input:focus{ outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 .2rem rgba(139,92,246,.18); }
.ds-refine-go{
  flex: 0 0 auto; color: #fff; border: 0; white-space: nowrap;
  background: linear-gradient(135deg, #2563eb, #6d28d9);
  box-shadow: 0 4px 12px rgba(109,40,217,.25);
  transition: filter .15s ease, transform .05s ease, opacity .15s ease;
}
.ds-refine-go:hover{ filter: brightness(1.06); color: #fff; }
.ds-refine-go:active{ transform: translateY(1px); }
.ds-refine-go:focus-visible{ outline: none; box-shadow: 0 0 0 .2rem rgba(139,92,246,.4); }
.ds-refine-go-busy{ display: inline-flex; align-items: center; gap: .35rem; }
.ds-refine-panel.is-busy .ds-refine-chip,
.ds-refine-panel.is-busy .ds-refine-input,
.ds-refine-panel.is-busy .ds-refine-x{ pointer-events: none; opacity: .55; }
.ds-refine-error{ margin: .55rem 0 0; font-size: .76rem; font-weight: 600; color: #b91c1c; display: flex; align-items: center; }
.ds-refine-upsell .ds-limit-note{ margin-top: 0; }

/* Estado "afinando…" del día (.ds-day.is-refining) — gobernado por setDayRefining() */
.ds-day.is-refining > .ds-day-head .ds-day-status{ display: none; }
.ds-refine-status{ display: none; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; line-height: 1; color: #6d28d9; white-space: nowrap; }
.ds-day.is-refining .ds-refine-status{ display: inline-flex; }
.ds-refine-status .ds-day-bars i{ background: linear-gradient(180deg, #2563eb, #8b5cf6); }
.ds-day.is-refining .tl-list{ position: relative; }
.ds-day.is-refining .tl-item{ opacity: .45; filter: saturate(.6); pointer-events: none; transition: opacity .2s ease; }
.ds-day.is-refining .tl-item .tl-time{
  color: transparent; border-radius: 999px;
  background: linear-gradient(90deg,#eef2f6 25%,#f5f7fb 37%,#eef2f6 63%); background-size: 400% 100%;
  animation: dsShine 1.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce){
  .ds-refine-panel.is-collapsing, .ds-refine-inner{ animation: none; transition: none; }
  .ds-day.is-refining .tl-item .tl-time{ animation: none; }
}

/* =========================================
   Presupuesto estimado (.ds-budget*) — diseño AgentUI
   Hermano de elDays, encima de los días. Categorías:
   actividades AZUL · comida VIOLETA · transporte ÁMBAR.
   ========================================= */
.ds-budget{ margin: 0 0 1rem; border: 1px solid #e5e7eb; border-radius: .9rem; background: #fff; overflow: hidden; }
.ds-budget-head{ display: flex; align-items: center; gap: .85rem; padding: .9rem 1rem; background: linear-gradient(180deg, #f8fafc, #fff); border-bottom: 1px solid #eef2f6; }
.ds-budget-ico{ flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: .6rem; background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(109,40,217,.14)); color: #6d28d9; font-size: 1.15rem; }
.ds-budget-figs{ min-width: 0; flex: 1 1 auto; }
.ds-budget-pp{ display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.ds-budget-amt{ font-size: 1.5rem; font-weight: 800; line-height: 1; color: #0f172a; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ds-budget-unit{ font-size: .8rem; font-weight: 600; color: #64748b; }
.ds-budget-group{ margin-top: .2rem; font-size: .82rem; font-weight: 600; color: #475569; font-variant-numeric: tabular-nums; }
.ds-budget-tag{ flex: 0 0 auto; align-self: flex-start; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #5b21b6; background: rgba(109,40,217,.08); border: 1px solid rgba(109,40,217,.18); padding: .18rem .5rem; border-radius: 999px; }
.ds-budget-foot{ margin: 0; padding: .55rem 1rem; font-size: .74rem; color: #94a3b8; line-height: 1.35; }
.ds-budget-cats{ padding: .35rem 1rem .9rem; }
.ds-budget-bar{ display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #eef2f6; }
.ds-budget-seg{ display: block; height: 100%; transition: width .5s cubic-bezier(.22,.85,.35,1); }
.ds-budget-seg + .ds-budget-seg{ box-shadow: -1px 0 0 rgba(255,255,255,.55); }
.ds-budget-seg.is-act  { background: linear-gradient(180deg,#3b82f6,#2563eb); }
.ds-budget-seg.is-meal { background: linear-gradient(180deg,#8b5cf6,#6d28d9); }
.ds-budget-seg.is-trans{ background: linear-gradient(180deg,#fbbf24,#f59e0b); }
.ds-budget-legend{ list-style: none; margin: .7rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: .35rem; }
.ds-budget-leg{ display: flex; align-items: center; gap: .4rem; min-width: 0; }
.ds-budget-dot{ flex: 0 0 10px; width: 10px; height: 10px; border-radius: 3px; }
.ds-budget-dot.is-act  { background: #2563eb; }
.ds-budget-dot.is-meal { background: #6d28d9; }
.ds-budget-dot.is-trans{ background: #f59e0b; }
.ds-budget-leg-lbl{ font-size: .78rem; font-weight: 600; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-budget-leg-val{ margin-left: auto; font-size: .78rem; font-weight: 700; color: #0f172a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ds-budget-leg-val small{ color: #94a3b8; font-weight: 600; }
.ds-budget-upsell{ margin: 0 1rem 1rem; }
.ds-budget-toggle{ display: flex; align-items: center; gap: .45rem; width: 100%; padding: .7rem 1rem; border: 0; border-top: 1px solid #eef2f6; background: #fbfcfe; color: #1d4ed8; font-size: .82rem; font-weight: 700; cursor: pointer; transition: background .15s ease, color .15s ease; }
.ds-budget-toggle:hover{ background: #eef4ff; }
.ds-budget-toggle:focus-visible{ outline: none; box-shadow: inset 0 0 0 2px rgba(37,99,235,.35); }
.ds-budget-caret{ color: #94a3b8; transition: transform .32s cubic-bezier(.22,.85,.35,1); }
.ds-budget-toggle[aria-expanded="true"] .ds-budget-caret{ transform: rotate(180deg); color: #2563eb; }
.ds-budget-perday{ display: grid; grid-template-rows: 1fr; }
.ds-budget-perday[hidden]{ display: none; }
.ds-budget-perday.is-collapsing{ grid-template-rows: 0fr; transition: grid-template-rows .26s cubic-bezier(.22,.85,.35,1); }
.ds-budget-days{ list-style: none; margin: 0; padding: .3rem .5rem .5rem; min-height: 0; overflow: hidden; }
.ds-budget-day{ display: grid; grid-template-columns: auto minmax(0,1fr) 84px auto; align-items: center; gap: .65rem; padding: .45rem .6rem; border-radius: .55rem; }
.ds-budget-day + .ds-budget-day{ border-top: 1px solid #f1f5f9; }
.ds-budget-day:hover{ background: #f8fbff; }
.ds-budget-day-n{ font-size: .72rem; font-weight: 700; color: #64748b; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ds-budget-day-ttl{ font-size: .8rem; font-weight: 600; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ds-budget-bar-mini{ height: 8px; }
.ds-budget-day-amt{ font-size: .82rem; font-weight: 700; color: #0f172a; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px){ .ds-budget-day{ grid-template-columns: auto minmax(0,1fr) auto; } .ds-budget-day .ds-budget-bar-mini{ display: none; } }
@media (prefers-reduced-motion: reduce){ .ds-budget-seg, .ds-budget-caret, .ds-budget-perday.is-collapsing{ transition: none; } }

/* =========================================
   Mapa del dia (.ds-map*) — diseno AgentUI
   ========================================= */
.ds-map-section{ margin-top: .85rem; border-top: 1px solid #eef2f6; }
.ds-map-toggle{ display: flex; align-items: center; gap: .55rem; width: 100%; padding: .7rem .25rem; border: 0; background: transparent; color: #1d4ed8; font-size: .84rem; font-weight: 700; cursor: pointer; border-radius: .55rem; transition: background .15s ease, color .15s ease; }
.ds-map-toggle:hover{ background: #eef4ff; padding-inline: .6rem; }
.ds-map-toggle:focus-visible{ outline: none; box-shadow: inset 0 0 0 2px rgba(37,99,235,.35); }
.ds-map-toggle-ico{ flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: .45rem; background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(109,40,217,.14)); color: #2563eb; font-size: .95rem; }
.ds-map-toggle-lbl{ flex: 1 1 auto; text-align: left; }
.ds-map-caret{ color: #94a3b8; font-size: .85rem; transition: transform .32s cubic-bezier(.22,.85,.35,1), color .15s ease; }
.ds-map-toggle[aria-expanded="true"] .ds-map-caret{ transform: rotate(180deg); color: #2563eb; }
.ds-map-panel{ display: grid; grid-template-rows: 1fr; }
.ds-map-panel[hidden]{ display: none; }
.ds-map-panel.is-collapsing{ grid-template-rows: 0fr; transition: grid-template-rows .28s cubic-bezier(.22,.85,.35,1); }
.ds-map-inner{ min-height: 0; overflow: hidden; }
.ds-map-panel:not(.is-collapsing) .ds-map-inner{ animation: dsMapIn .3s cubic-bezier(.22,.85,.35,1); }
@keyframes dsMapIn{ from{ opacity: 0; transform: translateY(-4px); } to{ opacity: 1; transform: translateY(0); } }
.ds-map-canvas{ position: relative; height: 260px; border-radius: .8rem; overflow: hidden; background: linear-gradient(135deg, #f1f5f9, #e2e8f0); border: 1px solid #e5e7eb; box-shadow: inset 0 0 0 1px rgba(15,23,42,.02); }
@media (max-width: 575.98px){ .ds-map-canvas{ height: 220px; } }
.ds-map-state{ position: absolute; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; color: #64748b; font-size: .84rem; font-weight: 600; text-align: center; padding: 1rem; background: linear-gradient(135deg, #f1f5f9, #e2e8f0); }
.ds-map-state[hidden]{ display: none; }
.ds-map-loading{ background: linear-gradient(90deg,#eef2f6 25%,#f5f7fb 37%,#eef2f6 63%); background-size: 400% 100%; animation: dsShine 1.2s ease-in-out infinite; }
.ds-map-empty i{ font-size: 1.5rem; color: #94a3b8; }
.ds-map-pin{ background: transparent !important; border: 0 !important; }
.ds-map-pin-n{ position: relative; display: grid; place-items: center; width: 26px; height: 26px; font-size: .8rem; font-weight: 800; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; background: linear-gradient(150deg, #3b82f6, #2563eb); border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 4px 10px rgba(29,78,216,.45), 0 1px 2px rgba(2,6,23,.3); }
.ds-map-pin-n > span{ transform: rotate(45deg); display: block; }
.ds-map-pin:hover .ds-map-pin-n{ filter: brightness(1.08); }
.ds-map-pin.is-active .ds-map-pin-n{ background: linear-gradient(150deg, #8b5cf6, #6d28d9); box-shadow: 0 6px 14px rgba(109,40,217,.5), 0 1px 2px rgba(2,6,23,.3); z-index: 1000; }
.leaflet-popup.ds-map-pop .leaflet-popup-content-wrapper{ border-radius: .7rem; box-shadow: 0 10px 26px rgba(2,6,23,.22); border: 1px solid #e5e7eb; padding: 0; }
.leaflet-popup.ds-map-pop .leaflet-popup-content{ margin: .55rem .7rem; min-width: 130px; line-height: 1.3; }
.leaflet-popup.ds-map-pop .leaflet-popup-tip{ box-shadow: 0 10px 26px rgba(2,6,23,.18); }
.ds-map-pop-name{ font-size: .84rem; font-weight: 700; color: #0f172a; display: block; }
.ds-map-pop-time{ display: inline-flex; align-items: center; gap: .25rem; margin-top: .2rem; font-size: .74rem; font-weight: 700; color: #1d4ed8; font-variant-numeric: tabular-nums; }
.ds-map-pop-time i{ font-size: .72rem; }
.ds-map-export{ display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.ds-map-exp{ flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem .8rem; border-radius: .6rem; font-size: .82rem; font-weight: 700; white-space: nowrap; cursor: pointer; border: 1px solid transparent; transition: filter .15s ease, background .15s ease, border-color .15s ease, transform .05s ease; }
.ds-map-exp i{ font-size: .9rem; }
.ds-map-exp:active{ transform: translateY(1px); }
.ds-map-exp:focus-visible{ outline: none; box-shadow: 0 0 0 .2rem rgba(37,99,235,.3); }
.ds-map-exp-gmaps{ color: #fff; border-color: transparent; background: linear-gradient(135deg, #2563eb, #6d28d9); box-shadow: 0 4px 12px rgba(37,99,235,.25); }
.ds-map-exp-gmaps:hover{ filter: brightness(1.06); color: #fff; }
.ds-map-exp-gpx{ color: #1d4ed8; background: #fff; border-color: #d8def0; }
.ds-map-exp-gpx:hover{ background: #f5f7ff; border-color: #c7d2fe; color: #1d4ed8; }
.ds-map-upsell{ margin-top: .75rem; }
.ds-map-upsell .ds-limit-ico{ background: rgba(37,99,235,.12); color: #2563eb; }
.ds-map-upsell .ds-limit-body{ color: #334155; }
.ds-map-upsell .ds-limit-body strong{ color: #1e3a8a; }
.ds-map-canvas .leaflet-container{ background: #e2e8f0; font: inherit; border-radius: .8rem; }
.ds-map-canvas .leaflet-control-attribution{ font-size: 9px; background: rgba(255,255,255,.78); color: #64748b; }
.ds-map-canvas .leaflet-control-attribution a{ color: #2563eb; }
.ds-map-canvas .leaflet-bar a{ color: #1f2937; }
@media (prefers-reduced-motion: reduce){ .ds-map-caret, .ds-map-panel.is-collapsing{ transition: none; } .ds-map-inner{ animation: none; } .ds-map-loading{ animation: none; background: #eef2f6; } }

/* Presupuesto plegable (colapsa a la cabecera) */
.ds-budget-head{ cursor: pointer; user-select: none; }
.ds-budget-head:hover{ background: linear-gradient(180deg, #eef4ff, #f8fafc); }
.ds-budget-head:focus-visible{ outline: none; box-shadow: inset 0 0 0 2px rgba(37,99,235,.35); }
.ds-budget:not(.is-open) .ds-budget-head{ border-bottom-color: transparent; }
.ds-budget-headcaret{ flex: 0 0 auto; align-self: center; color: #94a3b8; font-size: .85rem; margin-left: .15rem; transition: transform .3s cubic-bezier(.22,.85,.35,1), color .15s ease; }
.ds-budget.is-open .ds-budget-headcaret{ transform: rotate(180deg); color: #2563eb; }
.ds-budget-collapse{ display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s cubic-bezier(.22,.85,.35,1); }
.ds-budget.is-open .ds-budget-collapse{ grid-template-rows: 1fr; }
.ds-budget-collapse-inner{ min-height: 0; overflow: hidden; }
@media (prefers-reduced-motion: reduce){ .ds-budget-collapse, .ds-budget-headcaret{ transition: none; } }

/* =========================================================
   Recorrido del dia en el .ds-map del DETALLE (.ds-rmap*)
   Boton flotante estilo Maps + canvas Leaflet + barra control.
   Reutiliza .ds-map-pin / .ds-map-pop / .ds-map-exp / .ds-limit-note.
   ========================================================= */
.ds-map{ position: relative; overflow: hidden; }
.ds-map > img{ transition: opacity .28s ease, transform .35s cubic-bezier(.22,.85,.35,1); }

.ds-rmap-fab{
  position: absolute; left: 12px; bottom: 12px; z-index: 620;
  display: inline-flex; align-items: center; gap: .45rem;
  height: 38px; padding: 0 .85rem 0 .7rem;
  border: 1px solid rgba(15,23,42,.08); border-radius: 999px;
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #1d4ed8; font-size: .82rem; font-weight: 700; line-height: 1;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(2,6,23,.18), 0 1px 2px rgba(2,6,23,.12);
  transition: background .15s ease, box-shadow .15s ease, transform .06s ease, color .15s ease;
}
.ds-rmap-fab:hover{ background:#fff; box-shadow:0 8px 22px rgba(2,6,23,.24); }
.ds-rmap-fab:active{ transform: translateY(1px); }
.ds-rmap-fab:focus-visible{ outline:none; box-shadow:0 0 0 .2rem rgba(37,99,235,.35), 0 6px 18px rgba(2,6,23,.18); }
.ds-rmap-fab-ico{ display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: .9rem; background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(109,40,217,.16)); color: #2563eb; }
.ds-rmap-fab-lbl{ display: inline-block; }
.ds-map.is-route .ds-rmap-fab{ color:#6d28d9; }
.ds-map.is-route .ds-rmap-fab-ico{ background: linear-gradient(135deg, rgba(139,92,246,.16), rgba(109,40,217,.2)); color:#7c3aed; }

.ds-rmap-canvas{ position: absolute; inset: 0; z-index: 540; border-radius: inherit; overflow: hidden; opacity: 0; visibility: hidden; transform: scale(1.012); transition: opacity .3s ease, transform .35s cubic-bezier(.22,.85,.35,1), visibility 0s linear .3s; }
.ds-map.is-route .ds-rmap-canvas{ opacity: 1; visibility: visible; transform: none; transition: opacity .3s ease, transform .35s cubic-bezier(.22,.85,.35,1), visibility 0s; }
.ds-map.is-route > img{ opacity: 0; transform: scale(1.03); }
.ds-rmap-canvas .leaflet-container{ background:#e2e8f0; font: inherit; border-radius: inherit; }
.ds-rmap-canvas .leaflet-control-attribution{ font-size:9px; background:rgba(255,255,255,.78); color:#64748b; }
.ds-rmap-canvas .leaflet-control-attribution a{ color:#2563eb; }
.ds-rmap-canvas .leaflet-bar a{ color:#1f2937; }
.ds-rmap-canvas .leaflet-bottom.leaflet-right{ margin-bottom: 2px; }

.ds-rmap-loading{ position:absolute; inset:0; z-index:560; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.55rem; color:#64748b; font-size:.82rem; font-weight:600; border-radius: inherit; }
.ds-rmap-loading[hidden]{ display:none; }
.ds-rmap-spin{ width:24px; height:24px; border-radius:50%; border:2.5px solid rgba(37,99,235,.22); border-top-color:#2563eb; animation: dsRmapSpin .7s linear infinite; }
@keyframes dsRmapSpin{ to{ transform: rotate(360deg); } }

.ds-rmap-bar{ position:absolute; left:50%; bottom:12px; transform: translateX(-50%) translateY(6px); z-index:600; display:flex; align-items:center; gap:.4rem; max-width: calc(100% - 24px); padding:.32rem .4rem; border:1px solid rgba(15,23,42,.08); border-radius:999px; background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow:0 8px 22px rgba(2,6,23,.2), 0 1px 2px rgba(2,6,23,.12); opacity:0; pointer-events:none; transition: opacity .26s ease, transform .3s cubic-bezier(.22,.85,.35,1); }
.ds-rmap-bar[hidden]{ display:none; }
.ds-map.is-route .ds-rmap-bar{ opacity:1; pointer-events:auto; transform: translateX(-50%) translateY(0); }
.ds-rmap-back{ display:inline-flex; align-items:center; gap:.35rem; height:30px; padding:0 .65rem; border:0; border-radius:999px; background: linear-gradient(135deg,#2563eb,#6d28d9); color:#fff; font-size:.78rem; font-weight:700; cursor:pointer; white-space:nowrap; box-shadow:0 3px 9px rgba(37,99,235,.3); transition: filter .15s ease, transform .06s ease; }
.ds-rmap-back:hover{ filter:brightness(1.06); }
.ds-rmap-back:active{ transform: translateY(1px); }
.ds-rmap-back:focus-visible{ outline:none; box-shadow:0 0 0 .2rem rgba(37,99,235,.35); }
.ds-rmap-tag{ flex:0 0 auto; padding:0 .5rem; font-size:.74rem; font-weight:700; color:#475569; font-variant-numeric: tabular-nums; white-space:nowrap; }
.ds-rmap-exp{ display:inline-flex; gap:.35rem; }
.ds-rmap-bar .ds-map-exp{ flex:0 0 auto; height:30px; padding:0 .6rem; border-radius:999px; font-size:.76rem; min-width:0; }
.ds-rmap-bar .ds-map-exp i{ font-size:.82rem; }
.ds-rmap-upsell.ds-limit-note{ margin:0; padding:.3rem .55rem .3rem .4rem; gap:.45rem; border-radius:999px; background:#fffbeb; align-items:center; max-width: 240px; }
.ds-rmap-upsell .ds-limit-ico{ width:26px; height:26px; flex-basis:26px; font-size:.85rem; border-radius:50%; }
.ds-rmap-upsell .ds-limit-body{ font-size:.74rem; line-height:1.25; }
.ds-rmap-upsell .ds-limit-body strong{ margin-bottom:0; font-size:.76rem; }

@media (max-width: 575.98px){
  .ds-rmap-tag{ display:none; }
  .ds-rmap-back-txt, .ds-rmap-exp-txt{ display:none; }
  .ds-rmap-back, .ds-rmap-bar .ds-map-exp{ padding-inline:.55rem; }
  .ds-rmap-fab-lbl{ display:none; }
  .ds-rmap-fab{ padding:0; width:38px; justify-content:center; }
}
@media (prefers-reduced-motion: reduce){
  .ds-map > img, .ds-rmap-canvas, .ds-rmap-bar{ transition:none; }
  .ds-map.is-route > img{ transform:none; }
  .ds-rmap-canvas{ transform:none; }
  .ds-rmap-spin{ animation-duration:1.4s; }
}

/* Mapa-por-dia del timeline: solo en 1 columna (movil); en 2 columnas manda el mapa del detalle */
@media (min-width: 992px){ #deepseekInline .ds-map-section{ display: none; } }
@media (min-width: 992px){ .ds-map-section{ display: none; } }

.ds-budget-usd{ font-size:.78rem; font-weight:600; color:#64748b; white-space:nowrap; }

/* Pin de la parada SELECCIONADA: mas grande + violeta para ubicarse rapido entre N pines */
.ds-map-pin.is-active .ds-map-pin-n{ transform: rotate(-45deg) scale(1.34); font-size: .92rem; border-width: 2.5px; }

/* =========================================================
   CHAT CONVERSACIONAL (.ds-chat*) — diseno AgentUI
   FAB flotante + panel popover (desktop) / bottom-sheet (movil).
   ========================================================= */
.ds-chat-fab{ position: fixed; right: 22px; bottom: 22px; z-index: 1095; width: 60px; height: 60px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #6d28d9); color: #fff; cursor: pointer; box-shadow: 0 12px 30px rgba(109,40,217,.42), 0 3px 8px rgba(2,6,23,.25); transition: transform .18s cubic-bezier(.22,.85,.35,1), box-shadow .2s ease, filter .15s ease; }
.ds-chat-fab:hover{ transform: translateY(-2px) scale(1.04); filter: brightness(1.05); box-shadow: 0 16px 38px rgba(109,40,217,.5), 0 3px 8px rgba(2,6,23,.28); }
.ds-chat-fab:active{ transform: translateY(0) scale(.97); }
.ds-chat-fab:focus-visible{ outline: 0; box-shadow: 0 0 0 4px rgba(139,92,246,.4), 0 12px 30px rgba(109,40,217,.42); }
.ds-chat-fab-ico{ font-size: 1.5rem; line-height: 1; display: grid; place-items: center; transition: transform .25s cubic-bezier(.22,.85,.35,1); }
.ds-chat-fab::before{ content:""; position:absolute; inset:0; border-radius:50%; background: inherit; z-index:-1; opacity:.55; animation: dsChatPulse 2.8s ease-out infinite; }
@keyframes dsChatPulse{ 0%{ transform: scale(1); opacity:.5; } 70%,100%{ transform: scale(1.5); opacity:0; } }
.ds-chat-fab.is-open{ transform: scale(.9); box-shadow: 0 6px 16px rgba(2,6,23,.25); }
.ds-chat-fab.is-open::before{ animation: none; }
.ds-chat-fab.is-open .ds-chat-fab-ico{ transform: rotate(90deg); }
.ds-chat-fab-badge{ position: absolute; top: -3px; right: -3px; min-width: 22px; height: 18px; padding: 0 .3rem; display: grid; place-items: center; font-size: .6rem; font-weight: 800; letter-spacing: .03em; color: #6d28d9; background: #fff; border-radius: 999px; box-shadow: 0 2px 6px rgba(2,6,23,.25); }
.ds-chat-fab.is-open .ds-chat-fab-badge{ opacity: 0; transition: opacity .15s ease; }
.ds-chat-fab-lock{ position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; display: none; place-items: center; font-size: .7rem; color: #475569; background: #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(2,6,23,.22); }
.ds-chat-fab.is-locked{ background: linear-gradient(135deg, #64748b, #475569); box-shadow: 0 10px 24px rgba(2,6,23,.3); }
.ds-chat-fab.is-locked::before{ animation: none; }
.ds-chat-fab.is-locked .ds-chat-fab-badge{ display: none; }
.ds-chat-fab.is-locked .ds-chat-fab-lock{ display: grid; }
.ds-chat-gate{ position: fixed; right: 22px; bottom: 92px; z-index: 1096; width: 244px; padding: .85rem .95rem; background: #fff; border: 1px solid #e5e7eb; border-radius: .9rem; box-shadow: 0 16px 38px rgba(2,6,23,.2); font-size: .84rem; color: #334155; transform-origin: bottom right; animation: dsChatGateIn .22s cubic-bezier(.22,.85,.35,1); }
.ds-chat-gate[hidden]{ display: none; }
.ds-chat-gate::after{ content:""; position:absolute; right: 20px; bottom: -7px; width: 14px; height: 14px; background: inherit; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; transform: rotate(45deg); }
.ds-chat-gate strong{ display:block; color:#0f172a; margin-bottom:.15rem; font-size:.86rem; }
.ds-chat-gate p{ margin: 0 0 .6rem; color:#64748b; line-height:1.35; }
.ds-chat-gate-actions{ display:flex; gap:.4rem; }
.ds-chat-gate-actions a{ flex:1 1 0; text-align:center; padding:.4rem .5rem; border-radius:.55rem; font-size:.78rem; font-weight:700; text-decoration:none; }
.ds-chat-gate-primary{ color:#fff; background: linear-gradient(135deg,#2563eb,#6d28d9); }
.ds-chat-gate-ghost{ color:#1d4ed8; background:#fff; border:1px solid #d8def0; }
@keyframes dsChatGateIn{ from{ opacity:0; transform: translateY(6px) scale(.96); } to{ opacity:1; transform:none; } }
.ds-chat-panel{ position: fixed; right: 22px; bottom: 92px; z-index: 1094; width: 384px; max-width: calc(100vw - 32px); height: 70vh; max-height: 620px; display: flex; flex-direction: column; background: #fff; border: 1px solid #e5e7eb; border-radius: 1.1rem; box-shadow: 0 24px 60px rgba(2,6,23,.28), 0 4px 12px rgba(2,6,23,.12); overflow: hidden; transform-origin: bottom right; animation: dsChatOpen .26s cubic-bezier(.22,.85,.35,1); }
.ds-chat-panel[hidden]{ display: none; }
.ds-chat-panel.is-closing{ animation: dsChatClose .2s ease forwards; }
@keyframes dsChatOpen{ from{ opacity:0; transform: translateY(14px) scale(.94); } to{ opacity:1; transform: none; } }
@keyframes dsChatClose{ from{ opacity:1; transform: none; } to{ opacity:0; transform: translateY(10px) scale(.97); } }
.ds-chat-head{ flex: 0 0 auto; display: flex; align-items: center; gap: .65rem; padding: .75rem .85rem; border-bottom: 1px solid #eef2f6; background: linear-gradient(135deg, rgba(37,99,235,.06), rgba(109,40,217,.07)); }
.ds-chat-head-ico{ flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: .6rem; color: #fff; font-size: 1rem; background: linear-gradient(135deg, #2563eb, #6d28d9); box-shadow: 0 4px 12px rgba(109,40,217,.3); }
.ds-chat-head-txt{ display: grid; line-height: 1.2; min-width: 0; }
.ds-chat-head-txt strong{ font-size: .9rem; color: #0f172a; }
.ds-chat-head-txt small{ font-size: .72rem; color: #64748b; }
.ds-chat-x{ margin-left: auto; flex: 0 0 auto; border: 0; background: transparent; width: 32px; height: 32px; border-radius: 50%; color: #94a3b8; display: grid; place-items: center; cursor: pointer; font-size: .85rem; transition: background .15s ease, color .15s ease; }
.ds-chat-x:hover{ background: rgba(100,116,139,.12); color: #475569; }
.ds-chat-x:focus-visible{ outline: 0; box-shadow: 0 0 0 .2rem rgba(139,92,246,.3); }
.ds-chat-msgs{ flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1rem .9rem .5rem; display: flex; flex-direction: column; gap: .6rem; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.ds-chat-msgs::-webkit-scrollbar{ width: 8px; }
.ds-chat-msgs::-webkit-scrollbar-thumb{ background: #cbd5e1; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.ds-chat-msgs::-webkit-scrollbar-thumb:hover{ background: #94a3b8; background-clip: padding-box; }
.ds-chat-empty{ margin: auto 0; padding: .5rem .3rem 0; text-align: center; }
.ds-chat-empty-ico{ width: 52px; height: 52px; margin: 0 auto .7rem; display: grid; place-items: center; border-radius: 50%; font-size: 1.4rem; color: #6d28d9; background: linear-gradient(135deg, rgba(37,99,235,.1), rgba(109,40,217,.14)); }
.ds-chat-empty-txt{ font-size: .85rem; color: #64748b; line-height: 1.4; margin: 0 auto 1rem; max-width: 270px; }
.ds-chat-suggest{ display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.ds-chat-chip{ font-size: .78rem; font-weight: 600; line-height: 1; padding: .45rem .75rem; border-radius: 999px; color: #475569; background: #fff; border: 1px solid #e2e8f0; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease; }
.ds-chat-chip:hover{ border-color: #c7d2fe; background: #f5f7ff; color: #1e293b; }
.ds-chat-chip:active{ transform: scale(.96); }
.ds-chat-chip:focus-visible{ outline: 0; box-shadow: 0 0 0 .2rem rgba(37,99,235,.22); }
.ds-chat-row{ display: flex; align-items: flex-end; gap: .5rem; max-width: 100%; animation: dsChatRowIn .26s cubic-bezier(.22,.85,.35,1); }
.ds-chat-row.is-user{ flex-direction: row-reverse; }
@keyframes dsChatRowIn{ from{ opacity:0; transform: translateY(6px); } to{ opacity:1; transform:none; } }
.ds-chat-ava{ flex: 0 0 28px; width: 28px; height: 28px; margin-bottom: 1px; display: grid; place-items: center; border-radius: 50%; font-size: .8rem; color: #fff; background: linear-gradient(135deg, #2563eb, #6d28d9); box-shadow: 0 2px 8px rgba(109,40,217,.28); }
.ds-chat-ava.is-error{ background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 2px 8px rgba(217,119,6,.3); }
.ds-chat-bubble{ max-width: 80%; padding: .6rem .8rem; border-radius: 1rem; font-size: .86rem; line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; }
.ds-chat-bubble.is-assistant{ color: #1f2937; background: #f1f5f9; border: 1px solid #e8edf5; border-bottom-left-radius: .35rem; }
.ds-chat-bubble.is-user{ color: #fff; background: linear-gradient(135deg, #2563eb, #6d28d9); border-bottom-right-radius: .35rem; box-shadow: 0 4px 12px rgba(37,99,235,.22); }
.ds-chat-bubble.is-error{ color: #92400e; background: #fffbeb; border: 1px solid rgba(217,119,6,.35); border-bottom-left-radius: .35rem; font-size: .82rem; font-weight: 600; }
.ds-chat-pill{ display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700; line-height: 1; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.ds-chat-pill-ico{ display: inline-flex; align-items: center; }
.ds-chat-pill.is-busy{ color: #6d28d9; background: linear-gradient(135deg, rgba(37,99,235,.1), rgba(109,40,217,.12)); border: 1px solid rgba(109,40,217,.22); }
.ds-chat-pill.is-done{ color: #16a34a; background: rgba(22,163,74,.1); border: 1px solid rgba(22,163,74,.25); animation: dsChatPillPop .4s cubic-bezier(.22,.85,.35,1); }
.ds-chat-pill.is-failed{ color: #b45309; background: #fffbeb; border: 1px solid rgba(217,119,6,.3); }
@keyframes dsChatPillPop{ 0%{ transform: scale(.92); } 50%{ transform: scale(1.04); } 100%{ transform: scale(1); } }
.ds-chat-pill-bars{ display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.ds-chat-pill-bars i{ display: block; width: 3px; height: 100%; border-radius: 2px; background: linear-gradient(180deg, #2563eb, #6d28d9); transform-origin: bottom; animation: dsChatBars 1s ease-in-out infinite; }
.ds-chat-pill-bars i:nth-child(2){ animation-delay: .18s; }
.ds-chat-pill-bars i:nth-child(3){ animation-delay: .36s; }
@keyframes dsChatBars{ 0%,100%{ transform: scaleY(.4); } 50%{ transform: scaleY(1); } }
.ds-chat-typing .ds-chat-bubble{ display: inline-flex; align-items: center; gap: .3rem; padding: .7rem .85rem; }
.ds-chat-typing-dot{ width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: dsChatTyping 1.2s ease-in-out infinite; }
.ds-chat-typing-dot:nth-child(2){ animation-delay: .18s; }
.ds-chat-typing-dot:nth-child(3){ animation-delay: .36s; }
@keyframes dsChatTyping{ 0%, 60%, 100%{ transform: translateY(0); opacity: .45; } 30%{ transform: translateY(-4px); opacity: 1; } }
.ds-chat-composer{ flex: 0 0 auto; display: flex; align-items: flex-end; gap: .5rem; padding: .65rem .75rem .75rem; border-top: 1px solid #eef2f6; background: #fbfcfe; }
.ds-chat-input{ flex: 1 1 auto; min-width: 0; resize: none; max-height: 110px; padding: .55rem .75rem; font-size: .86rem; line-height: 1.4; color: #0f172a; background: #fff; border: 1px solid #d8def0; border-radius: .85rem; transition: border-color .15s ease, box-shadow .15s ease; scrollbar-width: thin; }
.ds-chat-input::placeholder{ color: #94a3b8; }
.ds-chat-input:focus{ outline: 0; border-color: #8b5cf6; box-shadow: 0 0 0 .2rem rgba(139,92,246,.16); }
.ds-chat-send{ flex: 0 0 40px; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; cursor: pointer; font-size: .9rem; background: linear-gradient(135deg, #2563eb, #6d28d9); box-shadow: 0 4px 12px rgba(109,40,217,.28); transition: filter .15s ease, transform .06s ease, opacity .15s ease; }
.ds-chat-send:hover:not(:disabled){ filter: brightness(1.06); }
.ds-chat-send:active:not(:disabled){ transform: scale(.94); }
.ds-chat-send:focus-visible{ outline: 0; box-shadow: 0 0 0 .2rem rgba(139,92,246,.4); }
.ds-chat-send:disabled{ opacity: .4; cursor: default; box-shadow: none; }
/* Aro de créditos de IA alrededor del botón de enviar (arco = créditos restantes) */
.ds-chat-send{ position: relative; }
.ds-chat-cred{ position: absolute; inset: -4px; transform: rotate(-90deg); pointer-events: none; overflow: visible; }
.ds-chat-cred-track{ fill: none; stroke: rgba(0,0,0,.10); stroke-width: 2.5; }
.ds-chat-cred-arc{ fill: none; stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset .45s ease, stroke .45s ease; }
.ds-chat-cred.is-green  .ds-chat-cred-arc{ stroke: #22c55e; }
.ds-chat-cred.is-orange .ds-chat-cred-arc{ stroke: #f59e0b; }
.ds-chat-cred.is-red    .ds-chat-cred-arc{ stroke: #ef4444; }
/* Botón de micrófono (entrada por voz) */
.ds-chat-mic{ flex: 0 0 40px; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: .95rem; color: #6d28d9; background: rgba(109,40,217,.09); transition: background .15s ease, color .15s ease, transform .06s ease; }
.ds-chat-mic:hover{ background: rgba(109,40,217,.17); }
.ds-chat-mic:active{ transform: scale(.94); }
.ds-chat-mic:focus-visible{ outline: 0; box-shadow: 0 0 0 .2rem rgba(139,92,246,.35); }
.ds-chat-mic.is-listening{ color: #fff; background: #ef4444; animation: dsMicPulse 1.2s ease-in-out infinite; }
@keyframes dsMicPulse{ 0%,100%{ box-shadow: 0 0 0 0 rgba(239,68,68,.45); } 50%{ box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
.ds-chat-backdrop{ position: fixed; inset: 0; z-index: 1093; background: rgba(2,6,23,.45); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; display:none; }
@media (max-width: 991.98px){
  .ds-chat-fab{ right: 16px; bottom: 16px; }
  .ds-chat-panel{ right: 0; left: 0; bottom: 0; top: auto; width: 100%; max-width: 100%; height: 88vh; height: 88dvh; max-height: none; border-radius: 1.1rem 1.1rem 0 0; border-left: 0; border-right: 0; border-bottom: 0; box-shadow: 0 -18px 50px rgba(2,6,23,.28); animation: dsChatSheetIn .3s cubic-bezier(.22,.85,.35,1); }
  .ds-chat-panel.is-closing{ animation: dsChatSheetOut .26s ease forwards; }
  @keyframes dsChatSheetIn{ from{ transform: translateY(102%); } to{ transform: none; } }
  @keyframes dsChatSheetOut{ from{ transform: none; } to{ transform: translateY(102%); } }
  .ds-chat-head{ position: relative; padding-top: 1.1rem; }
  .ds-chat-head::before{ content:""; position:absolute; top:.45rem; left:50%; transform: translateX(-50%); width: 44px; height: 5px; border-radius: 999px; background: #cbd5e1; }
  .ds-chat-gate{ right: 16px; bottom: 82px; }
  .ds-chat-backdrop{ display:block; }
  .ds-chat-backdrop.is-show{ opacity: 1; visibility: visible; transition: opacity .25s ease, visibility 0s; }
}
@media (prefers-reduced-motion: reduce){
  .ds-chat-fab, .ds-chat-fab-ico, .ds-chat-panel, .ds-chat-row, .ds-chat-pill, .ds-chat-gate{ animation: none !important; transition: none !important; }
  .ds-chat-fab::before{ animation: none; opacity: 0; }
  .ds-chat-typing-dot, .ds-chat-pill-bars i{ animation-duration: 1.6s; }
}
