/* MORRA Chatbot — semua kelas berawalan .mc- agar tidak bentrok dengan tema. */
.morra-chatbot, .morra-chatbot * { box-sizing: border-box; }
.morra-chatbot { --mc-color: #16a34a; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #111827; }

.mc-wrap { position: fixed; bottom: 18px; z-index: 99990; }
.mc-wrap.mc-right { right: 18px; }
.mc-wrap.mc-left { left: 18px; }

.mc-launcher { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--mc-color); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,0,0,.28); transition: transform .15s ease; padding: 0; }
.mc-launcher:hover { transform: scale(1.06); }
.mc-launcher:focus-visible, .mc-send:focus-visible, .mc-chip:focus-visible, .mc-close:focus-visible { outline: 3px solid rgba(37,99,235,.55); outline-offset: 2px; }

.mc-bubble { position: absolute; bottom: 70px; max-width: 250px; background: #fff; border-radius: 14px; padding: 10px 28px 10px 12px; box-shadow: 0 8px 28px rgba(0,0,0,.2); cursor: pointer; font-size: 13.5px; animation: mc-pop .35s ease; }
.mc-right .mc-bubble { right: 0; }
.mc-left .mc-bubble { left: 0; }
.mc-bubble-x { position: absolute; top: 2px; right: 4px; border: 0; background: transparent; font-size: 18px; line-height: 1; color: #6b7280; cursor: pointer; padding: 2px 4px; }

.mc-panel { display: none; flex-direction: column; background: #fff; overflow: hidden; }
.mc-wrap .mc-panel { position: absolute; bottom: 74px; width: 360px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 110px); border-radius: 16px; box-shadow: 0 14px 50px rgba(0,0,0,.3); }
.mc-right .mc-panel { right: 0; }
.mc-left .mc-panel { left: 0; }
.mc-panel.mc-open { display: flex; animation: mc-pop .22s ease; }

.mc-panel.mc-inline { display: flex; position: static; width: 100%; height: 100%; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.morra-chat-inline { max-width: 720px; margin: 1.2em auto; }
.mc-wrap-inline { height: 100%; }

.mc-head { display: flex; align-items: center; gap: 10px; background: var(--mc-color); color: #fff; padding: 12px 14px; }
.mc-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.mc-htext { flex: 1; min-width: 0; }
.mc-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-sub { font-size: 11.5px; opacity: .9; }
.mc-close { border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }

.mc-msgs { flex: 1; overflow-y: auto; padding: 12px; background: #f3f4f6; }
.mc-msg { margin: 6px 0; padding: 8px 12px; border-radius: 14px; max-width: 86%; word-wrap: break-word; overflow-wrap: anywhere; }
.mc-bot { background: #fff; color: #111827; border-top-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.mc-me { background: var(--mc-color); color: #fff; margin-left: auto; border-top-right-radius: 4px; }
.mc-me .mc-link { color: #fff; }
.mc-link { color: #1d4ed8; text-decoration: underline; word-break: break-all; }

.mc-typing { display: inline-flex; gap: 4px; padding: 11px 14px; }
.mc-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; animation: mc-dot 1.1s infinite ease-in-out; }
.mc-typing span:nth-child(2) { animation-delay: .15s; }
.mc-typing span:nth-child(3) { animation-delay: .3s; }

.mc-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; background: #f3f4f6; }
.mc-chip { border: 1px solid var(--mc-color); color: var(--mc-color); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.mc-chip:hover { background: var(--mc-color); color: #fff; }

.mc-form { display: flex; border-top: 1px solid #e5e7eb; background: #fff; }
.mc-input { flex: 1; min-width: 0; border: 0; padding: 13px 12px; font-size: 14px; outline: 0; background: transparent; color: #111827; }
.mc-send { border: 0; background: var(--mc-color); color: #fff; padding: 0 18px; font-weight: 600; cursor: pointer; font-size: 14px; }
.mc-send:disabled { opacity: .55; cursor: default; }

.mc-lead { padding: 12px; background: #fff; border-top: 1px solid #e5e7eb; display: flex; flex-direction: column; gap: 8px; }
.mc-lead-t { font-weight: 600; }
.mc-lead-i { border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; flex: none; }
.mc-lead-i.mc-err { border-color: #dc2626; }
.mc-lead-go { border-radius: 10px; padding: 10px; }

.mc-wa { display: block; text-align: center; padding: 8px; font-size: 12.5px; background: #f9fafb; color: #047857; text-decoration: none; border-top: 1px solid #e5e7eb; font-weight: 600; }
.mc-wa:hover { background: #ecfdf5; text-decoration: underline; }

@keyframes mc-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes mc-dot { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mc-panel.mc-open, .mc-bubble, .mc-typing span, .mc-launcher { animation: none; transition: none; } }

@media (max-width: 520px) {
  .mc-wrap { bottom: 12px; }
  .mc-wrap.mc-right { right: 12px; }
  .mc-wrap.mc-left { left: 12px; }
  .mc-wrap .mc-panel { position: fixed; left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; height: min(78vh, 600px); max-height: none; }
  .mc-launcher.mc-hide-m { display: none; }
}

/* Pengelola yang sedang login: jangan sampai kepala jendela tertutup admin bar WordPress. */
@media (min-width: 521px) {
  .admin-bar .mc-wrap .mc-panel { max-height: calc(100vh - 158px); }
}
