:root {
  --panical-lm-primary: #000;
  --panical-lm-text: #fff;
  --panical-lm-radius: 18px;
}
.panical-lm-root,
.panical-lm-root * { box-sizing: border-box; }
.panical-lm-root { position: fixed; inset: 0; z-index: 999999; pointer-events: none; font-family: inherit; }
.panical-lm-root.is-open { pointer-events: auto; }
.panical-lm-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.16); opacity: 0; transition: opacity .22s ease; }
.panical-lm-root.is-open .panical-lm-backdrop { opacity: 1; }
.panical-lm-window { position: absolute; width: min(380px, calc(100vw - 32px)); height: min(620px, calc(100vh - 48px)); border: 1px solid rgba(0,0,0,.12); border-radius: var(--panical-lm-radius); box-shadow: 0 20px 70px rgba(0,0,0,.28); overflow: hidden; transform: translateY(18px) scale(.98); opacity: 0; transition: transform .22s ease, opacity .22s ease; display: flex; flex-direction: column; }
.panical-lm-root.is-open .panical-lm-window { transform: translateY(0) scale(1); opacity: 1; }
.panical-lm-header { height: 66px; display: flex; align-items: center; padding: 0 18px; }
.panical-lm-header strong { display: block; font-size: 15px; line-height: 1.2; letter-spacing: .02em; }
.panical-lm-header span { display: block; font-size: 12px; opacity: .72; margin-top: 4px; }
.panical-lm-close,
.panical-lm-info-close { appearance: none; border: 0; background: transparent; color: currentColor; cursor: pointer; font-size: 28px; line-height: 1; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.panical-lm-close:hover { background: rgba(255,255,255,.1); }
.panical-lm-messages { flex: 1; overflow: auto; padding: 18px 14px 16px; scroll-behavior: auto; overflow-anchor: none; }
.panical-lm-msg { display: flex; margin: 10px 0; container-type: inline-size; }
.panical-lm-bubble { padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-break: break-word; white-space: pre-wrap; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.panical-lm-bubble, .panical-lm-bubble * { user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; }
.panical-lm-form textarea { user-select: text; -webkit-user-select: text; }
.panical-lm-time { font-size: 11px; color: #888; margin: 5px 4px 0; }
.panical-lm-msg.customer { justify-content: flex-end; }
.panical-lm-msg.customer .panical-lm-bubble { border-bottom-right-radius: 4px; }
.panical-lm-msg.staff { justify-content: flex-start; }
.panical-lm-msg.staff .panical-lm-bubble { border: 1px solid rgba(0,0,0,.08); border-bottom-left-radius: 4px; }
.panical-lm-msg.system { justify-content: center; }
.panical-lm-msg.system .panical-lm-msg-inner { max-width: 92%; }
.panical-lm-msg.system .panical-lm-bubble { background: transparent; border: 0; color: #666; font-size: 12px; box-shadow: none; text-align: center; padding: 4px 8px; }
.panical-lm-info-link { color: #ff1053; text-decoration: underline; text-underline-offset: 2px; background: transparent; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; }
.panical-lm-info-link:hover,
.panical-lm-info-link:focus-visible { color: #d90b43; text-decoration-thickness: 2px; }
.panical-lm-image { display: block; width: auto; height: auto; max-width: min(32cqw, 180px); max-height: min(18vh, 150px); object-fit: contain; border-radius: 10px; cursor: zoom-in; }
html.panical-lm-preview-open,
html.panical-lm-preview-open body { overflow: hidden !important; }
.panical-lm-image-preview {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background: rgba(0,0,0,.80);
  touch-action: none;
  overscroll-behavior: contain;
}
.panical-lm-image-preview.is-open { display: flex; }
.panical-lm-image-preview-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.panical-lm-image-preview img {
  max-width: min(96vw, 1200px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 80px rgba(0,0,0,.45);
  transform: translate3d(0,0,0) scale(1);
  transform-origin: center center;
  will-change: transform;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.panical-lm-image-preview.is-zoomed img { cursor: grab; }
.panical-lm-image-preview.is-zoomed img:active { cursor: grabbing; }
.panical-lm-image-preview button {
  position: fixed;
  z-index: 2;
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  background: rgba(0,0,0,.38);
  color: #fff;
  font: 300 30px/1 Arial, sans-serif;
  cursor: pointer;
}

.panical-lm-document-preview {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background: rgba(0,0,0,.80);
  overscroll-behavior: contain;
}
.panical-lm-document-preview.is-open { display: flex; }
.panical-lm-document-preview-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.panical-lm-document-preview-shell {
  width: min(96vw, 1400px);
  height: 90vh;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 80px rgba(0,0,0,.45);
}
.panical-lm-document-preview-head {
  flex: 0 0 auto;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(0,0,0,.10);
  color: #111;
}
.panical-lm-document-preview-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.panical-lm-document-download,
.panical-lm-document-fallback-download { color: #111; text-decoration: none; border: 1px solid rgba(0,0,0,.16); border-radius: 8px; padding: 7px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.panical-lm-document-download:hover,
.panical-lm-document-fallback-download:hover { background: rgba(0,0,0,.05); }
.panical-lm-document-preview iframe {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}
.panical-lm-document-preview iframe[hidden] { display: none !important; }
.panical-lm-document-fallback {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  color: #222;
  text-align: center;
}
.panical-lm-document-fallback[hidden] { display: none !important; }
.panical-lm-document-fallback-icon { width: 72px; height: 72px; display: inline-flex; align-items: center; justify-content: center; border-radius: 16px; background: #f2f3f4; font-size: 14px; font-weight: 800; }
.panical-lm-document-fallback strong { max-width: min(520px, 86vw); word-break: break-word; }
.panical-lm-document-fallback small { color: #777; }
.panical-lm-document-preview button {
  position: fixed;
  z-index: 2;
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  background: rgba(0,0,0,.38);
  color: #fff;
  font: 300 30px/1 Arial, sans-serif;
  cursor: pointer;
}
@media (max-width: 600px) {
  .panical-lm-image-preview-stage { padding: 12px; }
  .panical-lm-image-preview img { max-width: 96vw; max-height: 88vh; border-radius: 8px; }
  .panical-lm-image-preview button { top: 10px; right: 10px; }
  .panical-lm-document-preview-stage { padding: 12px; }
  .panical-lm-document-preview-shell { width: 96vw; height: 88vh; border-radius: 8px; }
  .panical-lm-document-preview button { top: 10px; right: 10px; }
}

.panical-lm-file { appearance: none; -webkit-appearance: none; display: flex; align-items: center; gap: 9px; min-width: 0; max-width: 250px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.panical-lm-file-icon { width: 38px; height: 38px; flex: 0 0 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(127,127,127,.15); font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.panical-lm-file-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.panical-lm-file-info strong, .panical-lm-file-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panical-lm-file-info strong { font-size: 13px; font-weight: 700; }
.panical-lm-file-info small { font-size: 11px; opacity: .7; }
.panical-lm-file:hover .panical-lm-file-info strong { text-decoration: underline; text-underline-offset: 2px; }
.panical-lm-form { display: grid; grid-template-columns: 34px 1fr auto !important; gap: 8px; align-items: end; padding: 12px; background: #fff; border-top: 1px solid rgba(0,0,0,.08); }
.panical-lm-tool,
.panical-lm-send { appearance: none; border: 1px solid rgba(0,0,0,.12); background: #fff; color: #111; border-radius: 999px; min-height: 38px; cursor: pointer; font-weight: 600; }
.panical-lm-tool { width: 34px; min-height: 34px; font-size: 18px; }
.panical-lm-send { padding: 0 15px; background: #000; color: #fff; border-color: #000; font-size: 13px; }
.panical-lm-form textarea { width: 100%; min-height: 38px; max-height: 110px; border: 1px solid rgba(0,0,0,.14); border-radius: 18px; padding: 9px 12px; resize: none; line-height: 1.35; font-size: 14px; outline: none; }
.panical-lm-info-modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(0,0,0,.25); }
.panical-lm-info-modal[hidden] { display: none; }
.panical-lm-info-panel { position: relative; width: min(520px, 100%); max-height: min(720px, calc(100vh - 42px)); overflow: auto; background: #fff; border-radius: 18px; padding: 22px; box-shadow: 0 20px 70px rgba(0,0,0,.28); }
.panical-lm-info-close { position: absolute; top: 10px; right: 10px; color: #111; }
.panical-lm-info-panel h3 { margin: 0 0 8px; font-size: 20px; }
.panical-lm-info-panel p { margin: 0 0 16px; color: #666; font-size: 13px; }
.panical-lm-info-panel label { display: block; font-size: 12px; font-weight: 700; color: #222; margin: 10px 0; }
.panical-lm-required-mark { color: #ff1053; }
.panical-lm-info-panel input,
.panical-lm-info-panel textarea { width: 100%; margin-top: 5px; border: 1px solid rgba(0,0,0,.16); border-radius: 10px; min-height: 38px; padding: 8px 10px; font-size: 14px; transition: border-color .16s ease, box-shadow .16s ease; }
.panical-lm-info-panel input.is-invalid,
.panical-lm-info-panel textarea.is-invalid,
.panical-lm-info-panel input.is-invalid:focus,
.panical-lm-info-panel textarea.is-invalid:focus {
  border: 2px solid #ff1053 !important;
  box-shadow: none !important;
  outline: 0 !important;
}
.panical-lm-info-error { margin: 8px 0 0; color: #ff1053; font-size: 12px; line-height: 1.4; }
.panical-lm-info-error[hidden] { display: none !important; }
.panical-lm-info-panel button[type="submit"] { width: 100%; margin-top: 10px; border: 0; background: #000; color: #fff; min-height: 42px; border-radius: 999px; cursor: pointer; font-weight: 700; }
.panical-lm-info-panel button[type="submit"]:disabled { cursor: wait; opacity: .65; }

/* keep customer bubbles/time tight to the right edge. */
.panical-lm-msg.customer .panical-lm-msg-inner {
  margin-left: auto;
  display: flex;
  flex-direction: column;
}
.panical-lm-msg.customer .panical-lm-time {
  text-align: right;
}

@media (max-width: 600px) {

  .panical-lm-form { padding: 10px; gap: 6px; }
  .panical-lm-send { padding: 0 12px; }
}

/* right-side chat window, Panical header status, and mobile-safe layout. */
.panical-lm-window {
  left: auto !important;
  right: 96px !important;
  bottom: 28px;
}
.panical-lm-status {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  margin-top: 5px !important;
  font-size: 12px !important;
  opacity: .9 !important;
}
.panical-lm-status i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: #9ca3af;
  box-shadow: 0 0 0 2px rgba(255,255,255,.12);
}
.panical-lm-status em {
  font-style: normal;
}
.panical-lm-status.is-online i,
.panical-lm-root.is-staff-online .panical-lm-status i {
  background: #22c55e;
}
.panical-lm-root.is-staff-offline .panical-lm-status i {
  background: #9ca3af;
}
.panical-lm-msg.system .panical-lm-bubble {
  max-width: 94%;
  line-height: 1.5;
}
@media (max-width: 900px) {
  .panical-lm-window {
    right: 84px !important;
    bottom: 22px;
  }
}
@media (max-width: 600px) {
  .panical-lm-window {
    left: 12px !important;
    right: 12px !important;
    bottom: 14px !important;
    width: auto;
    height: min(620px, calc(100vh - 32px));
    border-radius: 16px;
  }
}

/* Centered header, tighter bubbles, and message status. */
.panical-lm-header {
  position: relative;
  justify-content: center !important;
  text-align: center;
}
.panical-lm-header > div {
  min-width: 0;
  text-align: center;
}
.panical-lm-close {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}
.panical-lm-status {
  justify-content: center;
}
.panical-lm-msg-inner {
  width: auto;
  max-width: 82%;
}
.panical-lm-bubble {
  display: inline-block;
  max-width: 100%;
}
.panical-lm-msg.customer .panical-lm-msg-inner {
  align-items: flex-end;
}
.panical-lm-msg.customer .panical-lm-bubble {
  width: auto;
}
.panical-lm-time {
  display: flex;
  align-items: center;
  gap: 6px;
}
.panical-lm-msg.customer .panical-lm-time {
  justify-content: flex-end;
}
.panical-lm-checks {
  font-size: 12px;
  line-height: 1;
  letter-spacing: -2px;
  color: #9ca3af;
  margin-left: 3px;
}
.panical-lm-checks.is-read {
  color: #22c55e;
}
.panical-lm-checks.is-delivered {
  color: #9ca3af;
}
.panical-lm-checks.is-pending {
  letter-spacing: 0;
  color: #9ca3af;
}
.panical-lm-checks.is-failed {
  letter-spacing: 0;
  color: #d63638;
  font-weight: 700;
}
.panical-lm-msg.is-pending .panical-lm-bubble {
  opacity: .78;
}
.panical-lm-msg.is-pending.is-server-confirmed .panical-lm-bubble {
  opacity: 1;
}
.panical-lm-msg.is-failed .panical-lm-bubble {
  opacity: .78;
}
.panical-lm-send {
  min-width: 54px;
}

@media (max-width: 600px) {
  .panical-lm-form {
    grid-template-columns: 32px 1fr auto !important;
  }
}

/* Customer-side unread reminders for Floating Contact trigger */
.panical-lm-trigger-has-unread,
.pfc-main.panical-lm-trigger-has-unread,
.pfc-item.panical-lm-trigger-has-unread {
    position: relative !important;
}

.panical-lm-unread-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d60000;
    color: #fff;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
    pointer-events: none;
}

.pfc-item .panical-lm-unread-badge {
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

.pfc-main .panical-lm-unread-badge {
    top: -5px;
    right: -5px;
}

/* visible in-window notice when staff replies while chat is open */
.panical-lm-msg.is-fresh-staff .panical-lm-bubble {
  animation: panical-lm-fresh-message 1.5s ease-out 1;
}
@keyframes panical-lm-fresh-message {
  0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, .22); transform: translateY(2px); }
  35% { box-shadow: 0 0 0 4px rgba(0, 0, 0, .10); transform: translateY(0); }
  100% { box-shadow: none; transform: translateY(0); }
}

/* welcome quick question guide */
.panical-lm-quick-msg .panical-lm-msg-inner { max-width: 92%; }
.panical-lm-quick-bubble { width: 100%; padding: 12px; }
.panical-lm-quick-title { margin-bottom: 9px; color: #555; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.panical-lm-quick-list { display: grid; gap: 8px; }
.panical-lm-quick-btn { appearance: none; width: 100%; min-height: 38px; padding: 9px 12px; border: 1px solid rgba(0,0,0,.12); border-radius: 12px; background: #f8f8f8; color: #111; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.35; text-align: left; transition: background-color .18s ease, border-color .18s ease, transform .18s ease; }
.panical-lm-quick-btn:hover, .panical-lm-quick-btn:focus { background: #111; border-color: #111; color: #fff; transform: translateY(-1px); }
.panical-lm-local-question .panical-lm-time, .panical-lm-local-answer .panical-lm-time { display: none; }

/* Appearance settings from backend color pickers */
.panical-lm-window {
  background: var(--panical-lm-window-bg, #fff) !important;
  border-color: var(--panical-lm-border, rgba(0,0,0,.12)) !important;
}
.panical-lm-header {
  background: var(--panical-lm-header-bg, var(--panical-lm-primary, #000)) !important;
  color: var(--panical-lm-header-text, var(--panical-lm-text, #fff)) !important;
}
.panical-lm-messages {
  background: var(--panical-lm-chat-bg, #f6f6f6) !important;
}
.panical-lm-msg.staff .panical-lm-bubble {
  background: var(--panical-lm-staff-bg, #fff) !important;
  color: var(--panical-lm-staff-text, #111) !important;
  border-color: var(--panical-lm-border, rgba(0,0,0,.08)) !important;
}
.panical-lm-msg.customer .panical-lm-bubble {
  background: var(--panical-lm-customer-bg, #111) !important;
  color: var(--panical-lm-customer-text, #fff) !important;
}
.panical-lm-send,
.panical-lm-info-panel button[type="submit"] {
  background: var(--panical-lm-button-bg, #000) !important;
  color: var(--panical-lm-button-text, #fff) !important;
  border-color: var(--panical-lm-button-bg, #000) !important;
}
.panical-lm-form,
.panical-lm-form textarea,
.panical-lm-tool {
  border-color: var(--panical-lm-border, rgba(0,0,0,.12)) !important;
}

/* Attachment preview for selected files or clipboard-pasted images. */
.panical-lm-attachment-preview {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--panical-lm-border, rgba(0,0,0,.12));
  border-radius: 12px;
  background: #f7f7f7;
}
.panical-lm-attachment-preview[hidden] { display: none !important; }
.panical-lm-attachment-preview img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: cover;
  border-radius: 8px;
  background: #ececec;
}
.panical-lm-attachment-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ececec;
  color: #555;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
.panical-lm-attachment-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.panical-lm-attachment-info strong,
.panical-lm-attachment-info small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panical-lm-attachment-info strong { font-size: 12px; color: #333; font-weight: 600; }
.panical-lm-attachment-info small { font-size: 11px; color: #777; }
.panical-lm-attachment-preview button {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #555;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.panical-lm-attachment-preview button:hover { background: rgba(0,0,0,.06); }

/* real attachment upload progress for optimistic outgoing messages. */
.panical-lm-msg.is-uploading .panical-lm-bubble { position: relative; overflow: hidden; }
.panical-lm-upload-progress {
  --plm-upload-progress: 0%;
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: rgba(0,0,0,.16);
  pointer-events: none;
}
.panical-lm-upload-progress::before {
  content: "";
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(#fff var(--plm-upload-progress), rgba(255,255,255,.28) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
}
.panical-lm-upload-progress-label {
  position: absolute;
  min-width: 38px;
  text-align: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.38);
}
.panical-lm-msg.is-upload-processing .panical-lm-upload-progress::before {
  background: conic-gradient(#fff 0 72%, rgba(255,255,255,.28) 72%);
  animation: panical-lm-upload-spin .8s linear infinite;
}
@keyframes panical-lm-upload-spin { to { transform: rotate(360deg); } }

/* safe clickable URLs inside chat messages */
.panical-lm-message-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.panical-lm-message-link:hover { opacity: .75; }

/* Availability auto-reply links: contact form, WhatsApp, and email. */
.panical-lm-availability-link {
  color: #ff1053 !important;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.panical-lm-availability-contact-link {
  display: inline !important;
  white-space: normal !important;
  text-align: inherit !important;
  vertical-align: baseline;
  cursor: pointer;
}
.panical-lm-availability-link:hover,
.panical-lm-availability-link:focus-visible {
  color: #d90b43 !important;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* explicit staff presence states. */
.panical-lm-status.is-busy i,
.panical-lm-root.is-staff-busy .panical-lm-status i {
  background: #f59e0b;
}
.panical-lm-status.is-offline i,
.panical-lm-root.is-staff-offline .panical-lm-status i {
  background: #9ca3af;
}

/* reliable outgoing queue + one-click retry. */
.panical-lm-checks.is-queued {
  letter-spacing: 0;
  color: #9ca3af;
}
.panical-lm-msg.is-queued .panical-lm-bubble {
  opacity: .72;
}
.panical-lm-retry {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 0 0 2px;
  color: inherit;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.panical-lm-retry:hover,
.panical-lm-retry:focus-visible {
  opacity: .72;
}

/* WeChat-style outgoing sending indicator beside the bubble. */
.panical-lm-outgoing-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  max-width: 100%;
}
.panical-lm-outgoing-row .panical-lm-bubble {
  min-width: 0;
}
.panical-lm-send-spinner {
  display: none;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(17,17,17,.18);
  border-top-color: #111;
  border-radius: 50%;
  animation: panical-lm-send-spin .72s linear infinite;
}
.panical-lm-msg.customer.is-pending:not(.is-server-confirmed):not(.is-uploading) .panical-lm-send-spinner,
.panical-lm-msg.customer.is-queued:not(.is-server-confirmed) .panical-lm-send-spinner {
  display: inline-block;
}
.panical-lm-checks.is-queued,
.panical-lm-checks.is-pending {
  display: none;
}
@keyframes panical-lm-send-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .panical-lm-send-spinner { animation-duration: 1.6s; }
}

/* live typing indicator + drag-and-drop attachments. */
.panical-lm-typing {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 16px 6px;
  background: var(--panical-lm-chat-bg, #f6f6f6);
  color: #6b7280;
  font-size: 12px;
  line-height: 1.3;
}
.panical-lm-typing[hidden] { display: none !important; }
.panical-lm-typing em { font-style: normal; }
.panical-lm-form { position: relative; }
.panical-lm-form.is-dragover::after {
  content: "Drop file here";
  position: absolute;
  inset: 4px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #ff1053;
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  color: #ff1053;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

/* incremental history paging and return-to-latest control. */
.panical-lm-history-loader {
  position: absolute;
  z-index: 12;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 36px);
  padding: 5px 11px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  color: #777;
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}
.panical-lm-history-loader[hidden] { display: none !important; }
.panical-lm-latest-jump {
  position: absolute;
  z-index: 13;
  right: 16px;
  bottom: 76px;
  min-height: 32px;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}
.panical-lm-latest-jump[hidden] { display: none !important; }

