.portal-message-launcher {
  position: fixed;
  right: 22px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(85,215,193,0.32);
  background: linear-gradient(180deg, rgba(85,215,193,0.92), rgba(28,143,132,0.96));
  color: #061412;
  display: none !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(0,0,0,0.28);
  z-index: 45;
  padding: 0;
}
.portal-message-launcher-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ff6b6b;
  color: #fff;
  border: 2px solid #10151b;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-sizing: border-box;
}
.portal-message-launcher-badge.show {
  display: inline-flex;
}
.portal-message-launcher.show {
  display: inline-flex !important;
}
.portal-message-launcher:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(0,0,0,0.32);
}
.portal-message-launcher svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
@media (max-width: 620px) {
  .portal-message-launcher {
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
  }

  .portal-message-launcher svg {
    width: 21px;
    height: 21px;
  }
}
.portal-message-panel {
  --portal-message-shell-bg: rgba(18,22,28,0.98);
  --portal-message-shell-border: var(--line);
  --portal-message-shell-shadow: 0 22px 50px rgba(0,0,0,0.34);
  --portal-message-head-bg: #202c33;
  --portal-message-head-border: var(--line);
  --portal-message-body-bg: #0b141a;
  --portal-message-compose-bg: rgba(255,255,255,0.02);
  --portal-message-input-bg: #1f2c34;
  --portal-message-input-border: rgba(134,150,160,0.28);
  --portal-message-input-text: #e9edef;
  --portal-message-input-placeholder: #8696a0;
  --portal-message-input-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
  --portal-message-input-focus-border: rgba(85,215,193,0.38);
  --portal-message-input-focus-ring: 0 0 0 3px rgba(85,215,193,0.12);
  position: fixed;
  right: 22px;
  bottom: 94px;
  width: min(380px, calc(100vw - 28px));
  max-height: min(72vh, 640px);
  border-radius: 20px;
  border: 1px solid var(--portal-message-shell-border);
  background: var(--portal-message-shell-bg);
  box-shadow: var(--portal-message-shell-shadow);
  display: none !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  z-index: 46;
  font-family: "Avenir Next", Arial, sans-serif;
}
.portal-message-panel.show {
  display: grid !important;
}
@media (max-width: 620px) {
  .portal-message-panel {
    left: 12px;
    right: 12px;
    bottom: 76px;
    width: auto;
    max-height: min(76vh, 640px);
  }
}
.portal-message-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--portal-message-head-border);
  background: var(--portal-message-head-bg);
}
.portal-message-panel-head h4 {
  margin: 0;
  font-size: 21px;
}
.portal-message-panel-head .subtle {
  font-size: 12px;
  line-height: 1.4;
}
.portal-message-panel-body {
  padding: 12px 12px 6px;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  gap: 2px;
  align-content: start;
  background: var(--portal-message-body-bg);
}
.portal-message-bubble {
  max-width: min(58%, 280px);
  border-radius: 8px 8px 2px 8px;
  padding: 5px 7px 3px;
  border: 0;
  background: #005c4b;
  color: #e9edef;
  justify-self: end;
  font-size: 15.5px;
  line-height: 1.24;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: grid;
  gap: 0;
  box-shadow: none;
}
.portal-message-bubble.admin {
  justify-self: start;
  background: #202c33;
  color: #e9edef;
  border-radius: 8px 8px 8px 2px;
}
.portal-message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.portal-message-time {
  justify-self: end;
  font-size: 10px;
  line-height: 1;
  color: #8696a0;
  margin-top: 0;
}
.portal-message-status {
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.45;
}
.portal-message-status.pending {
  background: rgba(216,154,58,0.12);
  border-color: rgba(216,154,58,0.32);
  color: #f2c46d;
}
.portal-message-status.closed {
  background: rgba(209,106,104,0.12);
  border-color: rgba(209,106,104,0.28);
  color: #efb1af;
}
.portal-message-panel-compose {
  border-top: 1px solid var(--portal-message-head-border);
  padding: 12px 14px 14px;
  display: grid;
  gap: 10px;
  background: var(--portal-message-compose-bg);
}
.portal-message-panel-compose textarea {
  min-height: 88px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--portal-message-input-border);
  background: var(--portal-message-input-bg);
  color: var(--portal-message-input-text);
  font-size: 15px;
  line-height: 1.55;
  font-family: "Avenir Next", Arial, sans-serif;
  resize: vertical;
  outline: none;
  caret-color: #55d7c1;
  box-shadow: var(--portal-message-input-shadow);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.portal-message-panel-compose textarea::placeholder {
  color: var(--portal-message-input-placeholder);
}
.portal-message-panel-compose textarea:focus {
  border-color: var(--portal-message-input-focus-border);
  box-shadow: var(--portal-message-input-shadow), var(--portal-message-input-focus-ring);
}
body.light-theme .portal-message-panel {
  --portal-message-shell-bg: #f3f6fb;
  --portal-message-shell-border: #dbe4ee;
  --portal-message-shell-shadow: 0 20px 42px rgba(31, 60, 92, 0.18);
  --portal-message-head-bg: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  --portal-message-head-border: #dde5ee;
  --portal-message-body-bg: #efeae2;
  --portal-message-compose-bg: #fbfcfe;
  --portal-message-input-bg: linear-gradient(180deg, #fdfefe 0%, #f4f8fc 100%);
  --portal-message-input-border: #d6e0ea;
  --portal-message-input-text: #14212f;
  --portal-message-input-placeholder: #7b8897;
  --portal-message-input-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
  --portal-message-input-focus-border: rgba(13,59,102,0.28);
  --portal-message-input-focus-ring: 0 0 0 3px rgba(13,59,102,0.08);
  color: #14212f;
}
body.light-theme .portal-message-panel-head {
  border-bottom-color: var(--portal-message-head-border);
  background: var(--portal-message-head-bg);
}
body.light-theme .portal-message-panel-head h4 {
  color: #0f1720;
}
body.light-theme .portal-message-panel-head .subtle {
  color: #627181;
}
body.light-theme .portal-message-panel-body {
  background: #efeae2;
}
body.light-theme .portal-message-bubble {
  background: #d9fdd3;
  color: #111b21;
}
body.light-theme .portal-message-bubble.admin {
  background: #ffffff;
  color: #111b21;
}
body.light-theme .portal-message-time {
  color: #667781;
}
body.light-theme .portal-message-panel-compose {
  border-top-color: var(--portal-message-head-border);
  background: var(--portal-message-compose-bg);
}
body.light-theme .portal-message-status.pending {
  background: #fff4dc;
  border-color: #f0cc7d;
  color: #8a5a00;
}
body.light-theme .portal-message-status.closed {
  background: #fbecec;
  border-color: #e7b1b0;
  color: #8a2f2a;
}
