.ka-host { font: 16px/1.4 Arial, Helvetica, sans-serif; color: #1b1b1d; }
.ka-host *, .ka-host *::before { box-sizing: border-box; }
.ka-host button, .ka-host input, .ka-host select { font: inherit; }
.ka-host button, .ka-host select { cursor: pointer; }
.ka-host :focus-visible { outline: 3px solid #db433c; outline-offset: 2px; }
.ka-face {
  display: block;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: #c4e2ed url("/assets/mascotas-kumho-620.webp") no-repeat;
  background-size: 340% auto;
}
.ka-face[data-name="Thoro"] { background-position: 17% 36%; }
.ka-face[data-name="Roro"] { background-position: 88% 40%; }
.ka-face[data-name="Thory"] { background-position: 50% 6%; }
.ka-launch {
  position: fixed;
  z-index: 9;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  border: 1px solid #757577;
  border-radius: 50px;
  padding: 4px 14px 4px 4px;
  background-color: #18191c;
  color: #fff;
  box-shadow: 0 3px 16px #0003;
}
.ka-launch .ka-label { font-size: 14px; font-weight: 700; }
.ka-launch:hover { background: #2b2d31; }
.ka-host dialog {
  position: fixed;
  inset: auto max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) auto;
  width: min(410px, calc(100vw - 28px));
  max-height: min(680px, calc(100dvh - 28px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #a5a098;
  border-radius: 14px;
  margin: 0;
  padding: 0;
  background: #faf8f3;
  color: #19191b;
  box-shadow: 0 16px 60px #0004;
}
.ka-host dialog::backdrop { background: #0b0a0c52; }
.ka-box { padding: 18px 21px 19px; }
.ka-top { display: flex; align-items: center; justify-content: space-between; }
.ka-top > span { font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.ka-top > span::before { content: ''; display: inline-block; width: 23px; height: 3px; background: #b52b27; margin: 0 9px 3px 0; }
.ka-close { color: #171719; background: none; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 26px !important; }
.ka-close:hover { background: #e8e6df; }
.ka-box h2 { margin: 2px 0 15px; font-size: clamp(23px, 4vw, 30px); line-height: 1.12; letter-spacing: -.035em; }
.ka-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.ka-choices button { display: grid; justify-items: center; align-content: start; padding: 8px 2px; border: 1px solid #d0cac0; border-radius: 8px; background: #fff; color: #232225; min-width: 0; }
.ka-choices button[aria-pressed="true"] { background: #eeebe4; border-color: #8e211f; box-shadow: inset 0 -2px #8e211f; }
.ka-choices strong { margin-top: 3px; font-size: 14px; }
.ka-choice-job { font-size: 11px; line-height: 1.2; text-align: center; color: #4b4742; padding: 0 2px; }
.ka-answer { padding-top: 18px; }
.ka-answer h3 { margin: 0; font-size: 20px; line-height: 1.2; }
.ka-prompt { margin: 8px 0 13px; font-size: 15px; }
.ka-links { display: grid; margin-top: 8px; }
.ka-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; min-height: 42px; border-bottom: 1px solid #ded9d1; }
.ka-links a, .ka-film { color: #73201c; font-size: 14px; font-weight: 700; text-decoration: none; }
.ka-links a::after { content: '›'; font-size: 19px; }
.ka-links a:hover, .ka-film:hover { text-decoration: underline; }
.ka-film { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 6px; }
.ka-film > span { font-size: 11px; }
.ka-form label { display: block; font-size: 13px; font-weight: 700; padding-bottom: 4px; }
.ka-form > div { display: flex; gap: 6px; }
.ka-form input, .ka-form select { flex: 1; min-width: 0; width: 100%; padding: 8px; border: 1px solid #989187; background: white; color: #171719; border-radius: 4px; }
.ka-form button { padding: 7px 13px; min-height: 44px; border: 0; border-radius: 4px; background: #912922; color: white; font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .ka-launch .ka-face, .ka-launch.ka-greet .ka-face { animation: ka-wave .7s ease-out 1; }
  .ka-launch.ka-greet .ka-face { animation-name: ka-wave-again; }
  .ka-choices button[aria-pressed="true"] .ka-face { animation: ka-wave .55s ease-out 1; }
  @keyframes ka-wave { 30% { transform: translateY(-3px) rotate(-8deg); } 65% { transform: rotate(5deg); } }
  @keyframes ka-wave-again { 30% { transform: translateY(-3px) rotate(-8deg); } 65% { transform: rotate(5deg); } }
}
@media (max-width: 600px) {
  .ka-host dialog { inset: auto 0 0; width: 100%; max-width: 100%; max-height: 85dvh; border-radius: 16px 16px 0 0; }
  .ka-box { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .ka-launch { padding: 3px 10px 3px 3px; gap: 5px; right: max(9px, env(safe-area-inset-right)); }
  .ka-launch .ka-label { font-size: 12px; }
  .ka-launch .ka-face { width: 44px; height: 44px; }
  body:has(input:focus, textarea:focus, select:focus) .ka-launch { visibility: hidden; }
}
