/* A8BM Support Chat — floating launcher + panel (WiseMart-inspired placement) */
.a8bm-support-root {
  position: fixed;
  z-index: 45; /* under building modals (1e6), above dock (40) */
  font-family: Inter, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  --a8bm-sup-ox: 24px;
  --a8bm-sup-oy: 24px;
}
.a8bm-support-pos-right-bottom { right: var(--a8bm-sup-ox); bottom: var(--a8bm-sup-oy); }
.a8bm-support-pos-left-bottom  { left: var(--a8bm-sup-ox);  bottom: var(--a8bm-sup-oy); }
.a8bm-support-pos-right-top    { right: var(--a8bm-sup-ox); top: var(--a8bm-sup-oy); }
.a8bm-support-pos-left-top     { left: var(--a8bm-sup-ox);  top: var(--a8bm-sup-oy); }

/* Lift above mobile dock */
@media (max-width: 1023px) {
  .a8bm-support-pos-right-bottom,
  .a8bm-support-pos-left-bottom {
    bottom: calc(var(--a8bm-sup-oy) + 88px);
  }
  /* Compact launcher so it does not cover floor "View configuration" links */
  .a8bm-support-launcher {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
  }
  .a8bm-support-launcher-label { display: none; }
}

.a8bm-support-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 9999px;
  border: none;
  background: #18181b;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s, box-shadow 0.2s;
}
.a8bm-support-launcher:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.a8bm-support-launcher[aria-expanded="true"] {
  background: #3f3f46;
}
.a8bm-support-launcher-label {
  letter-spacing: -0.01em;
}
@media (max-width: 480px) {
  .a8bm-support-launcher-label { display: none; }
  .a8bm-support-launcher {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 9999px;
  }
}

.a8bm-support-panel {
  position: absolute;
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 120px));
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 20px;
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: a8bm-sup-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.a8bm-support-pos-right-bottom .a8bm-support-panel,
.a8bm-support-pos-left-bottom .a8bm-support-panel {
  bottom: calc(100% + 12px);
}
.a8bm-support-pos-right-top .a8bm-support-panel,
.a8bm-support-pos-left-top .a8bm-support-panel {
  top: calc(100% + 12px);
}
.a8bm-support-pos-right-bottom .a8bm-support-panel,
.a8bm-support-pos-right-top .a8bm-support-panel {
  right: 0;
}
.a8bm-support-pos-left-bottom .a8bm-support-panel,
.a8bm-support-pos-left-top .a8bm-support-panel {
  left: 0;
}
@keyframes a8bm-sup-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.a8bm-support-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f4f4f5;
  background: #18181b;
  color: #fff;
}
.a8bm-support-panel-head strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.a8bm-support-status {
  font-size: 11px;
  opacity: 0.75;
  font-weight: 500;
}
.a8bm-support-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.a8bm-support-close:hover { background: rgba(255,255,255,0.12); }

.a8bm-support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}
.a8bm-support-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}
.a8bm-support-bubble-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e4e4e7;
  color: #18181b;
  border-bottom-left-radius: 4px;
}
.a8bm-support-bubble-user {
  align-self: flex-end;
  background: #18181b;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.a8bm-support-bubble-time {
  display: block;
  font-size: 10px;
  opacity: 0.55;
  margin-top: 4px;
}

.a8bm-support-compose {
  border-top: 1px solid #f4f4f5;
  padding: 12px;
  background: #fff;
}
.a8bm-support-guest {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 8px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  font-size: 13px;
}
.a8bm-support-compose-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.a8bm-support-compose textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  font-size: 13.5px;
  font-family: inherit;
  resize: none;
  line-height: 1.4;
}
.a8bm-support-compose textarea:focus {
  outline: none;
  border-color: #18181b;
}
.a8bm-support-send {
  flex-shrink: 0;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 12px;
  background: #18181b;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.a8bm-support-send:hover { background: #27272a; }
.a8bm-support-send:disabled { opacity: 0.5; cursor: not-allowed; }

.a8bm-support-root[hidden],
.a8bm-support-panel[hidden] {
  display: none !important;
}


/* wmsp-inspired chat polish */
.a8bm-support-panel-head{background:#101828!important}
.a8bm-support-bubble-user{background:#101828!important;border-radius:16px 16px 4px 16px}
.a8bm-support-bubble-bot{border-radius:16px 16px 16px 4px;box-shadow:0 1px 2px rgba(16,24,40,.06)}
.a8bm-support-send{background:#101828!important;border-radius:9999px!important;min-width:44px}
.a8bm-support-launcher{background:#101828!important}
.a8bm-support-compose textarea{border-radius:14px!important;border-color:#d0d5dd!important}
