/* Widget chat Asisten Kota Peruri — warna mengikuti tema portal (navy solid) */
.kpchat { font-family: inherit; }
.kpchat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 998;
  display: flex; align-items: center; gap: 8px;
  background: #1e2b52; color: #fff; border: none; cursor: pointer;
  padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 10px 26px rgba(18, 24, 48, .28);
  font-size: 13.5px; font-weight: 700; letter-spacing: .2px;
  transition: background .18s ease, box-shadow .18s ease;
}
.kpchat-fab:hover { background: #14203f; box-shadow: 0 14px 30px rgba(18, 24, 48, .34); }
.kpchat-fab-icon { font-size: 17px; }
.kpchat-fab.hide { display: none; }

.kpchat-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 999;
  width: min(390px, calc(100vw - 32px));
  height: min(560px, calc(100dvh - 44px));
  background: #fff; border-radius: 14px; overflow: hidden;
  display: none; flex-direction: column;
  box-shadow: 0 22px 56px rgba(18, 24, 48, .3);
  border: 1px solid #e3e5ec;
}
.kpchat-panel.open { display: flex; animation: kpchat-in .22s ease; }
@keyframes kpchat-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.kpchat-head {
  background: #14203f;
  color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.kpchat-head strong { display: block; font-size: 14.5px; }
.kpchat-head small { display: block; font-size: 11.5px; opacity: .8; margin-top: 2px; }
.kpchat-close {
  background: rgba(255, 255, 255, .12); color: #fff; border: none;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 13px; flex: none;
}
.kpchat-close:hover { background: rgba(255, 255, 255, .24); }

.kpchat-body {
  flex: 1; overflow-y: auto; padding: 14px 14px 6px;
  background: #f4f5f8;
  display: flex; flex-direction: column; gap: 8px;
}
.kpchat-msg { display: flex; }
.kpchat-msg.kpchat-user { justify-content: flex-end; }
.kpchat-bubble {
  max-width: 86%; padding: 10px 13px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.55; color: #1a1d2e;
  background: #fff; border: 1px solid #e3e5ec;
  overflow-wrap: anywhere;
}
.kpchat-user .kpchat-bubble {
  background: #1e2b52; color: #fff; border-color: #1e2b52;
  border-bottom-right-radius: 4px;
}
.kpchat-bot .kpchat-bubble { border-bottom-left-radius: 4px; }
.kpchat-bubble p { margin: 0 0 6px; }
.kpchat-bubble p:last-child { margin-bottom: 0; }
.kpchat-bubble ul { margin: 4px 0 6px; padding-left: 18px; }
.kpchat-bubble li { margin-bottom: 3px; }
.kpchat-bubble a { color: #2f5fd0; }

.kpchat-typing .kpchat-bubble { display: flex; gap: 5px; padding: 13px 16px; }
.kpchat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #97a0b5;
  animation: kpchat-dot 1.1s infinite ease-in-out;
}
.kpchat-typing span:nth-child(2) { animation-delay: .15s; }
.kpchat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes kpchat-dot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.kpchat-quick {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px 4px; background: #f4f5f8;
}
.kpchat-chip {
  border: 1px solid #d3d7e0; background: #fff; color: #2b2e45;
  font-size: 11.5px; font-weight: 650; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  transition: background .15s ease;
}
.kpchat-chip:hover { background: #e9ecf1; }

.kpchat-form {
  display: flex; gap: 8px; padding: 10px 12px;
  background: #fff; border-top: 1px solid #e3e5ec;
}
.kpchat-input {
  flex: 1; border: 1px solid #d3d7e0; border-radius: 10px;
  padding: 10px 14px; font-size: 13.5px; font-family: inherit; color: #1a1d2e;
  background: #fafbfc; outline: none;
}
.kpchat-input:focus { border-color: #1e2b52; background: #fff; }
.kpchat-send {
  width: 42px; height: 42px; border-radius: 10px; border: none; cursor: pointer;
  background: #1e2b52; color: #fff; font-size: 15px; flex: none;
  transition: background .15s ease;
}
.kpchat-send:hover { background: #14203f; }

.kpchat-foot {
  padding: 7px 12px; font-size: 10.5px; color: #8a8f9e; text-align: center;
  background: #fff; border-top: 1px solid #eceef2;
}
.kpchat-foot a { color: #1e2b52; font-weight: 700; }

@media (max-width: 480px) {
  .kpchat-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 12px; }
  .kpchat-fab { right: 14px; bottom: 14px; }
}
