/* Centro de ayuda (ayuda.js) y tour de capacitación por capítulos (tour.js). Se carga después de shell.css. */

/* ───────── Ayuda ───────── */
.ayuda { display: grid; gap: 20px; min-width: 0; }
.ayuda.is-field { padding: 0; gap: 16px; }
.ay-hero { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px 22px; align-items: center; padding: 26px 28px 24px; border-radius: 24px;
  background: var(--vc-carbon, #141519); color: #fff; overflow: hidden; isolation: isolate; animation: vcRise .4s var(--vc-ease) both; }
.ay-hero::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(253, 178, 7, .1); z-index: -1; }
.ay-hero-art { width: 104px; height: 104px; border-radius: 28px; background: rgba(253, 178, 7, .12); display: grid; place-items: center; animation: vcIconPop .6s var(--vc-ease) both; }
.ay-hero-txt { min-width: 0; }
.ay-kicker { display: inline-block; font-size: 0.7188rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--vc-oro, #FDB207); margin-bottom: 4px; }
.ay-hero h1 { font-family: var(--titulo); font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 6px; color: #fff; }
.ay-hero p { margin: 0; color: #C9C5BC; font-size: 0.9375rem; line-height: 1.5; max-width: 62ch; }
.ay-search { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; background: #fff; color: var(--vc-tinta); border-radius: 16px; padding: 0 16px; min-height: 54px;
  box-shadow: 0 0 0 3px rgba(253, 178, 7, .35); }
.ay-search svg { color: var(--acero-500); flex: none; }
.ay-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 1rem; background: transparent; color: inherit; min-height: 50px; }
.ay-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.ay-act { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05);
  color: #fff; font: inherit; cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--vc-ease); min-width: 0; }
.ay-act:hover { background: rgba(253, 178, 7, .12); border-color: rgba(253, 178, 7, .5); transform: translateY(-2px); }
.ay-act span { display: grid; min-width: 0; }
.ay-act b { font-size: 0.9063rem; }
.ay-act small { color: #A9A49A; font-size: 0.7813rem; }

.ay-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ay-sec-head h2 { font-family: var(--titulo); font-size: 1.125rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.ay-results { padding: 18px; animation: vcRise .3s var(--vc-ease) both; }
.ay-res-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ay-res { border: 1px solid var(--vc-linea); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; background: var(--vc-papel); min-width: 0; }
.ay-res h3 { font-size: 0.9375rem; margin: 2px 0 0; }
.ay-res p { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--vc-texto-2, #59554D); overflow-wrap: anywhere; }
.ay-res .link-btn { justify-self: start; font-weight: 700; }
.ay-tag { display: inline-block; font-size: 0.6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--vc-arena); color: var(--vc-oro-texto, #8A5A00); }
.ay-tag.guia { background: var(--vc-info-bg); color: var(--vc-info); }
.ay-res-ask { margin-top: 12px; }
.ay-res-ask .btn { max-width: 100%; white-space: normal; text-align: left; }

.ay-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ay-chat-wrap { position: sticky; top: 76px; scroll-margin-top: 80px; min-width: 0; }
.ay-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: min(620px, calc(100vh - 120px)); min-height: 440px; }
.ay-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--vc-linea); background: var(--vc-papel); }
.ay-chat-head h2 { font-family: var(--titulo); font-size: 1.0625rem; font-weight: 800; margin: 0; }
.ay-chat-head small { color: var(--vc-texto-3, #736E64); font-size: 0.7813rem; }
.ay-bot { position: relative; display: inline-grid; }
.ay-online { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #22A35A; border: 2px solid #fff; }
.ay-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--vc-arena, #F4F1EA); overscroll-behavior: contain; }
.ay-msg { display: grid; gap: 4px; max-width: 88%; animation: vcRise .25s var(--vc-ease) both; }
.ay-msg.user { align-self: flex-end; justify-items: end; }
.ay-msg.model { align-self: flex-start; }
.ay-bubble { padding: 10px 14px; border-radius: 18px; font-size: 0.9375rem; line-height: 1.5; overflow-wrap: anywhere; min-width: 0; }
.ay-msg.user .ay-bubble { background: var(--vc-oro, #FDB207); color: var(--vc-tinta); border-bottom-right-radius: 6px; font-weight: 500; }
.ay-msg.model .ay-bubble { background: #fff; color: var(--vc-tinta); border-bottom-left-radius: 6px; box-shadow: var(--sombra-1); }
.ay-bubble p { margin: 0 0 6px; }
.ay-bubble p:last-child { margin-bottom: 0; }
.ay-bubble .vz-md { font-size: 0.9375rem; }
.ay-bubble .vz-md h4 { font-size: 0.7813rem; }
.ay-meta { font-size: 0.75rem; color: var(--vc-texto-3, #736E64); padding: 0 6px; }
.ay-src { display: inline-flex; align-items: center; gap: 4px; }
.ay-src.ia { color: var(--vc-oro-texto, #8A5A00); font-weight: 700; }
.ay-rel { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px; }
.ay-rel-btn, .ay-sug { font: inherit; font-size: 0.8125rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--vc-linea); background: #fff; color: var(--vc-tinta);
  cursor: pointer; text-align: left; transition: border-color .2s, background .2s; max-width: 100%; }
.ay-rel-btn:hover, .ay-sug:hover { border-color: var(--vc-oro); background: var(--vc-crema, #FFF8E6); }
.ay-sugs { display: flex; flex-wrap: wrap; gap: 8px; }
.ay-typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.ay-typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--acero-400); animation: ayDot 1.2s infinite ease-in-out; }
.ay-typing i:nth-child(2) { animation-delay: .15s; }
.ay-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ayDot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-5px); opacity: 1; } }
.ay-input { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--vc-linea); background: #fff; }
.ay-input textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--vc-linea); border-radius: 16px; padding: 12px 14px; font: inherit; font-size: 1rem; max-height: 120px; min-height: 48px;
  background: var(--vc-hover, #FBF8F1); color: var(--vc-tinta); field-sizing: content; }
.ay-input textarea:focus { outline: 0; border-color: var(--vc-oro); box-shadow: 0 0 0 3px rgba(253, 178, 7, .25); }
.ay-send { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--vc-carbon); color: var(--vc-oro); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .15s; }
.ay-send:disabled { opacity: .35; cursor: default; }
.ay-send:not(:disabled):active { transform: scale(.92); }

.ay-faq { padding: 18px; scroll-margin-top: 80px; }
.ay-temas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ay-tema { font: inherit; font-size: 0.8125rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--vc-linea); background: #fff; color: var(--vc-texto-2, #59554D); cursor: pointer; }
.ay-tema.on { background: var(--vc-carbon); border-color: var(--vc-carbon); color: #fff; }
.ay-faq-list { display: grid; gap: 8px; }
.ay-q { border: 1px solid var(--vc-linea); border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.ay-q[open] { border-color: rgba(253, 178, 7, .7); box-shadow: 0 6px 18px -10px rgba(20, 19, 15, .25); }
.ay-q summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; font-weight: 700; font-size: 0.9375rem; }
.ay-q summary::-webkit-details-marker { display: none; }
.ay-q summary span { flex: 1; min-width: 0; }
.ay-q-chev { flex: none; color: var(--acero-400); transition: transform .2s; transform: rotate(90deg); }
.ay-q[open] .ay-q-chev { transform: rotate(-90deg); color: var(--vc-oro-texto); }
.ay-a { padding: 0 14px 14px; }
.ay-a p { margin: 0 0 10px; font-size: 0.9063rem; line-height: 1.55; color: var(--vc-texto-2, #59554D); }
.ay-a-acts { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ay-a-acts .link-btn { font-weight: 700; font-size: 0.8438rem; }

.ay-guide { display: grid; gap: 18px; }
.ay-guide-head h2 { font-family: var(--titulo); font-size: 1.375rem; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.02em; }
.ay-guide-head p { margin: 0; }
.ay-group { display: grid; gap: 10px; }
.ay-group-head { display: flex; align-items: center; gap: 10px; }
.ay-group-head h3 { font-size: 1rem; font-weight: 800; margin: 0; }
.ay-count { font-size: 0.75rem; font-weight: 800; color: var(--vc-oro-texto); background: var(--vc-crema, #FFF8E6); border-radius: 999px; padding: 2px 8px; }
.ay-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ay-card { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 18px; background: #fff; border: 1px solid var(--vc-linea); box-shadow: var(--sombra-card);
  transition: transform .2s var(--vc-ease), box-shadow .2s, border-color .2s; min-width: 0; }
.ay-card:hover { transform: translateY(-2px); border-color: rgba(253, 178, 7, .6); }
.ay-card.open { border-color: var(--vc-oro); }
.ay-card-top { display: flex; gap: 12px; align-items: flex-start; }
.ay-card h4 { font-size: 1rem; font-weight: 800; margin: 2px 0 2px; }
.ay-benefit { margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--vc-oro-texto, #8A5A00); line-height: 1.4; }
.ay-what { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--vc-texto-2, #59554D); overflow-wrap: anywhere; }
.ay-card:not(.open) .ay-what { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ay-steps { display: grid; gap: 6px; background: var(--vc-arena); border-radius: 12px; padding: 12px 14px; animation: vcRise .25s var(--vc-ease) both; }
.ay-steps strong { font-size: 0.8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--vc-texto-2); }
.ay-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 0.875rem; line-height: 1.45; }
.ay-tip { display: flex; gap: 8px; align-items: flex-start; font-size: 0.8438rem; color: var(--vc-info); background: var(--vc-info-bg); border-radius: 10px; padding: 8px 10px; margin-top: 4px; }
.ay-tip svg { flex: none; margin-top: 2px; }
.ay-card-acts { display: flex; align-items: center; gap: 8px; }
.ay-card-acts .link-btn { font-weight: 700; }

.tech-top .tech-help { border-radius: 50%; color: var(--acero-600); }
.tech-top .tech-help[aria-current='page'] { color: var(--vc-oro-texto); background: var(--vc-crema, #FFF8E6); }

@media (max-width: 900px) {
  .ay-grid { grid-template-columns: minmax(0, 1fr); }
  .ay-chat-wrap { position: static; }
  .ay-chat { height: min(560px, 78vh); }
}
@media (max-width: 640px) {
  .ay-hero { grid-template-columns: 1fr; padding: 20px 18px; border-radius: 20px; gap: 12px; }
  .ay-hero-art { width: 76px; height: 76px; border-radius: 22px; }
  .ay-hero-art .i3d { width: 60px !important; height: 60px !important; }
  .ay-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ay-act { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .ay-act small { display: none; }
  .ay-cards, .ay-res-list { grid-template-columns: minmax(0, 1fr); }
  .ay-msg { max-width: 94%; }
  .ay-faq, .ay-results { padding: 14px; }
}

/* ───────── Tour por capítulos ───────── */
.tour { z-index: 2700; }
.tour-card { width: min(400px, calc(100vw - 32px)); padding: 16px 20px 16px; overflow: hidden; max-height: calc(100vh - 32px); overflow-y: auto; display: grid; gap: 8px; }
.tour.is-center .tour-card { width: min(520px, calc(100vw - 32px)); padding: 16px 24px 18px; }
.tour-prog { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--acero-100, #E9ECF0); }
.tour-prog span { display: block; height: 100%; background: var(--vc-oro, #FDB207); transition: width .4s var(--vc-ease); }
.tour-art { width: 76px; height: 76px; border-radius: 20px; margin: 4px 0 2px; }
.tour-benefit { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 0.875rem; font-weight: 600; line-height: 1.4; color: var(--vc-ok, #1D7A4B); background: var(--vc-ok-bg, #E7F4EC);
  border-radius: 12px; padding: 9px 12px; animation: vcRise .4s .08s var(--vc-ease) both; }
.tour-benefit svg { flex: none; margin-top: 1px; }
.tour-how { text-align: left; border-radius: 12px; background: var(--vc-arena, #F4F1EA); padding: 8px 12px; font-size: 0.875rem; }
.tour-how summary { cursor: pointer; font-weight: 700; font-size: 0.8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--vc-texto-2, #59554D); }
.tour-how ol { margin: 6px 0 2px; padding-left: 20px; display: grid; gap: 4px; line-height: 1.45; }
.tour-acts { flex-wrap: wrap; row-gap: 4px; }

.tour-hero { display: grid; justify-items: center; text-align: center; gap: 8px; }
.tour-hero-art { width: 120px; height: 120px; border-radius: 32px; display: grid; place-items: center; background: var(--vc-carbon, #141519); margin-top: 8px; animation: vcIconPop .6s var(--vc-ease) both; }
.tour-kicker { font-size: 0.7188rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--vc-oro-texto, #8A5A00); }
.tour-hero .tour-t { font-size: 1.5625rem; }
.tour-wins { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 2px 0 4px; }
.tour-win { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 700; padding: 6px 11px; border-radius: 999px; background: var(--vc-crema, #FFF8E6); color: var(--vc-oro-texto, #8A5A00); }
.tour-chaps { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 4px; }
.tour-chap { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 10px; border-radius: 14px; border: 1px solid var(--vc-linea, #E8E3D9); background: #fff; font: inherit; cursor: pointer;
  color: var(--vc-tinta); transition: border-color .2s, background .2s; min-width: 0; }
.tour-chap:hover { border-color: var(--vc-oro); background: var(--vc-crema, #FFF8E6); }
.tour-chap span { display: grid; min-width: 0; }
.tour-chap b { font-size: 0.8438rem; line-height: 1.2; }
.tour-chap small { font-size: 0.75rem; color: var(--vc-texto-3, #736E64); }
.tour-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0; }
.tour-li { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 600; padding: 5px 10px 5px 6px; border-radius: 999px; background: var(--vc-arena, #F4F1EA); }
.tour-next-steps { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 6px; }
.tour-ns { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; border-radius: 16px; border: 1px solid var(--vc-linea); background: #fff; font: inherit; cursor: pointer; color: var(--vc-tinta); }
.tour-ns:hover { border-color: var(--vc-oro); background: var(--vc-crema, #FFF8E6); }
.tour-ns span { display: grid; min-width: 0; }
.tour-ns b { font-size: 0.875rem; }
.tour-ns small { font-size: 0.75rem; color: var(--vc-texto-3, #736E64); }

/* Celular: la tarjeta es una hoja abajo (o arriba si lo iluminado está abajo). */
.tour.is-dock .tour-card { left: 8px !important; right: 8px; width: auto; max-height: 52vh; border-radius: 22px; }
.tour.is-dock.dock-bottom .tour-card { top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); animation: vcSheet .35s var(--vc-ease) both; }
.tour.is-dock.dock-top .tour-card { top: calc(8px + env(safe-area-inset-top, 0px)) !important; bottom: auto; }
.tour.is-dock .tour-art { display: none; }
@media (max-width: 640px) {
  .tour.is-center .tour-card { padding: 16px 18px 16px; max-height: calc(100vh - 24px); }
  .tour-hero-art { width: 92px; height: 92px; border-radius: 26px; }
  .tour-hero-art .i3d { width: 72px !important; height: 72px !important; }
  .tour-hero .tour-t { font-size: 1.3125rem; }
  .tour-chaps { grid-template-columns: 1fr 1fr; }
  .tour-chap { padding: 8px; gap: 8px; }
}
