/* Componente aislado; fuentes, colores y recursos del propio proyecto. */
.kapi { position: fixed; z-index: 90; right: 24px; bottom: max(24px, env(safe-area-inset-bottom)); font-family: "Instrument Sans", sans-serif; color: #12315b; text-align: left; }
.kapi [hidden] { display: none !important; }
.kapi button, .kapi input, .kapi a { font-family: inherit; font-synthesis: none; }
.kapi button { cursor: pointer; margin: 0; }
.kapi button:focus-visible, .kapi a:focus-visible { outline: 3px solid #e8ad00; outline-offset: 3px; }
.kapi-launcher { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; color: #012b6f; text-align: left; }
.kapi-invitation { display: grid; gap: 2px; padding: 11px 17px; border: 1px solid #dce6f2; border-radius: 14px 14px 3px 14px; background: #fff; box-shadow: 0 5px 24px #00193d26; }
.kapi-invitation strong { font-size: 13px; font-weight: 700; }
.kapi-invitation > span { font-size: 11px; color: #5b708b; }
.kapi-face { position: relative; display: grid; place-items: center; width: 66px; height: 66px; border: 2px solid #ffec95; border-radius: 50%; background: #ffd43a; box-shadow: 0 6px 28px #001b4d47, 0 0 0 5px #ffffff15; transition: transform .2s; }
.kapi-face img { display: block; width: 56px; height: 56px; }
.kapi-launcher:hover .kapi-face { transform: translateY(-3px) rotate(-4deg); }
.kapi-dot { position: absolute; right: 1px; bottom: 3px; width: 13px; height: 13px; border: 3px solid #fff; border-radius: 50%; background: #247d62; }
.kapi-is-open .kapi-invitation { display: none; }
.kapi-panel { position: absolute; right: 0; bottom: 82px; display: flex; flex-direction: column; width: 390px; height: min(590px, calc(100dvh - 138px)); min-height: 240px; max-width: calc(100vw - 32px); overflow: hidden; border: 1px solid #d9e3ef; border-radius: 20px; background: #f3f6fa; box-shadow: 0 22px 70px #001b4d40, 0 2px 10px #001b4d14; animation: kapi-reveal .2s ease-out; }
.kapi-panel:focus { outline: none; }
.kapi-header { position: static; display: flex; align-items: center; gap: 11px; flex-shrink: 0; min-height: 91px; margin: 0; padding: 17px 19px; border: 0; background: #012b6f; color: #fff; }
.kapi-header-avatar { display: block; width: 48px; height: 48px; padding: 2px; border-radius: 50%; background: #ffd43a; }
.kapi .kapi-heading h2 { margin: 0 0 4px; color: #fff; font: 700 22px/1.1 "Neusharp", sans-serif; letter-spacing: 0; text-transform: none; }
.kapi-heading p { margin: 0; font-size: 12px; color: #d6e3f6; line-height: 1.3; }
.kapi-close { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; margin-left: auto !important; padding: 8px; border: 1px solid #ffffff26; border-radius: 50%; background: #ffffff0c; color: #fff; }
.kapi-close:hover { background: #ffffff25; }
.kapi-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.kapi-chat { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px; scrollbar-width: thin; scrollbar-color: #b7c8dc transparent; }
.kapi-message { padding: 15px; border: 1px solid #e1e8f1; border-radius: 3px 15px 15px; margin: 0 13px 14px 0; background: #fff; animation: kapi-reveal .18s ease-out; overflow-wrap: anywhere; }
.kapi-message p { margin: 0; font-size: 13px; line-height: 1.6; color: #294567; }
.kapi-byline { display: block; margin-bottom: 5px; font-size: 10px; font-weight: 700; color: #6b7e96; letter-spacing: .05em; }
.kapi-message-user { margin-left: 40px; margin-right: 0; border: 0; border-radius: 14px 3px 14px 14px; background: #e2ebf7; }
.kapi-message-user p { color: #012b6f; }
.kapi-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.kapi-topic { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 78px; padding: 10px; border: 1px solid #e0e7f0; border-radius: 10px; background: #f8fafd; color: #123d77; text-align: left; font-size: 11px; font-weight: 600; line-height: 1.4; transition: background .15s, border-color .15s; }
.kapi-topic-icon { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 2px; border-radius: 6px; background: #fff0b7; color: #012b6f; font-size: 12px; font-weight: 700; }
.kapi-topic:hover { border-color: #dbb53c; background: #fff9e8; }
.kapi-choices { display: grid; gap: 7px; margin-top: 12px; }
.kapi-choice { display: block; width: 100%; padding: 10px 11px; border: 1px solid #d5e0ee; border-radius: 8px; background: #f8fafd; color: #153f79; text-align: left; font-size: 12px; line-height: 1.45; }
.kapi-choice:hover { border-color: #d9ae27; background: #fff8df; }
.kapi-more { display: block; padding: 10px 0 0; border: 0; background: none; color: #1b4a87; font-size: 11px; font-weight: 600; text-align: left; line-height: 1.5; }
.kapi-action { display: inline-block; margin-top: 13px; padding: 9px 13px; border-radius: 7px; background: #ffd43a; color: #012b6f; text-decoration: none; font-size: 12px; font-weight: 700; line-height: 1.4; }
.kapi-action:hover { background: #ffe279; }
.kapi-feedback { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; padding-top: 10px; border-top: 1px solid #edf1f6; font-size: 10px; color: #718198; }
.kapi-feedback-button { padding: 3px 0; border: 0; background: none; color: #60758f; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.kapi-toolbar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 10px; padding: 9px 17px; border-top: 1px solid #dfe7f0; background: #fff; }
.kapi-toolbar > button { display: flex; align-items: center; gap: 6px; padding: 3px 0; border: 0; background: none; color: #244a80; font-size: 11px; font-weight: 600; }
.kapi-toolbar svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.kapi-toolbar > span { color: #8190a4; font-size: 10px; }
.kapi-composer { display: flex; align-items: center; flex-shrink: 0; gap: 9px; margin: 0; padding: 0 13px 13px; background: #fff; }
.kapi .kapi-composer input { display: block; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 11px 13px; border: 1px solid #dce5ef; border-radius: 10px; background: #f5f8fc; color: #12315b; font-size: 13px; font-weight: 400; line-height: 1.4; }
.kapi-composer input:focus { outline: 2px solid #e4bd44; outline-offset: 0; }
.kapi-composer input::placeholder { color: #8695a9; }
.kapi-composer > button { display: grid; place-items: center; flex-shrink: 0; width: 43px; height: 43px; padding: 11px; border: 0; border-radius: 11px; background: #012b6f; color: #fff; }
.kapi-composer > button:disabled { opacity: .5; cursor: default; }
.kapi-composer svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kapi-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes kapi-reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .home-hero .motion-btn { right: 92px; }
  .kapi { right: 14px; bottom: max(15px, env(safe-area-inset-bottom)); }
  .kapi-face { width: 60px; height: 60px; }
  .kapi-face img { width: 51px; height: 51px; }
  .kapi-invitation { padding: 9px 12px; }
  .kapi-panel { width: calc(100vw - 28px); max-width: 390px; bottom: 73px; height: min(580px, calc(100dvh - 112px)); min-height: 180px; border-radius: 17px; }
  .kapi-header { min-height: 78px; padding: 13px 16px; }
  .kapi-chat { padding: 14px 12px; }
  .kapi-message { margin-right: 8px; padding: 13px; }
  .kapi-message-user { margin-left: 30px; margin-right: 0; }
  .kapi .kapi-composer input { font-size: 16px; }
  .kapi-toolbar > span { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { .kapi *, .kapi *::before, .kapi *::after { animation: none !important; transition: none !important; } }
@media print { .kapi { display: none !important; } }
