/* MR Planner Rental — AI 落單助手 widget */
#mr-chat-toggle {
  position: fixed; right: 22px; bottom: 22px; z-index: 9990;
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #00d4ff 0%, #7c5cff 60%, #ff3d81 120%);
  display: grid; place-items: center;
  box-shadow: 0 12px 36px rgba(0, 212, 255, .38), 0 0 0 0 rgba(0, 212, 255, .35);
  transition: transform .25s, box-shadow .25s;
  animation: mrchat-pulse 2.6s infinite;
}
@keyframes mrchat-pulse {
  0% { box-shadow: 0 12px 36px rgba(0,212,255,.38), 0 0 0 0 rgba(0,212,255,.35); }
  70% { box-shadow: 0 12px 36px rgba(0,212,255,.38), 0 0 0 16px rgba(0,212,255,0); }
  100% { box-shadow: 0 12px 36px rgba(0,212,255,.38), 0 0 0 0 rgba(0,212,255,0); }
}
#mr-chat-toggle:hover { transform: scale(1.08); }
#mr-chat-toggle svg { width: 30px; height: 30px; color: #fff; }
#mr-chat-toggle .chat-badge {
  position: absolute; top: 0; right: 0; width: 15px; height: 15px; border-radius: 50%;
  background: #ff3d81; border: 2.5px solid #0b0f1a;
}
#mr-chat-toggle .chat-close { display: none; }
#mr-chat-toggle.open .chat-open { display: none; }
#mr-chat-toggle.open .chat-close { display: block; }

#mr-chat-panel {
  position: fixed; right: 22px; bottom: 98px; z-index: 9991;
  width: 400px; max-width: calc(100vw - 32px); height: min(600px, calc(100vh - 130px));
  background: #0d1220; border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(24px) scale(.97); opacity: 0; pointer-events: none;
  transition: transform .28s, opacity .28s;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
#mr-chat-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

#mr-chat-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: linear-gradient(120deg, #0e1626 0%, #141b2e 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
#mr-chat-head .chat-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(135deg, #00d4ff, #7c5cff); flex-shrink: 0;
}
#mr-chat-head .chat-name { font-weight: 700; font-size: 14.5px; color: #f4f6fb; }
#mr-chat-head .chat-status { font-size: 11.5px; color: #00d4ff; display: flex; align-items: center; gap: 5px; }
#mr-chat-head .chat-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #00d4ff; box-shadow: 0 0 8px #00d4ff; }

#mr-chat-msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
#mr-chat-msgs::-webkit-scrollbar { width: 5px; }
#mr-chat-msgs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.mr-msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.mr-msg.bot { align-self: flex-start; background: #182032; color: #dfe6f5; border-bottom-left-radius: 4px; }
.mr-msg.user { align-self: flex-end; background: linear-gradient(135deg, #00d4ff, #7c5cff); color: #fff; border-bottom-right-radius: 4px; font-weight: 500; }
.mr-msg .mr-msg-title { font-weight: 700; color: #00d4ff; display: block; margin-bottom: 4px; }
.mr-msg .mr-price-line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.mr-msg .mr-price-total { border-top: 1px dashed rgba(255,255,255,.25); margin-top: 6px; padding-top: 7px; font-weight: 700; color: #fff; font-size: 15px; display: flex; justify-content: space-between; }
.mr-msg .mr-price-note { font-size: 12px; color: #8b96ad; margin-top: 6px; }
.mr-msg .mr-detail-line { font-size: 13px; color: #c6d0e4; padding: 2px 0; }
.mr-msg .mr-detail-line b { color: #f4f6fb; }

#mr-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 14px 6px; }
.mr-chip {
  border: 1px solid rgba(0, 212, 255, .45); background: rgba(0, 212, 255, .08); color: #7ce4ff;
  font-size: 13px; font-weight: 600; padding: 8px 15px; border-radius: 999px; cursor: pointer;
  transition: background .2s, transform .15s;
}
.mr-chip:hover { background: rgba(0, 212, 255, .2); transform: translateY(-1px); }
.mr-chip.primary { background: linear-gradient(135deg, #00d4ff, #7c5cff); border-color: transparent; color: #fff; }
.mr-chip.ghost { border-color: rgba(255,255,255,.2); background: transparent; color: #a6b0c3; }
.mr-chip.ghost:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.mr-chip.multi { border-color: rgba(124, 92, 255, .5); background: rgba(124, 92, 255, .1); color: #c9b8ff; }
.mr-chip.multi.selected { background: rgba(124, 92, 255, .35); color: #fff; }

#mr-chat-input-row { display: flex; gap: 8px; padding: 10px 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
#mr-chat-input {
  flex: 1; background: #182032; border: 1px solid rgba(255,255,255,.14); color: #f4f6fb;
  border-radius: 999px; padding: 11px 16px; font-size: 14px; outline: none;
}
#mr-chat-input:focus { border-color: #00d4ff; }
#mr-chat-input::placeholder { color: #5d6b85; }
#mr-chat-send {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, #00d4ff, #7c5cff); display: grid; place-items: center;
}
#mr-chat-send svg { width: 18px; height: 18px; color: #fff; }

#mr-chat-panel input[type="date"] {
  width: 100%; background: #182032; border: 1px solid rgba(255,255,255,.14); color: #f4f6fb;
  border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; color-scheme: dark;
}
#mr-chat-panel input[type="date"]:focus { border-color: #00d4ff; }

@media (max-width: 560px) {
  #mr-chat-panel { right: 12px; bottom: 90px; height: calc(100vh - 120px); }
  #mr-chat-toggle { right: 14px; bottom: 14px; }
}
