/*
 * LHN Chat frontend shell styles.
 * Readable source; minified artifact is generated by build policy later.
 */
.lhn-chat-locked {
  padding: 12px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #f8fbff;
  color: #1f2937;
  font-size: 14px;
}

.lhn-chat-shell {
  --lhn-chat-primary: #1f4f8b;
  --lhn-chat-accent: #5ca904;
  --lhn-chat-surface: #f6f8fb;
  --lhn-chat-border: #d6e1ee;
  --lhn-chat-text: #1f2937;
  --lhn-chat-bubble-own-start: #2f649f;
  --lhn-chat-bubble-own-end: #4f86bf;
  --lhn-chat-bubble-other-start: #edf4ff;
  --lhn-chat-bubble-other-end: #e2ecfb;
  color: var(--lhn-chat-text);
  font-size: 14px;
  line-height: 1.4;
}

.lhn-chat-shell,
.lhn-chat-shell input,
.lhn-chat-shell button,
.lhn-chat-shell select,
.lhn-chat-shell textarea {
  font-size: 12px;
}

.lhn-chat-shell button {
  padding: 6px 8px;
}

.lhn-chat-shell .lhn-chat-pane-title,
.lhn-chat-shell .lhn-chat-thread-title > span,
.lhn-chat-shell .lhn-chat-details-title > span {
  font-size: 15px;
}

.lhn-chat-shell .lhn-chat-room-item,
.lhn-chat-shell .lhn-chat-msg,
.lhn-chat-shell .lhn-chat-newchat-user {
  font-size: 14px;
}

.lhn-chat-shell .lhn-chat-meta,
.lhn-chat-shell .lhn-chat-msg-time,
.lhn-chat-shell .lhn-chat-room-status-badge,
.lhn-chat-shell .lhn-chat-newchat-count,
.lhn-chat-shell .lhn-chat-newchat-user-email {
  font-size: 12px;
}

.lhn-chat-shell-embedded {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 12px;
  background: #fff;
}

.lhn-chat-shell-launcher .lhn-chat-fab {
  position: fixed;
  right: 18px;
  bottom: 30px;
  z-index: 9999;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  line-height: 0;
  box-shadow: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.lhn-chat-shell-launcher .lhn-chat-fab-fallback {
  display: none;
}

.lhn-chat-shell-launcher .lhn-chat-fab.is-fallback {
  padding: 10px 18px;
  line-height: 1;
  background: linear-gradient(90deg, var(--lhn-chat-primary), var(--lhn-chat-accent));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
}

.lhn-chat-shell-launcher .lhn-chat-fab.is-fallback .lhn-chat-fab-fallback {
  display: inline-block;
}

.lhn-chat-shell-launcher .lhn-chat-fab.has-icon-bg {
  width: 83px;
  height: 75px;
  padding: 0;
  line-height: 0;
  border-radius: 0;
  box-shadow: none;
}

.lhn-chat-shell-launcher .lhn-chat-fab.has-icon-bg::after {
  content: "LHN Chat";
  position: absolute;
  right: 8px;
  bottom: -7px;
  color: #103063;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    -1px 0 0 #fff,
    1px 0 0 #fff,
    0 -1px 0 #fff,
    0 1px 0 #fff;
}

.lhn-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(460px, calc(100vw - 24px));
  height: min(640px, calc(100vh - 24px));
  z-index: 10000;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
}

.lhn-chat-panel[hidden] {
  display: none !important;
}

.lhn-chat-fab[hidden] {
  display: none !important;
}

.lhn-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--lhn-chat-border);
  background: var(--lhn-chat-surface);
}

.lhn-chat-close {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  background: #fff;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: #334155 !important;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}

.lhn-chat-body {
  display: block;
  min-height: 420px;
}

.lhn-chat-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 420px;
}

.lhn-chat-rooms {
  border-right: 1px solid var(--lhn-chat-border);
  background: var(--lhn-chat-surface);
}

.lhn-chat-pane-title {
  font-weight: 400;
  padding: 7px 12px;
  border-bottom: 1px solid var(--lhn-chat-border);
}

.lhn-chat-thread-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.lhn-chat-thread-head-left,
.lhn-chat-thread-head-right {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.lhn-chat-thread-head-main {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
}

.lhn-chat-thread-room-name {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lhn-chat-thread-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.lhn-chat-thread-identity-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.lhn-chat-thread-identity-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
  color: #1f2a44;
}

.lhn-chat-thread-identity-meta {
  font-size: 10px;
  line-height: 1.25;
  font-weight: 400;
  color: #63748b;
}

.lhn-chat-thread-identity-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.25;
  color: #4c617f;
}

.lhn-chat-thread-head-spacer {
  width: 34px;
  height: 34px;
  display: inline-block;
}

.lhn-chat-room-status-badge {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.lhn-chat-room-status-badge.is-active {
  border-color: #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.lhn-chat-room-status-badge.is-archived {
  border-color: #fcd34d;
  color: #92400e;
  background: #fffbeb;
}

.lhn-chat-rooms-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lhn-chat-thread-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.lhn-chat-members-toggle {
  border: 1px solid var(--lhn-chat-border);
  background: #fff;
  color: #334155;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
}

.lhn-chat-members-toggle:hover {
  border-color: var(--lhn-chat-primary);
}

.lhn-chat-leave-room-btn,
.lhn-chat-archive-room-btn,
.lhn-chat-theme-btn,
.lhn-chat-settings-btn {
  border: 1px solid var(--lhn-chat-border);
  background: #fff;
  color: #334155;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
}

.lhn-chat-leave-room-btn {
  border-color: #fecaca;
  color: #991b1b;
}

.lhn-chat-archive-room-btn {
  border-color: #d1d5db;
  color: #374151;
}

.lhn-chat-theme-btn {
  border-color: #c7d2fe;
  color: #3730a3;
}

.lhn-chat-settings-btn {
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.lhn-chat-leave-room-btn:hover,
.lhn-chat-archive-room-btn:hover,
.lhn-chat-theme-btn:hover,
.lhn-chat-settings-btn:hover {
  border-color: var(--lhn-chat-primary);
}

.lhn-chat-room-list {
  max-height: 520px;
  overflow: auto;
  padding: 8px;
}

.lhn-chat-room-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  background: #fff;
  margin: 0 0 8px;
  padding: 8px;
  cursor: pointer;
  color: #0f172a !important;
  opacity: 1 !important;
}

.lhn-chat-room-item:hover {
  border-color: var(--lhn-chat-primary);
}

.lhn-chat-room-item .lhn-chat-room-name {
  color: #0f172a !important;
  opacity: 1 !important;
}

.lhn-chat-room-item:focus,
.lhn-chat-room-item:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}

.lhn-chat-room-item-badge {
  margin-left: auto;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  color: #92400e;
  background: #fffbeb;
}

.lhn-chat-room-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #cbd5e1;
  flex: 0 0 auto;
}

.lhn-chat-room-dot.is-active {
  background: var(--lhn-chat-accent);
}

.lhn-chat-room-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0f172a !important;
  opacity: 1 !important;
}

.lhn-chat-thread {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  min-width: 0;
}

.lhn-chat-messages {
  flex: 1;
  max-height: 480px;
  overflow: auto;
  padding: 10px;
  background: #fff;
}

.lhn-chat-msg {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 8px;
}

.lhn-chat-msg-system {
  background: #f8fbff;
  border-style: dashed;
}

.lhn-chat-msg-body {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.lhn-chat-text-icon {
  display: inline-block;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.08em;
  line-height: 1;
  vertical-align: -0.08em;
}

.lhn-chat-link {
  color: #1d4ed8;
  text-decoration: underline;
}

.lhn-chat-link-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #d7e2f0;
  border-radius: 8px;
  background: #f8fbff;
  color: #334155;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.lhn-chat-link-preview-head {
  display: flex;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.lhn-chat-link-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 auto;
}

.lhn-chat-link-preview-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: #334155;
}

.lhn-chat-link-preview-body em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.lhn-chat-link-preview-body strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.3;
}

.lhn-chat-link-preview-desc {
  color: #64748b;
  display: block;
  font-size: 12px;
  line-height: 1.25;
  width: 100%;
}

.lhn-chat-reactions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.lhn-chat-reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  padding: 3px 7px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.lhn-chat-reaction-btn:hover {
  border-color: var(--lhn-chat-primary);
}

.lhn-chat-reaction-btn.is-active {
  border-color: var(--lhn-chat-primary);
  background: #eff6ff;
  color: #1e3a8a;
}

.lhn-chat-reaction-icon {
  font-size: 13px;
}

.lhn-chat-reaction-count {
  min-width: 8px;
}

.lhn-chat-msg-meta {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

.lhn-chat-edited-label {
  display: inline-block;
  margin-left: 6px;
  color: #475569;
  font-size: 11px;
  font-style: italic;
}

.lhn-chat-msg-actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

.lhn-chat-poll-btn {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.lhn-chat-poll-btn:hover {
  border-color: var(--lhn-chat-primary);
}

.lhn-chat-poll-card {
  margin-top: 8px;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  padding: 8px;
  background: #f8fbff;
  color: #0f172a;
  position: relative;
}

.lhn-chat-poll-question {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  color: #0f172a;
  margin: 0 32px 8px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.lhn-chat-poll-manage {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
}

.lhn-chat-poll-manage-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--lhn-chat-border);
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lhn-chat-poll-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .16);
  padding: 6px;
  flex-direction: column;
  gap: 6px;
}

.lhn-chat-poll-menu.is-open {
  display: flex;
}

.lhn-chat-poll-menu button {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 7px;
  background: #fff;
  color: #334155;
  min-height: 30px;
  padding: 0 10px;
  text-align: left;
  cursor: pointer;
}

.lhn-chat-poll-menu .lhn-chat-poll-close-btn {
  border-color: #fecaca;
  color: #991b1b;
}

.lhn-chat-poll-mode {
  font-size: 12px;
  color: #475569;
  margin-bottom: 6px;
  padding-right: 38px;
}

.lhn-chat-poll-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: #0f172a;
}

.lhn-chat-poll-option span {
  color: #0f172a;
}

.lhn-chat-poll-option small {
  color: #64748b;
  font-size: 11px;
}

.lhn-chat-poll-vote-btn {
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--lhn-chat-primary);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.lhn-chat-poll-closed {
  color: #b45309;
  font-size: 12px;
  margin-bottom: 6px;
}

.lhn-chat-msg-edit-btn,
.lhn-chat-msg-delete-btn {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

.lhn-chat-msg-delete-btn {
  border-color: #fecaca;
  color: #991b1b;
}

.lhn-chat-empty {
  color: #64748b;
  font-size: 13px;
  padding: 6px;
}

.lhn-chat-create-room-btn {
  width: 100%;
  border: 1px solid var(--lhn-chat-primary);
  border-radius: 8px;
  background: #fff;
  color: var(--lhn-chat-primary);
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
}

.lhn-chat-create-room-btn:hover {
  background: #eff6ff;
}

.lhn-chat-create-room-inline {
  width: auto;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 7px;
}

.lhn-chat-composer {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--lhn-chat-border);
  background: var(--lhn-chat-surface);
}

.lhn-chat-composer textarea[name="message"],
.lhn-chat-composer textarea[name="chat_message"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.4;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  overflow-y: auto;
}

.lhn-chat-composer button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--lhn-chat-primary);
  color: #fff;
  cursor: pointer;
}

.lhn-chat-attach-btn {
  border: 1px solid var(--lhn-chat-primary) !important;
  background: #fff !important;
  color: var(--lhn-chat-primary) !important;
}

.lhn-chat-attach-btn:hover {
  background: #eff6ff !important;
}

.lhn-chat-error {
  padding: 8px 10px;
  margin: 0 10px 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
}

.lhn-chat-archived-note {
  margin: 8px 10px 0;
  padding: 8px 10px;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
}

.lhn-chat-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.lhn-chat-modal {
  width: min(560px, 100%);
  max-height: calc(100% - 12px);
  overflow: auto;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
}

.lhn-chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--lhn-chat-border);
  background: var(--lhn-chat-surface);
}

.lhn-chat-settings-close {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.lhn-chat-modal-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.lhn-chat-modal-body label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.lhn-chat-modal-body input,
.lhn-chat-modal-body textarea {
  width: 100%;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 14px;
}

.lhn-chat-settings-row {
  display: flex;
  justify-content: flex-start;
}

.lhn-chat-room-image-preview-wrap {
  min-height: 0;
}

.lhn-chat-room-image-preview {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 6px;
  max-width: 220px;
}

.lhn-chat-room-image-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: cover;
  border-radius: 6px;
}

.lhn-chat-room-image-pick {
  border: 1px solid var(--lhn-chat-primary);
  border-radius: 6px;
  background: #fff;
  color: var(--lhn-chat-primary);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.lhn-chat-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--lhn-chat-border);
  background: #fff;
}

.lhn-chat-modal-footer-left,
.lhn-chat-modal-footer-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lhn-chat-settings-cancel,
.lhn-chat-settings-save,
.lhn-chat-settings-archive {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
}

.lhn-chat-settings-save {
  border-color: var(--lhn-chat-primary);
  background: var(--lhn-chat-primary);
  color: #fff;
}

.lhn-chat-settings-archive {
  border-color: #cbd5e1;
  color: #334155;
}

.lhn-chat-members-panel {
  border-bottom: 1px solid var(--lhn-chat-border);
  background: #f8fbff;
  padding: 8px 10px;
}

.lhn-chat-members-search {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.lhn-chat-members-search-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
}

.lhn-chat-members-search-btn {
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--lhn-chat-primary);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.lhn-chat-members-section-title {
  font-weight: 600;
  font-size: 14px;
  margin: 8px 0 6px;
  color: #475569;
}

.lhn-chat-members-list {
  overflow: auto;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 6px;
  background: #fff;
  margin-bottom: 20px;
}

.lhn-chat-member-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid #edf2f7;
}

.lhn-chat-member-row:last-child {
  border-bottom: 0;
}

.lhn-chat-member-name {
  font-size: 13px;
}

.lhn-chat-member-meta {
  color: #64748b;
  font-size: 12px;
}

.lhn-chat-member-add-btn,
.lhn-chat-member-promote-btn,
.lhn-chat-member-demote-btn,
.lhn-chat-member-remove-btn,
.lhn-chat-member-role-select {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  padding: 4px 7px;
  font-size: 11px;
  cursor: pointer;
}

.lhn-chat-member-add-btn:hover,
.lhn-chat-member-promote-btn:hover,
.lhn-chat-member-demote-btn:hover,
.lhn-chat-member-remove-btn:hover,
.lhn-chat-member-role-select:hover {
  border-color: var(--lhn-chat-primary);
}

.lhn-chat-image-btn {
  position: relative;
  margin-top: 8px;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: inline-block;
  max-width: min(420px, 100%);
}

.lhn-chat-image-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(15, 23, 42, 0.14);
  border-top-color: rgba(37, 99, 235, 0.92);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition: opacity .12s ease;
  animation: lhn-chat-image-spin .8s linear infinite;
}

.lhn-chat-image-btn img {
  display: block;
  max-width: 100%;
  height: auto;
  opacity: 1;
  transition: opacity .16s ease;
}

.lhn-chat-image-btn.is-loading::before {
  opacity: 1;
}

.lhn-chat-image-btn.is-loading img {
  opacity: 0;
}

@keyframes lhn-chat-image-spin {
  to {
    transform: rotate(360deg);
  }
}

.lhn-chat-image-caption {
  margin-top: 8px;
}

.lhn-chat-image-gallery-count {
  margin-top: 6px;
  font-size: 12px;
  color: #475569;
}

.lhn-chat-shell .lhn-chat-msg.is-own .lhn-chat-image-gallery-count {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lhn-chat-shell .lhn-chat-msg:not(.is-own) .lhn-chat-image-gallery-count {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lhn-chat-file-card {
  margin-top: 8px;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  max-width: min(420px, 100%);
}

.lhn-chat-file-link {
  display: inline-block;
  font-weight: 600;
  color: #1f4f8b;
  text-decoration: none;
  word-break: break-word;
}

.lhn-chat-file-link:hover {
  text-decoration: underline;
}

.lhn-chat-file-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  word-break: break-word;
}

.lhn-chat-upload-status {
  margin-top: 6px;
  font-size: 12px;
  color: #0f766e;
}

.lhn-chat-history-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  margin: 2px 0 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
}

.lhn-chat-history-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(100, 116, 139, 0.24);
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: lhn-chat-history-spin .8s linear infinite;
}

@keyframes lhn-chat-history-spin {
  to {
    transform: rotate(360deg);
  }
}

.lhn-chat-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(2, 6, 23, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.lhn-chat-lightbox {
  position: relative;
  width: min(1100px, calc(100vw - 28px));
  height: min(760px, calc(100vh - 28px));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.28);
  overflow: hidden;
}

.lhn-chat-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.55);
}

.lhn-chat-lightbox.is-loading img {
  opacity: 0;
}

.lhn-chat-lightbox.is-loading::before {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 999px;
  animation: lhn-chat-lightbox-spin .8s linear infinite;
}

@keyframes lhn-chat-lightbox-spin {
  to {
    transform: rotate(360deg);
  }
}

.lhn-chat-lightbox-close,
.lhn-chat-lightbox-download {
  position: absolute;
  top: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.78);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.lhn-chat-lightbox-close {
  right: 10px;
  font-size: 24px;
  line-height: 1;
}

.lhn-chat-lightbox-download {
  right: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lhn-chat-lightbox-download svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lhn-chat-lightbox-prev,
.lhn-chat-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.78);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.lhn-chat-lightbox-prev {
  left: 10px;
}

.lhn-chat-lightbox-next {
  right: 10px;
}

.lhn-chat-lightbox-counter {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: rgba(2, 6, 23, 0.78);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  z-index: 2;
}

@media (max-width: 767px) {
  .lhn-chat-layout {
    grid-template-columns: 1fr;
  }

  .lhn-chat-rooms {
    border-right: 0;
    border-bottom: 1px solid var(--lhn-chat-border);
  }

  .lhn-chat-room-list {
    max-height: 140px;
  }

  .lhn-chat-panel {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }

  .lhn-chat-member-row {
    grid-template-columns: 1fr auto;
  }

  .lhn-chat-thread-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .lhn-chat-lightbox {
    width: 100%;
    height: calc(100vh - 28px);
  }

  .lhn-chat-lightbox-close,
  .lhn-chat-lightbox-download {
    width: 32px;
    height: 32px;
  }

  .lhn-chat-lightbox-close {
    font-size: 22px;
  }

  .lhn-chat-lightbox-download {
    right: 50px;
  }
}

/*
 * Minimalist refresh (desktop + mobile)
 * Keeps existing class names/JS behavior and overrides visual style only.
 */
.lhn-chat-shell {
  --lhn-chat-primary: #4f46e5;
  --lhn-chat-accent: #22c55e;
  --lhn-chat-surface: #f8fafc;
  --lhn-chat-border: #e2e8f0;
  --lhn-chat-text: #0f172a;
  --lhn-chat-muted: #64748b;
}

.lhn-chat-shell-embedded {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.lhn-chat-panel {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.lhn-chat-header {
  padding: 14px 16px;
  background: #ffffff;
  position: relative;
  min-height: 56px;
  padding-right: 64px;
}

.lhn-chat-header strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.lhn-chat-layout {
  grid-template-columns: minmax(240px, 300px) 1fr;
  min-height: 540px;
}

.lhn-chat-shell-embedded .lhn-chat-layout {
  grid-template-columns: minmax(170px, 38%) 1fr;
}

/* Launcher panel is compact; force stacked flow for readability. */
.lhn-chat-shell-launcher .lhn-chat-layout {
  grid-template-columns: 1fr;
  min-height: 460px;
}

.lhn-chat-shell-launcher .lhn-chat-rooms {
  border-right: 0;
  border-bottom: 1px solid var(--lhn-chat-border);
}

.lhn-chat-shell-launcher .lhn-chat-room-list {
  max-height: 180px;
}

.lhn-chat-shell-launcher .lhn-chat-thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lhn-chat-shell-launcher .lhn-chat-members-panel {
  max-height: 240px;
  overflow: auto;
}

.lhn-chat-rooms {
  background: #ffffff;
  border-right: 1px solid var(--lhn-chat-border);
}

.lhn-chat-pane-title {
  padding: 7px 14px;
  background: #ffffff;
}

.lhn-chat-rooms-title {
  border-bottom: 1px solid var(--lhn-chat-border);
}

.lhn-chat-room-list {
  max-height: 560px;
  padding: 10px;
}

.lhn-chat-room-item {
  border: 1px solid transparent;
  background: #f8fafc;
  border-radius: 12px;
  margin: 0 0 6px;
  padding: 10px 10px;
  transition: border-color 120ms ease, background-color 120ms ease;
  color: #0f172a !important;
  opacity: 1 !important;
}

.lhn-chat-room-item:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.lhn-chat-room-dot {
  width: 7px;
  height: 7px;
}

.lhn-chat-thread {
  background: #ffffff;
}

.lhn-chat-thread-title {
  border-bottom: 1px solid var(--lhn-chat-border);
}

.lhn-chat-close {
  color: #334155 !important;
  font-size: 22px;
  line-height: 1;
  font-weight: 600;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  pointer-events: auto;
}

.lhn-chat-messages {
  padding: 16px;
  background: #ffffff;
}

.lhn-chat-msg {
  border: 0;
  border-radius: 12px;
  background: #f8fafc;
  margin: 0 0 10px;
  padding: 10px 12px;
}

.lhn-chat-room-name,
.lhn-chat-msg-body {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lhn-chat-msg-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--lhn-chat-muted);
}

.lhn-chat-msg-actions {
  margin-top: 8px;
}

.lhn-chat-composer {
  gap: 8px;
  padding: 7px 12px;
  border-top: 1px solid var(--lhn-chat-border);
  background: #ffffff;
}

.lhn-chat-composer textarea[name="message"],
.lhn-chat-composer textarea[name="chat_message"] {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 15px;
  padding: 10px 14px;
  background: #f8fafc;
  line-height: 1.4;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  overflow-y: auto;
}

.lhn-chat-composer button {
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
}

.lhn-chat-poll-btn,
.lhn-chat-members-toggle,
.lhn-chat-leave-room-btn,
.lhn-chat-archive-room-btn,
.lhn-chat-theme-btn,
.lhn-chat-settings-btn {
  border-radius: 999px;
  font-size: 11px;
  padding: 6px 10px;
}

.lhn-chat-members-panel {
  border-bottom: 1px solid var(--lhn-chat-border);
  background: #f8fafc;
  padding: 10px 12px;
}

.lhn-chat-members-list {
  border-radius: 10px;
  background: #ffffff;
}

.lhn-chat-member-row {
  padding: 8px 10px;
}

@media (max-width: 767px) {
  .lhn-chat-shell-launcher .lhn-chat-fab.has-icon-bg {
    width: 62px;
    height: 56px;
  }

  .lhn-chat-layout {
    grid-template-columns: 1fr;
    min-height: 440px;
  }

  .lhn-chat-room-list {
    max-height: 170px;
  }

  .lhn-chat-header strong {
    font-size: 16px;
  }

  .lhn-chat-messages {
    padding: 12px;
  }

  .lhn-chat-msg {
    border-radius: 10px;
    padding: 9px 10px;
  }
}

@media (max-width: 1100px) {
  .lhn-chat-shell-embedded .lhn-chat-layout {
    grid-template-columns: 1fr;
    min-height: 460px;
  }

  .lhn-chat-shell-embedded .lhn-chat-rooms {
    border-right: 0;
    border-bottom: 1px solid var(--lhn-chat-border);
  }

  .lhn-chat-shell-embedded .lhn-chat-room-list {
    max-height: 180px;
  }
}


@media (max-width: 960px) {
  .lhn-chat-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    right: 8px;
    bottom: 8px;
  }
}

/* Launcher hardening: always keep a readable single-column flow. */
.lhn-chat-shell-launcher .lhn-chat-body,
.lhn-chat-shell-launcher .lhn-chat-layout,
.lhn-chat-shell-launcher .lhn-chat-thread,
.lhn-chat-shell-launcher .lhn-chat-members-panel,
.lhn-chat-shell-launcher .lhn-chat-messages,
.lhn-chat-shell-launcher .lhn-chat-composer {
  min-width: 0 !important;
}

.lhn-chat-shell-launcher .lhn-chat-layout {
  display: grid !important;
  grid-template-columns: 1fr !important;
}

.lhn-chat-panel .lhn-chat-layout {
  display: grid !important;
  grid-template-columns: 1fr !important;
}

.lhn-chat-shell-launcher .lhn-chat-rooms {
  border-right: 0 !important;
  border-bottom: 1px solid var(--lhn-chat-border) !important;
}

.lhn-chat-panel .lhn-chat-rooms {
  border-right: 0 !important;
  border-bottom: 1px solid var(--lhn-chat-border) !important;
}

.lhn-chat-shell-launcher .lhn-chat-room-list {
  max-height: 180px !important;
}

.lhn-chat-panel .lhn-chat-room-list {
  max-height: 180px !important;
}

.lhn-chat-shell-launcher .lhn-chat-thread-actions {
  width: 100% !important;
  justify-content: flex-start !important;
}

.lhn-chat-shell-launcher .lhn-chat-members-panel {
  display: block !important;
  width: 100% !important;
  max-height: 240px !important;
  overflow: auto !important;
}

.lhn-chat-shell-launcher .lhn-chat-members-search {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
}

.lhn-chat-shell-launcher .lhn-chat-member-row {
  grid-template-columns: 1fr auto !important;
}

/* App-like compact flow + icon buttons overrides */
.lhn-chat-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.lhn-chat-btn-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}

.lhn-chat-back-btn,
.lhn-chat-members-toggle,
.lhn-chat-new-dm-btn,
.lhn-chat-theme-btn,
.lhn-chat-settings-btn,
.lhn-chat-leave-room-btn,
.lhn-chat-archive-room-btn,
.lhn-chat-attach-btn,
.lhn-chat-poll-btn,
.lhn-chat-send-btn,
.lhn-chat-create-room-inline {
  min-width: 34px;
  height: 34px;
  padding: 0 8px !important;
}

.lhn-chat-back-btn {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.lhn-chat-shell .lhn-chat-details-toggle {
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0 !important;
  color: #1f4f8b;
}

.lhn-chat-shell .lhn-chat-details-toggle .lhn-chat-btn-icon {
  font-size: 24px !important;
  line-height: 1;
}

.lhn-chat-shell .lhn-chat-details-toggle:hover {
  background: transparent !important;
}

.lhn-chat-panel .lhn-chat-layout.is-mobile .lhn-chat-rooms,
.lhn-chat-panel .lhn-chat-layout.is-mobile .lhn-chat-thread {
  display: none !important;
}

.lhn-chat-panel .lhn-chat-layout.is-mobile.is-mobile-pane-rooms .lhn-chat-rooms {
  display: block !important;
}

.lhn-chat-panel .lhn-chat-layout.is-mobile.is-mobile-pane-thread .lhn-chat-thread {
  display: flex !important;
}

.lhn-chat-panel .lhn-chat-layout.is-mobile.is-mobile-pane-thread .lhn-chat-thread-actions {
  margin-left: auto;
}


/* ------------------------------------------------------------------
   Chat V2 three-pane layout overrides (rooms | thread | details)
   ------------------------------------------------------------------ */
.lhn-chat-shell-launcher .lhn-chat-panel {
  width: 420px !important;
  height: 640px !important;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  z-index: 2147483000 !important;
}

.lhn-chat-shell .lhn-chat-body {
  min-height: 560px;
}

.lhn-chat-shell .lhn-chat-layout {
  display: grid !important;
  grid-template-columns: 300px 1fr;
  min-height: 560px;
}

.lhn-chat-shell .lhn-chat-layout.is-details-open {
  grid-template-columns: 300px 1fr 320px;
}

.lhn-chat-shell .lhn-chat-rooms,
.lhn-chat-shell .lhn-chat-thread,
.lhn-chat-shell .lhn-chat-details {
  min-width: 0;
}

.lhn-chat-shell .lhn-chat-rooms {
  border-right: 1px solid var(--lhn-chat-border) !important;
  border-bottom: 0 !important;
  background: #f8fafc;
}

.lhn-chat-shell .lhn-chat-room-search-wrap {
  padding: 5px 12px;
  border-bottom: 1px solid var(--lhn-chat-border);
}

.lhn-chat-shell .lhn-chat-room-search {
  width: 100%;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 10px;
  min-height: 25px;
  padding: 8px 10px;
}

.lhn-chat-shell .lhn-chat-rooms-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lhn-chat-shell .lhn-chat-rooms-title > span {
  margin-right: auto;
}

.lhn-chat-shell .lhn-chat-user-results {
  padding: 8px 10px 0;
}

.lhn-chat-shell .lhn-chat-user-results-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.lhn-chat-shell .lhn-chat-user-result {
  width: 100%;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 10px;
  background: #ffffff;
  text-align: left;
  padding: 7px 10px;
  margin-bottom: 6px;
  display: block;
}

.lhn-chat-shell .lhn-chat-user-result-name {
  display: block;
  font-weight: 600;
  color: #0f172a;
}

.lhn-chat-shell .lhn-chat-user-result-email {
  display: block;
  font-size: 12px;
  color: #64748b;
}

.lhn-chat-shell .lhn-chat-thread {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--lhn-chat-border);
  background: #fff;
}

.lhn-chat-shell .lhn-chat-thread-actions {
  margin-left: auto;
}

.lhn-chat-shell .lhn-chat-thread-title {
  flex-wrap: nowrap;
}

.lhn-chat-shell .lhn-chat-details {
  display: none;
  flex-direction: column;
  background: #fff;
}

.lhn-chat-shell .lhn-chat-details.is-visible {
  display: flex;
}

.lhn-chat-shell .lhn-chat-details-body {
  padding: 10px;
  overflow: auto;
  max-height: calc(640px - 54px);
}

.lhn-chat-shell .lhn-chat-detail-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.lhn-chat-shell .lhn-chat-detail-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.lhn-chat-shell .lhn-chat-detail-actions-main {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.lhn-chat-shell .lhn-chat-details-back-inline {
  width: 38px;
  min-width: 38px;
  justify-content: center;
  padding: 0;
}

.lhn-chat-shell .lhn-chat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.lhn-chat-shell .lhn-chat-modal {
  width: min(420px, calc(100% - 20px));
  max-height: calc(100% - 20px);
  background: #fff;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lhn-chat-shell .lhn-chat-modal-head,
.lhn-chat-shell .lhn-chat-modal-foot {
  padding: 10px 12px;
  border-bottom: 1px solid var(--lhn-chat-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lhn-chat-shell .lhn-chat-modal-foot {
  border-bottom: 0;
  border-top: 1px solid var(--lhn-chat-border);
}

.lhn-chat-shell .lhn-chat-modal-body {
  padding: 10px 12px;
  overflow: auto;
}

.lhn-chat-shell .lhn-chat-newchat-search {
  width: 100%;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 10px;
  min-height: 36px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.lhn-chat-shell .lhn-chat-newchat-results {
  display: grid;
  gap: 6px;
}

.lhn-chat-shell .lhn-chat-newchat-user {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  padding: 8px 10px;
}

.lhn-chat-shell .lhn-chat-newchat-user.is-selected {
  border-color: #1f4f8b;
  background: #eff6ff;
}

.lhn-chat-shell .lhn-chat-newchat-user.is-disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.lhn-chat-shell .lhn-chat-newchat-user-name {
  display: block;
  font-weight: 600;
  color: #0f172a;
}

.lhn-chat-shell .lhn-chat-newchat-user-email {
  display: block;
  font-size: 12px;
  color: #64748b;
}

.lhn-chat-shell .lhn-chat-newchat-close {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  background: #fff;
  width: 34px;
  height: 34px;
  font-size: 22px;
  line-height: 1;
}

.lhn-chat-shell .lhn-chat-newchat-start {
  border: 1px solid #1f4f8b;
  border-radius: 8px;
  background: #1f4f8b;
  color: #fff;
  min-height: 34px;
  padding: 0 12px;
}

.lhn-chat-shell .lhn-chat-newchat-count {
  font-size: 12px;
  color: #64748b;
}

/* Chat UI refinement */
.lhn-chat-shell .lhn-chat-header strong {
  font-size: 30px;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.lhn-chat-shell .lhn-chat-close,
.lhn-chat-shell .lhn-chat-newchat-close,
.lhn-chat-shell .lhn-chat-confirm-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  font-weight: 700;
}

.lhn-chat-shell .lhn-chat-close .lhn-chat-btn-icon,
.lhn-chat-shell .lhn-chat-newchat-close .lhn-chat-btn-icon,
.lhn-chat-shell .lhn-chat-confirm-close .lhn-chat-btn-icon {
  line-height: 1;
  font-size: 24px;
}

.lhn-chat-shell .lhn-chat-layout {
  min-height: 0;
  height: 100%;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.lhn-chat-shell .lhn-chat-rooms {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lhn-chat-shell .lhn-chat-room-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.lhn-chat-shell .lhn-chat-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lhn-chat-shell .lhn-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 8px;
}

.lhn-chat-shell .lhn-chat-composer {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #fff;
  border-top: 1px solid var(--lhn-chat-border);
}

.lhn-chat-shell .lhn-chat-pane-title {
  background: #fff;
}

.lhn-chat-shell .lhn-chat-details-title {
  justify-content: flex-start;
}

.lhn-chat-shell .lhn-chat-details-title .lhn-chat-details-back,
.lhn-chat-shell .lhn-chat-details-title .lhn-chat-details-close {
  margin-right: auto;
}

.lhn-chat-shell .lhn-chat-newchat-results,
.lhn-chat-shell .lhn-chat-member-search-results {
  max-height: 250px;
  overflow-y: auto;
  padding: 15px;
}

.lhn-chat-shell .lhn-chat-newchat-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.lhn-chat-shell .lhn-chat-newchat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 4px 10px;
}

.lhn-chat-shell .lhn-chat-newchat-chip-remove {
  border: 0;
  background: transparent;
  color: #1e3a8a;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.lhn-chat-shell .lhn-chat-newchat-selected-empty {
  color: #64748b;
  font-size: 12px;
}

.lhn-chat-shell .lhn-chat-confirm-modal .lhn-chat-modal-foot {
  justify-content: flex-end;
}

.lhn-chat-shell .lhn-chat-confirm-cancel,
.lhn-chat-shell .lhn-chat-confirm-ok {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  min-height: 34px;
  padding: 0 12px;
  background: #fff;
}

.lhn-chat-shell .lhn-chat-confirm-ok {
  background: #1f4f8b;
  color: #fff;
  border-color: #1f4f8b;
}

.lhn-chat-shell .lhn-chat-detail-actions button {
  border-radius: 999px;
  min-height: 36px;
}

.lhn-chat-shell .lhn-chat-members-panel {
  display: block !important;
  width: 100% !important;
  max-height: none !important;
  overflow: visible !important;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.lhn-chat-shell .lhn-chat-room-item,
.lhn-chat-shell .lhn-chat-member-row,
.lhn-chat-shell .lhn-chat-msg {
  color: #0f172a !important;
  opacity: 1 !important;
}

.lhn-chat-shell .lhn-chat-room-item .lhn-chat-room-name {
  color: #0f172a !important;
}

/* Composer icon-only actions (attach/poll) */
.lhn-chat-shell .lhn-chat-composer .lhn-chat-attach-btn,
.lhn-chat-shell .lhn-chat-composer .lhn-chat-poll-btn {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  color: #1f4f8b !important;
}

.lhn-chat-shell .lhn-chat-composer .lhn-chat-attach-btn:hover,
.lhn-chat-shell .lhn-chat-composer .lhn-chat-poll-btn:hover {
  background: transparent !important;
}

.lhn-chat-shell .lhn-chat-composer .lhn-chat-attach-btn .lhn-chat-btn-icon,
.lhn-chat-shell .lhn-chat-composer .lhn-chat-poll-btn .lhn-chat-btn-icon {
  font-size: 22px !important;
  line-height: 1 !important;
}

.lhn-chat-shell .lhn-chat-composer-plus-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  overflow: visible !important;
}

.lhn-chat-shell .lhn-chat-composer-plus-menu {
  display: none;
  position: absolute;
  right: 0 !important;
  left: auto !important;
  bottom: calc(100% + 8px);
  z-index: 35;
  width: 170px !important;
  min-width: 170px !important;
  max-width: min(220px, calc(100vw - 24px)) !important;
  background: #fff;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
  padding: 6px;
  gap: 4px;
}

.lhn-chat-shell .lhn-chat-composer-plus-wrap.is-open .lhn-chat-composer-plus-menu {
  display: grid;
}

.lhn-chat-shell .lhn-chat-composer-plus-menu button {
  display: block !important;
  width: 100% !important;
  border: 0;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 12px;
  text-align: left;
  padding: 7px 9px;
  border-radius: 8px;
  min-height: 30px;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.lhn-chat-shell .lhn-chat-composer-plus-menu button:hover {
  background: #f1f5f9;
}

.lhn-chat-shell .lhn-chat-createpoll-options {
  display: grid;
  gap: 8px;
}

.lhn-chat-shell .lhn-chat-createpoll-option-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.lhn-chat-shell .lhn-chat-createpoll-remove-option {
  border: 1px solid #fecaca;
  background: #fff;
  color: #991b1b;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  padding: 0;
  line-height: 1;
}

.lhn-chat-shell .lhn-chat-createpoll-add-option {
  width: max-content;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 6px 10px;
}

@media (max-width: 860px) {
  .lhn-chat-shell .lhn-chat-panel {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 14px;
  }

  .lhn-chat-shell .lhn-chat-body,
  .lhn-chat-shell .lhn-chat-layout {
    min-height: calc(100vh - 66px);
  }

  .lhn-chat-shell .lhn-chat-layout,
  .lhn-chat-shell .lhn-chat-layout.is-details-open {
    grid-template-columns: 1fr !important;
  }

  .lhn-chat-shell .lhn-chat-rooms,
  .lhn-chat-shell .lhn-chat-thread,
  .lhn-chat-shell .lhn-chat-details {
    display: none !important;
    border-right: 0 !important;
  }

  .lhn-chat-shell .lhn-chat-layout.is-mobile-pane-rooms .lhn-chat-rooms,
  .lhn-chat-shell .lhn-chat-layout.is-mobile-pane-thread .lhn-chat-thread,
  .lhn-chat-shell .lhn-chat-layout.is-mobile-pane-details .lhn-chat-details {
    display: flex !important;
    flex-direction: column;
  }

  .lhn-chat-shell .lhn-chat-thread {
    border-right: 0;
  }

  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-rooms.is-visible,
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-thread.is-visible,
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-details.is-visible {
    display: flex !important;
    flex-direction: column;
  }

  .lhn-chat-shell .lhn-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
  }

  .lhn-chat-shell .lhn-chat-details-body {
    max-height: none;
  }
}

/* Message bubble redesign (minimal style) */
.lhn-chat-shell .lhn-chat-msg {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 0 20px !important;
}

.lhn-chat-shell .lhn-chat-msg.lhn-chat-msg-system {
  margin: 8px 0 12px !important;
  text-align: center;
}

.lhn-chat-shell .lhn-chat-msg-system-text {
  display: inline-block;
  max-width: 92%;
  font-size: 11px !important;
  line-height: 1.4;
  color: #64748b;
  font-weight: 500;
}

.lhn-chat-shell .lhn-chat-msg-shell {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  justify-content: flex-start;
}

.lhn-chat-shell .lhn-chat-msg.is-own .lhn-chat-msg-shell {
  justify-content: flex-end;
  align-items: flex-end;
}

.lhn-chat-shell .lhn-chat-msg-bubble-wrap {
  position: relative;
  max-width: min(86%, 760px);
  min-width: 170px;
  border-radius: 22px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--lhn-chat-bubble-own-start) 0%, var(--lhn-chat-bubble-own-end) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 79, 139, 0.22);
}

.lhn-chat-shell .lhn-chat-msg-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.lhn-chat-shell .lhn-chat-msg.is-own .lhn-chat-msg-main {
  align-items: flex-end;
}

.lhn-chat-shell .lhn-chat-msg-sender {
  margin: 0 0 6px 2px;
  font-size: 12px;
  line-height: 1.2;
  color: #64748b;
  font-weight: 500;
}

.lhn-chat-shell .lhn-chat-msg.is-own .lhn-chat-msg-sender {
  margin: 0 2px 6px 0;
}

.lhn-chat-shell .lhn-chat-msg.is-own .lhn-chat-msg-bubble-wrap {
  margin-left: auto;
}

.lhn-chat-shell .lhn-chat-msg:not(.is-own) .lhn-chat-msg-bubble-wrap {
  background: linear-gradient(135deg, var(--lhn-chat-bubble-other-start) 0%, var(--lhn-chat-bubble-other-end) 100%);
  color: #0f172a;
  box-shadow: none;
}

.lhn-chat-shell .lhn-chat-msg-body {
  font-size: 14px !important;
  line-height: 1.2;
  color: inherit !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  white-space: pre-wrap;
}

.lhn-chat-shell .lhn-chat-msg.is-own .lhn-chat-msg-body .lhn-chat-link {
  color: #ffffff !important;
  font-weight: 700;
  text-decoration-color: rgba(255, 255, 255, 0.82);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.lhn-chat-shell .lhn-chat-msg.is-own .lhn-chat-msg-body .lhn-chat-link:hover,
.lhn-chat-shell .lhn-chat-msg.is-own .lhn-chat-msg-body .lhn-chat-link:focus {
  color: #f8fafc !important;
  text-decoration-color: #ffffff;
}

.lhn-chat-shell .lhn-chat-msg-body:empty {
  display: none;
}

.lhn-chat-shell .lhn-chat-msg-reply-context {
  margin: 0 0 8px 0;
  padding: 8px 10px;
  border-radius: 12px;
  border-left: 3px solid rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.14);
}

.lhn-chat-shell .lhn-chat-msg-reply-thumb {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.6;
  margin-bottom: 6px;
}

.lhn-chat-shell .lhn-chat-msg-reply-title {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 4px;
}

.lhn-chat-shell .lhn-chat-msg-reply-body {
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.96;
}

.lhn-chat-shell .lhn-chat-msg-meta {
  margin-top: 6px !important;
  font-size: 10px !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

.lhn-chat-shell .lhn-chat-msg:not(.is-own) .lhn-chat-msg-meta {
  color: #64748b !important;
}

.lhn-chat-shell .lhn-chat-msg.is-image .lhn-chat-msg-bubble-wrap {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  max-width: min(84%, 760px) !important;
}

.lhn-chat-shell .lhn-chat-msg.is-file .lhn-chat-msg-bubble-wrap {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  max-width: min(84%, 760px) !important;
}

.lhn-chat-shell .lhn-chat-msg.is-poll .lhn-chat-msg-bubble-wrap {
  max-width: min(84%, 760px) !important;
}

.lhn-chat-shell .lhn-chat-gallery-head {
  font-size: 12px;
  line-height: 1.3;
  color: #475569;
  margin: 0 0 8px 2px;
}

.lhn-chat-shell .lhn-chat-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.lhn-chat-shell .lhn-chat-gallery-image-btn {
  display: block;
  border: 0;
  padding: 0;
  background: #f8fafc;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
}

.lhn-chat-shell .lhn-chat-gallery-image-btn img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.lhn-chat-shell .lhn-chat-msg.is-image .lhn-chat-image-btn:not(.lhn-chat-gallery-image-btn) {
  width: min(420px, 100%);
  min-height: 160px;
  background: #f8fafc;
}

.lhn-chat-shell .lhn-chat-msg.is-image .lhn-chat-image-btn:not(.lhn-chat-gallery-image-btn) img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #f8fafc;
}

.lhn-chat-shell .lhn-chat-msg:not(.is-own) .lhn-chat-msg-reply-context {
  border-left-color: #94a3b8;
  background: #e8eef7;
}

.lhn-chat-shell .lhn-chat-msg:not(.is-own) .lhn-chat-msg-reply-title,
.lhn-chat-shell .lhn-chat-msg:not(.is-own) .lhn-chat-msg-reply-body {
  color: #334155;
}

.lhn-chat-shell .lhn-chat-msg-hover-tools {
  position: relative;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 0;
  z-index: 5;
  align-self: flex-end;
  overflow: visible;
}

.lhn-chat-shell .lhn-chat-msg:hover .lhn-chat-msg-hover-tools,
.lhn-chat-shell .lhn-chat-msg:focus-within .lhn-chat-msg-hover-tools {
  opacity: 1;
  pointer-events: auto;
}

.lhn-chat-shell .lhn-chat-msg.is-menu-open .lhn-chat-msg-hover-tools,
.lhn-chat-shell .lhn-chat-msg.is-react-open .lhn-chat-msg-hover-tools {
  opacity: 1;
  pointer-events: auto;
}

.lhn-chat-shell .lhn-chat-msg-more-btn,
.lhn-chat-shell .lhn-chat-msg-reply-btn,
.lhn-chat-shell .lhn-chat-msg-react-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--lhn-chat-border);
  background: #fff;
  color: #334155;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lhn-chat-shell .lhn-chat-msg-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: unset;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .18);
  padding: 6px;
  gap: 6px;
  min-width: 120px;
}

.lhn-chat-shell .lhn-chat-msg.is-own .lhn-chat-msg-menu {
  left: 0;
  right: unset;
}

.lhn-chat-shell .lhn-chat-msg-menu button {
  border: 1px solid var(--lhn-chat-border);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  min-height: 30px;
  padding: 0 10px;
  text-align: left;
  cursor: pointer;
}

.lhn-chat-shell .lhn-chat-msg-menu .lhn-chat-msg-delete-btn {
  border-color: #fecaca;
  color: #991b1b;
}

.lhn-chat-shell .lhn-chat-reaction-picker {
  display: none !important;
  position: absolute !important;
  left: 0;
  right: auto;
  bottom: calc(100% + 6px);
  z-index: 22;
  padding: 8px;
  border: 1px solid var(--lhn-chat-border);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, .18);
  margin: 0 !important;
  width: max-content;
  white-space: nowrap;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.lhn-chat-shell .lhn-chat-msg.is-own .lhn-chat-reaction-picker {
  left: 0;
  right: unset
}

.lhn-chat-shell .lhn-chat-msg .lhn-chat-reaction-picker {
  right: 0;
  left: unset;
}

.lhn-chat-shell .lhn-chat-msg.is-menu-open .lhn-chat-msg-menu {
  display: grid;
}

.lhn-chat-shell .lhn-chat-msg.is-react-open .lhn-chat-reaction-picker {
  display: inline-flex !important;
}

.lhn-chat-shell .lhn-chat-reaction-picker .lhn-chat-reaction-btn {
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: transparent;
}

.lhn-chat-shell .lhn-chat-reaction-picker .lhn-chat-reaction-icon {
  font-size: 17px;
  line-height: 1;
}

.lhn-chat-shell .lhn-chat-reaction-picker .lhn-chat-reaction-count {
  display: none;
}

.lhn-chat-shell .lhn-chat-reactions-summary {
  position: absolute;
  right: 10px;
  bottom: -10px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.lhn-chat-shell .lhn-chat-reaction-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--lhn-chat-border);
  background: #fff;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .25);
}

.lhn-chat-shell .lhn-chat-reaction-pill-icon {
  font-size: 16px;
  line-height: 1;
}

.lhn-chat-shell .lhn-chat-reaction-pill-count {
  font-size: 12px;
  line-height: 1;
}

.lhn-chat-shell .lhn-chat-msg:not(.is-own) .lhn-chat-reaction-pill {
  background: #fff;
  color: #334155;
}

@media (max-width: 860px) {
  .lhn-chat-shell .lhn-chat-msg-bubble-wrap {
    max-width: 88%;
    font-size: 14px;
  }

  .lhn-chat-shell .lhn-chat-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Final hard overrides for launcher behavior */
.lhn-chat-shell-launcher .lhn-chat-panel {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* Respect native [hidden] toggle from JS close/open handlers */
.lhn-chat-shell-launcher .lhn-chat-panel[hidden] {
  display: none !important;
}

.lhn-chat-shell .lhn-chat-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

.lhn-chat-shell .lhn-chat-layout {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.lhn-chat-shell .lhn-chat-rooms {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.lhn-chat-shell .lhn-chat-room-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.lhn-chat-shell .lhn-chat-thread {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.lhn-chat-shell .lhn-chat-messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.lhn-chat-shell .lhn-chat-composer {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 54px !important;
  position: relative !important;
  bottom: auto !important;
  z-index: 5 !important;
  background: #fff !important;
  border-top: 1px solid var(--lhn-chat-border) !important;
  flex-shrink: 0 !important;
}

.lhn-chat-shell .lhn-chat-composer textarea[name="chat_message"],
.lhn-chat-shell .lhn-chat-composer textarea[name="message"] {
  grid-column: 1 !important;
  min-width: 0 !important;
  width: auto !important;
}

.lhn-chat-shell .lhn-chat-composer .lhn-chat-composer-plus-wrap,
.lhn-chat-shell .lhn-chat-composer .lhn-chat-send-btn {
  flex: 0 0 auto !important;
}

.lhn-chat-shell .lhn-chat-reply-draft {
  grid-column: 1 / -1 !important;
  width: 100%;
  position: relative;
  padding: 8px 34px 8px 10px;
  border-bottom: 1px solid var(--lhn-chat-border);
  background: #f8fafc;
}

.lhn-chat-shell .lhn-chat-reply-draft-thumb {
  float: left;
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0.55;
  margin: 0 8px 2px 0;
}

.lhn-chat-shell .lhn-chat-reply-draft-head {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  color: #0f172a;
}

.lhn-chat-shell .lhn-chat-reply-draft-body {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.3;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lhn-chat-shell .lhn-chat-reply-draft-clear {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.lhn-chat-shell .lhn-chat-header strong {
  font-size: 18px !important;
  line-height: 1.2 !important;
}

.lhn-chat-shell .lhn-chat-modal-head {
  align-items: center !important;
}

.lhn-chat-shell .lhn-chat-newchat-close,
.lhn-chat-shell .lhn-chat-confirm-close {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #334155 !important;
  border-color: var(--lhn-chat-border) !important;
  box-shadow: none !important;
}

.lhn-chat-shell .lhn-chat-confirm-cancel {
  background: #fff !important;
  color: #334155 !important;
  border-color: var(--lhn-chat-border) !important;
  min-width: 92px !important;
  font-weight: 600 !important;
}

.lhn-chat-shell .lhn-chat-confirm-ok {
  background: #1f4f8b !important;
  color: #fff !important;
  border-color: #1f4f8b !important;
  min-width: 108px !important;
  font-weight: 600 !important;
}

.lhn-chat-shell .lhn-chat-modal-foot {
  justify-content: flex-end !important;
  gap: 10px !important;
}

.lhn-chat-shell .lhn-chat-members-search {
  display: block !important;
}

.lhn-chat-shell .lhn-chat-members-search-input {
  width: 100% !important;
}

.lhn-chat-shell .lhn-chat-members-search-btn {
  display: none !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-name {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-meta {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-meta.is-active {
  color: #16a34a !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-meta.is-inactive {
  color: #dc2626 !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-promote-btn,
.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-demote-btn,
.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-remove-btn,
.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-role-select {
  flex: 0 0 auto !important;
  min-height: 30px !important;
  padding: 4px 10px !important;
  white-space: nowrap !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-role-select {
  min-width: 95px !important;
  max-width: 150px !important;
  font-size: 11px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 20px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23475569'%3E%3Cpath d='M5.5 7.5a1 1 0 0 1 1.4 0L10 10.6l3.1-3.1a1 1 0 1 1 1.4 1.4l-3.8 3.8a1 1 0 0 1-1.4 0L5.5 8.9a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 7px center !important;
  background-size: 14px 14px !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-remove-btn {
  min-width: 25px !important;
  width: 25px !important;
  padding: 0 !important;
  border: 0 !important;
  color: #ef4444 !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  background: transparent !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-remove-btn:hover {
  color: #dc2626 !important;
  background: transparent !important;
}

.lhn-chat-shell .lhn-chat-dm-details {
  padding: 10px 12px;
}

.lhn-chat-shell .lhn-chat-dm-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe7f6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.lhn-chat-shell .lhn-chat-dm-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 999px;
}

.lhn-chat-shell .lhn-chat-dm-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.lhn-chat-shell .lhn-chat-dm-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.lhn-chat-shell .lhn-chat-dm-meta {
  font-size: 12px;
  color: #1f4f8b;
  font-weight: 600;
}

.lhn-chat-shell .lhn-chat-dm-submeta {
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 860px) {
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-rooms,
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-thread,
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-details {
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  .lhn-chat-shell .lhn-chat-layout.is-mobile.is-mobile-pane-rooms .lhn-chat-rooms,
  .lhn-chat-shell .lhn-chat-layout.is-mobile.is-mobile-pane-thread .lhn-chat-thread,
  .lhn-chat-shell .lhn-chat-layout.is-mobile.is-mobile-pane-details .lhn-chat-details {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* Desktop stability: keep composer pinned at bottom even with long message history */
@media (min-width: 861px) {
  .lhn-chat-shell .lhn-chat-thread {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto auto !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  .lhn-chat-shell .lhn-chat-messages {
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  .lhn-chat-shell .lhn-chat-composer {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 8 !important;
    background: #fff !important;
    border-top: 1px solid var(--lhn-chat-border) !important;
    flex-shrink: 0 !important;
  }
}

/* One-line user rows for search results and room members */
.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-member-search-item,
.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-newchat-user {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 0 8px 0 !important;
  min-height: 36px !important;
  padding: 8px 10px !important;
}

.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-member-search-item:last-child,
.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-newchat-user:last-child {
  margin-bottom: 0 !important;
}

/* Top section refresh: match compact blue header + clean search row */
.lhn-chat-shell .lhn-chat-header {
  background: linear-gradient(135deg, var(--lhn-chat-bubble-own-start) 0%, var(--lhn-chat-bubble-own-end) 100%) !important;
  color: #fff !important;
  border-bottom: 0 !important;
  min-height: 46px !important;
  padding: 0 14px !important;
  border-radius: 12px 12px 0 0 !important;
}

.lhn-chat-shell .lhn-chat-header strong {
  color: #fff !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  font-weight: bold !important;
}

.lhn-chat-shell .lhn-chat-close {
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  border-radius: 0 !important;
  font-size: 28px !important;
  line-height: 1 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.lhn-chat-shell .lhn-chat-close:hover {
  background: transparent !important;
  color: #ffffff !important;
}

.lhn-chat-shell .lhn-chat-room-search-wrap {
  padding: 10px 12px !important;
  background: #fff !important;
  border-bottom: 1px solid var(--lhn-chat-border) !important;
}

.lhn-chat-shell .lhn-chat-room-search {
  border: 1px solid #d6e1ee !important;
  border-radius: 12px !important;
  min-height: 25px !important;
  padding: 9px 12px !important;
  background: #fff !important;
}

.lhn-chat-shell .lhn-chat-new-chat-btn,
.lhn-chat-shell .lhn-chat-pane-settings-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border: 1px solid #d6e1ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #334155 !important;
}

/* Modal headers: match main chat header design */
.lhn-chat-shell .lhn-chat-modal-header,
.lhn-chat-shell .lhn-chat-modal-head {
  background: linear-gradient(135deg, var(--lhn-chat-bubble-own-start) 0%, var(--lhn-chat-bubble-own-end) 100%) !important;
  color: #fff !important;
  border-bottom: 0 !important;
  min-height: 46px !important;
  padding: 0 14px !important;
  border-radius: 12px 12px 0 0 !important;
}

.lhn-chat-shell .lhn-chat-modal-header strong,
.lhn-chat-shell .lhn-chat-modal-head strong {
  color: #fff !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  font-weight: bold !important;
}

.lhn-chat-shell .lhn-chat-settings-close,
.lhn-chat-shell .lhn-chat-profile-close,
.lhn-chat-shell .lhn-chat-createpoll-close,
.lhn-chat-shell .lhn-chat-newchat-close,
.lhn-chat-shell .lhn-chat-confirm-close {
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  border-radius: 0 !important;
  font-size: 28px !important;
  line-height: 1 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.lhn-chat-shell .lhn-chat-settings-close:hover,
.lhn-chat-shell .lhn-chat-profile-close:hover,
.lhn-chat-shell .lhn-chat-createpoll-close:hover,
.lhn-chat-shell .lhn-chat-newchat-close:hover,
.lhn-chat-shell .lhn-chat-confirm-close:hover {
  background: transparent !important;
  color: #fff !important;
}

.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-member-search-add {
  grid-column: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  color: #16a34a !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-newchat-user-name {
  grid-column: 2 !important;
  display: inline-block !important;
  margin: 0 !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 13px !important;
  font-weight: normal;
  color: #0f172a !important;
}

.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-member-meta {
  grid-column: 3 !important;
  display: inline-block !important;
  margin: 0 !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  font-weight: normal;
  color: #64748b !important;
  text-align: right !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 36px !important;
  padding: 8px 10px !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0 !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-name {
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-meta {
  min-width: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.25 !important;
  font-size: 12px !important;
  color: #64748b !important;
}

.lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-role-select {
  min-width: 100px !important;
  max-width: 110px !important;
}

@media (max-width: 767px) {
  .lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-member-search-item,
  .lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-newchat-user {
    gap: 6px !important;
    padding: 7px 8px !important;
  }

  .lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-row {
    gap: 6px !important;
    padding: 7px 8px !important;
    grid-template-columns: auto minmax(0, 1fr) auto auto !important;
  }

  .lhn-chat-shell .lhn-chat-members-panel .lhn-chat-member-role-select {
    min-width: 92px !important;
    max-width: 100px !important;
  }
}

/* Details action controls: text/icon only (no button chrome). */
.lhn-chat-shell .lhn-chat-detail-actions .lhn-chat-leave-room-btn,
.lhn-chat-shell .lhn-chat-detail-actions .lhn-chat-settings-btn {
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 0 !important;
}

.lhn-chat-shell .lhn-chat-detail-actions .lhn-chat-leave-room-btn {
  color: #1f4f8b !important;
  font-weight: 600 !important;
  min-width: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  display: inline !important;
}

.lhn-chat-shell .lhn-chat-detail-actions .lhn-chat-settings-btn {
  color: #1f4f8b !important;
  min-width: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  display: inline !important;
}

.lhn-chat-shell .lhn-chat-detail-actions .lhn-chat-settings-btn .lhn-chat-btn-icon {
  display: inline !important;
  font-size: 20px !important;
  line-height: 1 !important;
}

/* ===== First Pane Refresh (Chats list) ===== */
.lhn-chat-shell .lhn-chat-layout {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) !important;
  height: 100% !important;
  min-height: 0 !important;
}

.lhn-chat-shell .lhn-chat-rooms {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  background: #f8fafd !important;
}

.lhn-chat-shell .lhn-chat-rooms-title {
  display: none !important; /* remove "Rooms" label */
}

.lhn-chat-shell .lhn-chat-room-search-wrap {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid var(--lhn-chat-border) !important;
  background: #fff !important;
}

.lhn-chat-shell .lhn-chat-room-search {
  min-width: 0 !important;
  border-radius: 12px !important;
  padding: 5px 12px !important;
  background: #fff !important;
}

.lhn-chat-shell .lhn-chat-new-chat-btn,
.lhn-chat-shell .lhn-chat-pane-settings-btn {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid var(--lhn-chat-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #334155 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.lhn-chat-shell .lhn-chat-new-chat-btn .lhn-chat-btn-icon,
.lhn-chat-shell .lhn-chat-pane-settings-btn .lhn-chat-btn-icon {
  font-size: 20px !important;
  line-height: 1 !important;
}

.lhn-chat-shell .lhn-chat-room-tabs {
  display: flex !important;
  gap: 5px !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid var(--lhn-chat-border) !important;
  background: #fff !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
}

.lhn-chat-shell .lhn-chat-room-tab {
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  padding: 7px 6px !important;
  background: transparent !important;
  color: #1f4f8b !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

.lhn-chat-shell .lhn-chat-room-tab.is-active {
  background: #eaf2ff !important;
  color: #1f4f8b !important;
  border-color: #cfe1ff !important;
}

.lhn-chat-shell .lhn-chat-room-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 10px 10px 14px !important;
}

.lhn-chat-shell .lhn-chat-room-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 5px !important;
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
}

.lhn-chat-shell .lhn-chat-room-row + .lhn-chat-room-row {
  margin-top: 8px !important;
}

.lhn-chat-shell .lhn-chat-avatar-wrap,
.lhn-chat-shell .lhn-chat-room-avatar-wrap {
  position: relative !important;
  width: 52px !important;
  height: 52px !important;
  flex: 0 0 52px !important;
}

.lhn-chat-shell .lhn-chat-room-avatar,
.lhn-chat-shell .lhn-chat-current-identity-avatar,
.lhn-chat-shell .lhn-chat-thread-identity-avatar,
.lhn-chat-shell .lhn-chat-member-avatar,
.lhn-chat-shell .lhn-chat-profile-avatar,
.lhn-chat-shell .lhn-chat-avatar-placeholder {
  width: 52px !important;
  height: 52px !important;
  border-radius: 999px !important;
  object-fit: cover !important;
  display: block !important;
}

.lhn-chat-shell .lhn-chat-room-avatar-placeholder,
.lhn-chat-shell .lhn-chat-avatar-placeholder {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  background: #dbeafe !important;
  color: #1e3a8a !important;
}

.lhn-chat-shell .lhn-chat-avatar-presence,
.lhn-chat-shell .lhn-chat-room-dot {
  position: absolute !important;
  right: -2px !important;
  bottom: -2px !important;
  width: 11px !important;
  height: 11px !important;
  border-radius: 999px !important;
  border: 2px solid #fff !important;
}

.lhn-chat-shell .lhn-chat-avatar-presence.is-available,
.lhn-chat-shell .lhn-chat-room-presence.is-available {
  background: #16a34a !important;
  color: #166534 !important;
}

.lhn-chat-shell .lhn-chat-avatar-presence.is-busy,
.lhn-chat-shell .lhn-chat-room-presence.is-busy {
  background: #dc2626 !important;
  color: #991b1b !important;
}

.lhn-chat-shell .lhn-chat-avatar-presence.is-away,
.lhn-chat-shell .lhn-chat-room-presence.is-away {
  background: #f59e0b !important;
  color: #92400e !important;
}

.lhn-chat-shell .lhn-chat-avatar-presence.is-invisible,
.lhn-chat-shell .lhn-chat-avatar-presence.is-offline,
.lhn-chat-shell .lhn-chat-room-presence.is-invisible,
.lhn-chat-shell .lhn-chat-room-presence.is-offline {
  background: #94a3b8 !important;
  color: #ffffff !important;
}

.lhn-chat-shell .lhn-chat-room-main {
  min-width: 0 !important;
  display: grid !important;
  gap: 3px !important;
  line-height: 1.2!important;
}

.lhn-chat-shell .lhn-chat-room-topline {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  gap: 8px !important;
  align-items: center !important;
}

.lhn-chat-shell .lhn-chat-room-name {
  color: #0f172a !important;
}

.lhn-chat-shell .lhn-chat-room-preview {
  color: #64748b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 12px !important;
}

.lhn-chat-shell .lhn-chat-room-presence {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 18px !important;
  padding: 0 7px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  background: rgba(148, 163, 184, 0.14) !important;
}

.lhn-chat-shell .lhn-chat-room-time {
  font-size: 12px !important;
  color: #64748b !important;
}

.lhn-chat-shell .lhn-chat-room-row.is-unread .lhn-chat-room-name,
.lhn-chat-shell .lhn-chat-room-row.is-unread .lhn-chat-room-preview {
  font-weight: 700 !important;
  color: #0f172a !important;
}

.lhn-chat-shell .lhn-chat-room-right {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.lhn-chat-shell .lhn-chat-room-unread-dot {
  width: 9px !important;
  height: 9px !important;
  border-radius: 999px !important;
  background: #2b7fff !important;
  display: inline-block !important;
}

@media (max-width: 860px) {
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-rooms.is-visible {
    display: flex !important;
    flex-direction: column !important;
  }

  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-room-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}

/* Ensure pane containers can stretch and scroll correctly */
.lhn-chat-shell .lhn-chat-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

.lhn-chat-shell .lhn-chat-thread,
.lhn-chat-shell .lhn-chat-details {
  min-height: 0 !important;
}

/* Mobile pane isolation: prevent hidden panes from reserving layout space */
@media (max-width: 860px) {
  .lhn-chat-shell .lhn-chat-layout.is-mobile {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 0 !important;
    height: 100% !important;
  }

  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-rooms,
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-thread,
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-details {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
  }

  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-rooms:not(.is-visible),
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-thread:not(.is-visible),
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-details:not(.is-visible) {
    display: none !important;
  }

  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-rooms.is-visible,
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-thread.is-visible,
  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-details.is-visible {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  .lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-room-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
}

/* Mobile-pane mode is driven by JS class (.is-mobile), not viewport width. */
.lhn-chat-shell .lhn-chat-layout.is-mobile {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  min-height: 0 !important;
  height: 100% !important;
}

.lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-rooms,
.lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-thread,
.lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-details {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  border-right: 0 !important;
}

.lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-rooms:not(.is-visible),
.lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-thread:not(.is-visible),
.lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-details:not(.is-visible) {
  display: none !important;
}

.lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-rooms.is-visible,
.lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-thread.is-visible,
.lhn-chat-shell .lhn-chat-layout.is-mobile .lhn-chat-details.is-visible {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
}

/* Tabs polish: prevent clipped labels and active pill */
.lhn-chat-shell .lhn-chat-room-tabs {
  align-items: center !important;
  min-height: 45px !important;
  padding: 5px 8px !important;
  overflow-y: visible !important;
}

.lhn-chat-shell .lhn-chat-room-tab {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 28px !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 9px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
}

.lhn-chat-shell .lhn-chat-room-tab.is-active {
  box-shadow: 0 0 0 1px #cfe1ff inset !important;
}

/* Search Results: force single-row item layout (plus, name, status) */
.lhn-chat-shell .lhn-chat-member-search-results {
  display: block !important;
}

.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-member-search-item,
.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-newchat-user {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 38px !important;
  margin: 0 0 8px 0 !important;
  padding: 8px 10px !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-member-search-item:last-child,
.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-newchat-user:last-child {
  margin-bottom: 0 !important;
}

.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-member-search-add {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  color: #16a34a !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-newchat-user-name {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: block !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
}

.lhn-chat-shell .lhn-chat-member-search-results .lhn-chat-member-meta {
  flex: 0 0 auto !important;
  margin: 0 !important;
  white-space: nowrap !important;
  text-align: right !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

.lhn-chat-shell .lhn-chat-current-identity {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px 9px !important;
  border-top: 1px solid rgba(31, 79, 139, 0.12) !important;
  background: rgba(228, 238, 250, 0.95) !important;
  width: 100% !important;
  text-align: left !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

.lhn-chat-shell .lhn-chat-current-identity-text {
  display: flex !important;
  flex-direction: column !important;
  gap: 1px !important;
  min-width: 0 !important;
}

.lhn-chat-shell .lhn-chat-current-identity-label {
  font-size: 12px !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  color: #1f2a44 !important;
}

.lhn-chat-shell .lhn-chat-current-identity-meta {
  font-size: 10px !important;
  line-height: 1.3 !important;
  color: #63748f !important;
  font-weight: 400 !important;
}

.lhn-chat-shell .lhn-chat-current-identity-status {
  font-size: 11px !important;
  line-height: 1.3 !important;
  color: #334155 !important;
}

.lhn-chat-shell .lhn-chat-profile-avatar-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.lhn-chat-shell .lhn-chat-profile-avatar {
  width: 56px !important;
  height: 56px !important;
}

.lhn-chat-shell .lhn-chat-profile-avatar-actions {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

/* Admin dashboard: keep the embedded chat inside the available panel height. */
.lhn-chat-admin-wrap .lhn-chat-admin-shell,
.lhn-chat-admin-wrap .lhn-chat-root,
.lhn-chat-admin-wrap .lhn-chat-shell,
.lhn-chat-admin-wrap .lhn-chat-body,
.lhn-chat-admin-wrap .lhn-chat-layout {
  min-height: 0 !important;
  height: 100% !important;
}

.lhn-chat-admin-wrap .lhn-chat-root,
.lhn-chat-admin-wrap .lhn-chat-shell,
.lhn-chat-admin-wrap .lhn-chat-body {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.lhn-chat-admin-wrap .lhn-chat-shell {
  max-height: 100% !important;
}

.lhn-chat-admin-wrap .lhn-chat-layout {
  flex: 1 1 auto !important;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) !important;
  overflow: hidden !important;
}

.lhn-chat-admin-wrap .lhn-chat-layout.is-details-open {
  grid-template-columns: minmax(260px, 320px) minmax(360px, 1fr) minmax(280px, 340px) !important;
}

.lhn-chat-admin-wrap .lhn-chat-thread {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.lhn-chat-admin-wrap .lhn-chat-details {
  align-self: stretch !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

.lhn-chat-admin-wrap .lhn-chat-details-body {
  flex: 1 1 auto !important;
}

.lhn-chat-admin-wrap .lhn-chat-messages,
.lhn-chat-admin-wrap .lhn-chat-room-list,
.lhn-chat-admin-wrap .lhn-chat-details-body {
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
}

.lhn-chat-admin-wrap .lhn-chat-admin-shell {
  height: calc(100vh - 150px) !important;
  min-height: 520px !important;
  max-height: none !important;
}

.lhn-chat-admin-wrap .lhn-chat-details,
.lhn-chat-admin-wrap .lhn-chat-details *,
.lhn-chat-admin-wrap .lhn-chat-members-panel,
.lhn-chat-admin-wrap .lhn-chat-members-panel * {
  box-sizing: border-box !important;
}

.lhn-chat-admin-wrap .lhn-chat-details-body {
  width: 100% !important;
  overflow-x: hidden !important;
}

.lhn-chat-admin-wrap .lhn-chat-detail-actions {
  overflow-x: hidden !important;
}

.lhn-chat-admin-wrap .lhn-chat-members-search {
  width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

.lhn-chat-admin-wrap .lhn-chat-member-row {
  min-width: 0 !important;
}

.lhn-chat-admin-wrap .lhn-chat-member-name,
.lhn-chat-admin-wrap .lhn-chat-member-meta {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.lhn-chat-admin-wrap .lhn-chat-member-role-select {
  max-width: 100% !important;
}

@media (max-width: 782px) {
  .lhn-chat-admin-wrap .lhn-chat-admin-shell {
    height: calc(100vh - 150px) !important;
    min-height: 0 !important;
  }

  .lhn-chat-admin-wrap .lhn-chat-layout,
  .lhn-chat-admin-wrap .lhn-chat-layout.is-details-open,
  .lhn-chat-admin-wrap .lhn-chat-layout.is-mobile {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .lhn-chat-admin-wrap .lhn-chat-detail-actions {
    flex-wrap: wrap !important;
    align-content: flex-start !important;
  }

  .lhn-chat-admin-wrap .lhn-chat-detail-actions-main {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    flex-wrap: wrap !important;
  }

  .lhn-chat-admin-wrap .lhn-chat-room-tabs {
    flex-wrap: wrap !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
  }

  .lhn-chat-admin-wrap .lhn-chat-room-tab {
    flex: 0 1 auto !important;
  }

  .lhn-chat-admin-wrap .lhn-chat-members-panel .lhn-chat-member-row {
    grid-template-columns: auto minmax(0, 1fr) 96px 24px !important;
    align-items: center !important;
    column-gap: 6px !important;
  }

  .lhn-chat-admin-wrap .lhn-chat-members-panel .lhn-chat-avatar-wrap,
  .lhn-chat-admin-wrap .lhn-chat-members-panel .lhn-chat-member-avatar,
  .lhn-chat-admin-wrap .lhn-chat-members-panel .lhn-chat-avatar-placeholder {
    width: 46px !important;
    height: 46px !important;
    flex-basis: 46px !important;
  }

  .lhn-chat-admin-wrap .lhn-chat-members-panel .lhn-chat-member-role-select {
    width: 96px !important;
    min-width: 0 !important;
  }

  .lhn-chat-admin-wrap .lhn-chat-members-panel .lhn-chat-member-remove-btn {
    width: 24px !important;
    min-width: 24px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
  }
}

/* Frontend page sizing and responsive hardening. */
.lhn-chat-root[data-chat-mode="embedded"] > .lhn-chat-shell-embedded {
  display: flex !important;
  flex-direction: column !important;
  height: clamp(560px, calc(100dvh - 96px), 986px);
  max-height: calc(100dvh - 96px);
}

.lhn-chat-root[data-chat-mode="embedded"] > .lhn-chat-shell-embedded > .lhn-chat-body,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-layout {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
}

@media (min-width: 861px) {
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-layout.is-details-open {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(280px, 340px) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-layout.is-details-open > .lhn-chat-rooms,
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-layout.is-details-open > .lhn-chat-thread,
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-layout.is-details-open > .lhn-chat-details {
    grid-row: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-layout.is-details-open .lhn-chat-details-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
}

@media (max-width: 860px) {
  .lhn-chat-root[data-chat-mode="embedded"] > .lhn-chat-shell-embedded {
    height: calc(100dvh - 94px);
    min-height: 480px;
    max-height: calc(100dvh - 94px);
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-layout.is-mobile,
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-layout.is-mobile .lhn-chat-rooms,
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-layout.is-mobile .lhn-chat-thread,
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-layout.is-mobile .lhn-chat-details {
    height: 100% !important;
    max-height: 100% !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    overflow: visible !important;
    padding: 7px 8px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tab {
    width: 100% !important;
    min-width: 0 !important;
    padding-inline: 4px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-messages {
    overscroll-behavior: contain;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-link-preview-head {
    flex-direction: column;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-link-preview img {
    width: 100%;
    height: 112px;
  }
}

@media (max-height: 620px) and (max-width: 860px) {
  .lhn-chat-root[data-chat-mode="embedded"] > .lhn-chat-shell-embedded {
    height: calc(100dvh - 70px);
    min-height: 0;
    max-height: calc(100dvh - 70px);
  }
}

/* Embedded Chat page polish. */
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded {
  --lhn-chat-primary: #1f4f8b;
  --lhn-chat-primary-strong: #173f72;
  --lhn-chat-focus: #60a5fa;
  --lhn-chat-surface: #f6f9fd;
  --lhn-chat-border: #dbe5f1;
  color: #172033;
  border-color: rgba(31, 79, 139, 0.18);
  box-shadow: 0 18px 45px rgba(31, 50, 81, 0.12);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-search-wrap,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-pane-title,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-composer {
  border-color: var(--lhn-chat-border) !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-search,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-composer textarea,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-members-search input {
  border: 1px solid #cbd9e8 !important;
  background: #fff !important;
  color: #172033 !important;
  box-shadow: 0 1px 2px rgba(31, 50, 81, 0.04);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-search:focus,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-composer textarea:focus,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-members-search input:focus {
  border-color: var(--lhn-chat-focus) !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2) !important;
  outline: 0 !important;
}

.lhn-chat-root[data-chat-mode="embedded"] button:focus-visible,
.lhn-chat-root[data-chat-mode="embedded"] a:focus-visible,
.lhn-chat-root[data-chat-mode="embedded"] select:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.55) !important;
  outline-offset: 2px !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-row {
  min-height: 64px;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-row:hover {
  border-color: #b7cae0 !important;
  background: #f8fbff !important;
  box-shadow: 0 5px 14px rgba(31, 79, 139, 0.08) !important;
  transform: translateY(-1px);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-row.is-active {
  border-color: #82aee0 !important;
  background: #edf5ff !important;
  box-shadow: inset 3px 0 0 var(--lhn-chat-primary), 0 4px 12px rgba(31, 79, 139, 0.08) !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tab {
  transition: color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tab:hover {
  background: #f0f6fd !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tab.is-active {
  background: #dfeeff !important;
  box-shadow: inset 0 0 0 1px #b8d4f2 !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-new-chat-btn:hover,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-pane-settings-btn:hover,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-back-btn:hover,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-details-toggle:hover {
  background: #edf5ff !important;
  border-color: #a9c7e7 !important;
  color: var(--lhn-chat-primary-strong) !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-pane-title {
  min-height: 66px;
  position: relative;
  z-index: 4;
  box-shadow: 0 1px 0 rgba(31, 79, 139, 0.08);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-thread-identity-label {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-messages {
  background:
    radial-gradient(circle at top left, rgba(219, 234, 254, 0.32), transparent 36%),
    #fbfdff !important;
  scrollbar-color: #b7c9df transparent;
  scrollbar-width: thin;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-list,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-details-body {
  scrollbar-color: #b7c9df transparent;
  scrollbar-width: thin;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-msg-bubble-wrap {
  border: 1px solid rgba(31, 79, 139, 0.08);
  box-shadow: 0 6px 16px rgba(31, 50, 81, 0.08);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-msg:not(.is-own) .lhn-chat-msg-bubble-wrap {
  background: #fff !important;
  border-color: #dbe5f1;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-composer {
  padding: 10px 12px !important;
  box-shadow: 0 -8px 24px rgba(31, 50, 81, 0.05);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-send-btn {
  background: var(--lhn-chat-primary) !important;
  color: #fff !important;
  box-shadow: 0 5px 12px rgba(31, 79, 139, 0.22);
  transition: background-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-send-btn .lhn-chat-btn-icon,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-send-btn svg,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-send-btn path {
  color: #fff !important;
  fill: currentColor !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-send-btn:not(:disabled):hover {
  background: var(--lhn-chat-primary-strong) !important;
  box-shadow: 0 7px 16px rgba(31, 79, 139, 0.28);
  transform: translateY(-1px);
}

.lhn-chat-root[data-chat-mode="embedded"] button:disabled,
.lhn-chat-root[data-chat-mode="embedded"] textarea:disabled {
  cursor: not-allowed !important;
  opacity: 0.52 !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-messages > .lhn-chat-empty,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-locked {
  width: min(460px, calc(100% - 32px));
  margin: auto;
  padding: 24px !important;
  border: 1px dashed #b9cce2;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  color: #52647c;
  text-align: center;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-request-join-btn {
  min-height: 40px;
  margin-top: 8px;
  border-radius: 10px;
  background: var(--lhn-chat-primary) !important;
  color: #fff !important;
  font-weight: 700;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-details {
  border-left: 1px solid var(--lhn-chat-border);
  background: #f8fafd !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-members-panel,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-member-row {
  background: #fff !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-modal-backdrop {
  backdrop-filter: blur(4px);
  background: rgba(15, 23, 42, 0.48);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-modal {
  border: 1px solid rgba(31, 79, 139, 0.14);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

@media (max-width: 860px) {
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-pane-title {
    min-height: 66px;
    padding-inline: 10px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-back-btn,
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-details-toggle,
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-new-chat-btn,
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-pane-settings-btn,
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-attach-btn,
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-send-btn {
    min-width: 40px !important;
    width: 40px !important;
    height: 40px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-msg-bubble-wrap {
    max-width: 92%;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-modal {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lhn-chat-root[data-chat-mode="embedded"] *,
  .lhn-chat-root[data-chat-mode="embedded"] *::before,
  .lhn-chat-root[data-chat-mode="embedded"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Embedded Chat brand heading. */
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-rooms-title {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 46px !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--lhn-chat-border) !important;
  background: #fff !important;
  color: #173f72 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.01em !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-page-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #173f72;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none !important;
  transition: color 140ms ease, background-color 140ms ease;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-page-close:hover {
  color: #102f57;
  background: #edf5ff;
}

/* Mobile page fit: account for whether the WordPress admin bar is visible. */
@media (max-width: 860px) {
  .lhn-chat-root[data-chat-mode="embedded"] {
    width: calc(100% + 24px);
    max-width: calc(100vw - 24px);
    margin-inline: -12px;
  }

  .lhn-chat-root[data-chat-mode="embedded"] > .lhn-chat-shell-embedded {
    height: calc(100dvh - 48px);
    min-height: 480px;
    max-height: calc(100dvh - 48px);
  }

  body.admin-bar .lhn-chat-root[data-chat-mode="embedded"] > .lhn-chat-shell-embedded {
    height: calc(100dvh - 94px);
    max-height: calc(100dvh - 94px);
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tabs {
    grid-template-rows: repeat(2, 30px) !important;
    height: 74px !important;
    min-height: 74px !important;
    padding: 6px 8px !important;
    overflow: hidden !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tab {
    height: 30px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-list {
    padding-top: 12px !important;
  }
}

@media (max-width: 860px) and (max-height: 620px) {
  .lhn-chat-root[data-chat-mode="embedded"] > .lhn-chat-shell-embedded {
    height: calc(100dvh - 48px);
    min-height: 0;
    max-height: calc(100dvh - 48px);
  }

  body.admin-bar .lhn-chat-root[data-chat-mode="embedded"] > .lhn-chat-shell-embedded {
    height: calc(100dvh - 70px);
    max-height: calc(100dvh - 70px);
  }
}

/* Match the embedded /chat/ page to the mobile launcher experience. */
@media (max-width: 860px) {
  .lhn-chat-root[data-chat-mode="embedded"] {
    position: fixed;
    inset: 0 0 auto;
    z-index: 2147482999;
    width: 100vw;
    max-width: none;
    height: var(--lhn-chat-mobile-height, 100svh);
    max-height: var(--lhn-chat-mobile-height, 100svh);
    margin: 0;
    background: #f8fafc;
  }

  body.admin-bar .lhn-chat-root[data-chat-mode="embedded"] {
    top: 46px;
    height: calc(var(--lhn-chat-mobile-height, 100svh) - 46px);
    max-height: calc(var(--lhn-chat-mobile-height, 100svh) - 46px);
  }

  .lhn-chat-root[data-chat-mode="embedded"] > .lhn-chat-shell-embedded {
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border: 1px solid var(--lhn-chat-border);
    border-radius: 14px;
    box-shadow: none;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-rooms-title {
    min-height: 46px !important;
    height: 46px !important;
    padding: 0 14px !important;
    background: linear-gradient(90deg, #173f72 0%, #2f6da9 100%) !important;
    color: #fff !important;
    border-bottom: 0 !important;
    border-radius: 13px 13px 0 0;
    font-size: 17px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-page-close {
    color: #fff !important;
    border-radius: 8px;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-page-close:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.16);
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-search-wrap {
    min-height: 55px !important;
    height: 55px !important;
    padding: 8px 12px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tabs {
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    width: 100% !important;
    height: 45px !important;
    min-height: 45px !important;
    padding: 5px 8px !important;
    overflow: hidden !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tab {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    height: 30px !important;
    padding: 0 3px !important;
    font-size: 12px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-list {
    padding: 10px 10px 14px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-current-identity {
    min-height: calc(70px + env(safe-area-inset-bottom, 0px));
    padding-bottom: max(9px, env(safe-area-inset-bottom, 0px)) !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-composer {
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (min-width: 783px) and (max-width: 860px) {
  body.admin-bar .lhn-chat-root[data-chat-mode="embedded"] {
    top: 32px;
    height: calc(var(--lhn-chat-mobile-height, 100svh) - 32px);
    max-height: calc(var(--lhn-chat-mobile-height, 100svh) - 32px);
  }
}

/* Keep every room filter visible and use a simple underline selection state. */
.lhn-chat-shell .lhn-chat-room-tabs {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  grid-template-rows: 1fr !important;
  gap: 1px !important;
  overflow: visible !important;
}

.lhn-chat-shell .lhn-chat-room-tab {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 2px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: clamp(10px, 2.8vw, 11.5px) !important;
  letter-spacing: -0.02em;
  overflow: hidden !important;
}

.lhn-chat-shell .lhn-chat-room-tab:hover {
  background: transparent !important;
  border-bottom-color: #a9c5e6 !important;
}

.lhn-chat-shell .lhn-chat-room-tab.is-active {
  border-bottom-color: #1f4f8b !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 860px) {
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tabs {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    grid-template-rows: 1fr !important;
    gap: 1px !important;
    height: 45px !important;
    min-height: 45px !important;
    overflow: visible !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-room-tab {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 1px !important;
    border-radius: 0 !important;
    font-size: clamp(10px, 2.8vw, 11.5px) !important;
  }
}

/* Logged-out and access-denied Chat states. */
.lhn-chat-access-screen {
  --lhn-chat-access-blue: #173f72;
  --lhn-chat-access-blue-light: #2f6da9;
  display: grid;
  place-items: center;
  min-height: clamp(520px, calc(100dvh - 110px), 760px);
  padding: 40px 20px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 15% 15%, rgba(191, 219, 254, 0.72), transparent 32%),
    radial-gradient(circle at 90% 85%, rgba(219, 234, 254, 0.8), transparent 34%),
    linear-gradient(145deg, #f7fbff 0%, #edf5ff 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/*
 * Some WordPress editors leave a <code> wrapper around the shortcode. Keep
 * that editor formatting from changing the rendered access card on the site.
 */
.lhn-chat-access-screen code {
  display: contents !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font: inherit !important;
  white-space: normal !important;
}

.lhn-chat-access-screen,
.lhn-chat-access-screen p,
.lhn-chat-access-screen h1,
.lhn-chat-access-screen h2,
.lhn-chat-access-screen h3,
.lhn-chat-access-screen a,
.lhn-chat-access-screen button {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.lhn-chat-access-card {
  width: min(100%, 520px);
  padding: 44px 42px 38px;
  border: 1px solid rgba(31, 79, 139, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(31, 50, 81, 0.16);
  color: #172033;
  text-align: center;
}

.lhn-chat-access-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  margin-bottom: 20px;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--lhn-chat-access-blue), var(--lhn-chat-access-blue-light));
  box-shadow: 0 14px 30px rgba(31, 79, 139, 0.24);
}

.lhn-chat-access-mark svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lhn-chat-access-mark circle {
  fill: #fff;
  stroke: none;
}

.lhn-chat-access-eyebrow {
  margin: 0 0 8px !important;
  color: #54708f;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.lhn-chat-access-title {
  margin: 0 !important;
  color: var(--lhn-chat-access-blue);
  font-size: clamp(30px, 5vw, 44px) !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.035em;
}

.lhn-chat-access-message {
  max-width: 390px;
  margin: 18px auto 26px !important;
  color: #52647c;
  font-size: 16px !important;
  line-height: 1.65 !important;
}

.lhn-chat-access-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  min-height: 48px;
  padding: 11px 24px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--lhn-chat-access-blue), var(--lhn-chat-access-blue-light));
  box-shadow: 0 10px 22px rgba(31, 79, 139, 0.22);
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.lhn-chat-access-action:hover {
  box-shadow: 0 14px 28px rgba(31, 79, 139, 0.28);
  color: #fff !important;
  transform: translateY(-2px);
}

.lhn-chat-access-action:focus-visible,
.lhn-chat-access-home:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.65);
  outline-offset: 3px;
}

.lhn-chat-access-home {
  display: block;
  width: max-content;
  margin: 18px auto 0;
  color: #54708f !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  text-decoration: none !important;
}

.lhn-chat-access-home:hover {
  color: var(--lhn-chat-access-blue) !important;
  text-decoration: underline !important;
}

@media (max-width: 600px) {
  .lhn-chat-access-screen {
    min-height: calc(100svh - 48px);
    padding: 20px 14px;
    border-radius: 0;
  }

  .lhn-chat-access-card {
    padding: 36px 24px 30px;
    border-radius: 18px;
  }

  .lhn-chat-access-mark {
    width: 66px;
    height: 66px;
    border-radius: 19px;
  }

  .lhn-chat-access-message {
    font-size: 15px;
  }

  .lhn-chat-access-action {
    width: 100%;
  }
}

/* Single-room block/shortcode embed. */
.lhn-chat-room-embed {
  margin: 28px 0;
  scroll-margin-top: 110px;
}

.single-lhn_event .lhn-chat-room-embed {
  margin-top: 36px;
}

.single-lhn_event .lhn-chat-room-embed-header {
  margin-bottom: 8px;
}

.lhn-circle-chat-wrap {
  box-sizing: border-box;
  clear: both;
  display: block;
  flex: 0 0 100%;
  grid-column: 1 / -1;
  order: 100;
  width: 100%;
  margin: 34px 0 0;
}

.lhn-circle-chat-wrap .lhn-chat-room-embed {
  margin: 0;
}

.single-lhn_event .entry-hero.lhn_event-hero-section .entry-header,
.single-lhn_event article.lhn_event > .entry-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 24px;
}

.single-lhn_event .entry-header .entry-title {
  min-width: 0;
  margin: 0;
}

.lhn-event-chat-title-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, #74bd1f 0%, #4f9908 100%);
  box-shadow: 0 10px 24px rgba(8, 35, 65, 0.25);
  color: #fff !important;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  max-width: 100%;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.lhn-event-chat-title-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lhn-event-chat-title-button:hover,
.lhn-event-chat-title-button:focus-visible {
  color: #fff !important;
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(8, 35, 65, 0.32);
}

.lhn-event-chat-title-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.72);
  outline-offset: 3px;
}

.lhn-chat-room-embed-title {
  margin: 0 0 12px !important;
}

.lhn-chat-room-embed-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 12px;
}

.lhn-chat-room-embed-header .lhn-chat-room-embed-title {
  min-width: 0;
  margin: 0 !important;
}

.lhn-chat-room-page-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  margin-left: auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: #185a96;
  box-shadow: 0 8px 18px rgba(24, 90, 150, 0.2);
  color: #fff !important;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none !important;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.lhn-chat-room-page-link svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lhn-chat-room-page-link:hover,
.lhn-chat-room-page-link:focus-visible {
  color: #fff !important;
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 11px 23px rgba(24, 90, 150, 0.28);
}

.lhn-chat-room-page-link:focus-visible {
  outline: 3px solid rgba(24, 90, 150, 0.28);
  outline-offset: 3px;
}

.lhn-chat-room-access-notice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fbff 0%, #fff 100%);
  box-shadow: 0 8px 24px rgba(26, 69, 116, 0.08);
}

.lhn-chat-room-access-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #185a96;
  color: #fff;
}

.lhn-chat-room-access-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lhn-chat-room-access-content {
  min-width: 0;
}

.lhn-chat-room-access-content.has-join-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 20px;
  width: 100%;
}

.lhn-chat-room-access-content.has-join-action .lhn-chat-room-access-link {
  margin-top: 0;
}

.lhn-chat-room-access-content.has-join-action .lhn-chat-room-access-status {
  grid-column: 1 / -1;
  margin-top: 0;
}

.lhn-chat-room-access-content p {
  margin: 0 !important;
  color: #334e68;
  line-height: 1.55;
}

.lhn-chat-room-access-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 12px;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #74bd1f 0%, #4f9908 100%);
  box-shadow: 0 8px 18px rgba(68, 132, 8, 0.2);
  color: #fff !important;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none !important;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button.lhn-chat-room-access-link {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.lhn-chat-room-access-link:disabled,
.lhn-chat-room-access-link.is-requested {
  background: #dbe7d0;
  box-shadow: none;
  color: #426226 !important;
  cursor: default;
  transform: none;
}

.lhn-chat-room-access-link.is-loading {
  opacity: 0.72;
  cursor: wait;
}

.lhn-chat-room-access-status {
  display: block;
  margin-top: 8px;
  color: #58708a;
  font-size: 13px;
  line-height: 1.4;
}

.lhn-chat-room-access-status:empty {
  display: none;
}

.lhn-chat-room-access-status.is-error {
  color: #a11a1a;
}

.lhn-chat-room-access-link:hover,
.lhn-chat-room-access-link:focus-visible {
  color: #fff !important;
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(68, 132, 8, 0.26);
}

.lhn-chat-room-access-link:focus-visible {
  outline: 3px solid rgba(24, 90, 150, 0.28);
  outline-offset: 3px;
}

.lhn-chat-root[data-chat-mode="room"] {
  height: clamp(420px, 68dvh, 640px);
  max-height: calc(100dvh - 112px);
}

.lhn-chat-shell-room {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  border: 1px solid rgba(31, 79, 139, 0.22);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(23, 63, 114, 0.13);
}

.lhn-chat-shell-room .lhn-chat-pane-title {
  border-bottom-color: rgba(31, 79, 139, 0.14) !important;
  background:
    linear-gradient(135deg, rgba(236, 245, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 58%, rgba(239, 248, 231, 0.82) 100%) !important;
  box-shadow: 0 5px 18px rgba(31, 79, 139, 0.06);
}

.lhn-chat-shell-room .lhn-chat-body {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0 !important;
  overflow: hidden;
}

.lhn-chat-root[data-chat-mode="room"] .lhn-chat-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10050 !important;
  box-sizing: border-box;
  width: 100vw;
  height: 100dvh;
  padding: clamp(14px, 3vw, 28px) !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(15, 23, 42, 0.52) !important;
  backdrop-filter: blur(4px);
}

.lhn-chat-root[data-chat-mode="room"] .lhn-chat-modal {
  width: min(420px, 100%) !important;
  max-height: calc(100dvh - clamp(28px, 6vw, 56px)) !important;
  border: 1px solid rgba(31, 79, 139, 0.16);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.lhn-chat-shell-room .lhn-chat-layout,
.lhn-chat-shell-room .lhn-chat-layout.is-details-open {
  height: 100% !important;
  min-height: 0 !important;
  grid-template-columns: minmax(0, 1fr) !important;
  overflow: hidden !important;
}

.lhn-chat-shell-room .lhn-chat-rooms,
.lhn-chat-shell-room .lhn-chat-details {
  display: none !important;
}

.lhn-chat-shell-room .lhn-chat-thread {
  display: flex !important;
  height: 100% !important;
  min-height: 0 !important;
  min-width: 0;
  overflow: hidden !important;
}

.lhn-chat-shell-room .lhn-chat-messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  /* Hand wheel/touch scrolling back to the Event page at either boundary. */
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #f5f8fc !important;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(191, 219, 254, 0.36), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(209, 240, 178, 0.26), transparent 28%),
    linear-gradient(rgba(31, 79, 139, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 79, 139, 0.025) 1px, transparent 1px) !important;
  background-size: auto, auto, 28px 28px, 28px 28px !important;
  padding: clamp(14px, 2.5vw, 24px) !important;
  scrollbar-color: #aac0da transparent;
  scrollbar-width: thin;
}

.lhn-chat-shell-room .lhn-chat-msg-bubble-wrap {
  border: 1px solid rgba(31, 79, 139, 0.1);
  box-shadow: 0 8px 20px rgba(31, 50, 81, 0.1);
}

.lhn-chat-shell-room .lhn-chat-msg:not(.is-own):not(.is-image):not(.is-file) .lhn-chat-msg-bubble-wrap {
  border-color: #d3e1f1;
  background: linear-gradient(135deg, #fff 0%, #eaf2fd 100%) !important;
  box-shadow: 0 8px 20px rgba(31, 50, 81, 0.08);
}

.lhn-chat-shell-room .lhn-chat-msg.is-own:not(.is-image):not(.is-file) .lhn-chat-msg-bubble-wrap {
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #245b99 0%, #4d89c7 100%) !important;
  box-shadow: 0 11px 25px rgba(31, 79, 139, 0.24);
}

.lhn-chat-shell-room .lhn-chat-composer {
  gap: 10px !important;
  padding: 12px 14px !important;
  border-top: 1px solid rgba(31, 79, 139, 0.14) !important;
  background: linear-gradient(180deg, #fff 0%, #f4f8fd 100%) !important;
  box-shadow: 0 -10px 26px rgba(31, 50, 81, 0.07);
}

.lhn-chat-shell-room .lhn-chat-composer textarea[name="chat_message"],
.lhn-chat-shell-room .lhn-chat-composer textarea[name="message"] {
  min-height: 44px !important;
  padding: 10px 14px !important;
  border: 1px solid #b9cce2 !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: #172033 !important;
  box-shadow: inset 0 1px 2px rgba(31, 50, 81, 0.04), 0 3px 10px rgba(31, 50, 81, 0.05);
}

.lhn-chat-shell-room .lhn-chat-composer textarea:focus {
  border-color: #4384c3 !important;
  outline: 0 !important;
  box-shadow: 0 0 0 4px rgba(67, 132, 195, 0.16), 0 5px 14px rgba(31, 79, 139, 0.08) !important;
}

.lhn-chat-shell-room .lhn-chat-send-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  width: auto !important;
  min-width: 88px !important;
  height: 44px !important;
  padding: 0 17px !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #72bd1c 0%, #46920a 100%) !important;
  box-shadow: 0 9px 20px rgba(70, 146, 10, 0.26) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease !important;
}

.lhn-chat-shell-room .lhn-chat-send-btn::after {
  content: "Send";
}

.lhn-chat-shell-room .lhn-chat-send-btn .lhn-chat-btn-icon,
.lhn-chat-shell-room .lhn-chat-send-btn svg,
.lhn-chat-shell-room .lhn-chat-send-btn path {
  color: #fff !important;
  fill: currentColor !important;
}

.lhn-chat-shell-room .lhn-chat-send-btn:not(:disabled):hover,
.lhn-chat-shell-room .lhn-chat-send-btn:not(:disabled):focus-visible {
  filter: brightness(1.06);
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 13px 26px rgba(70, 146, 10, 0.33) !important;
}

.lhn-chat-shell-room .lhn-chat-send-btn:not(:disabled):active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 5px 12px rgba(70, 146, 10, 0.24) !important;
}

.lhn-chat-shell-room .lhn-chat-send-btn:disabled {
  filter: saturate(0.45);
  opacity: 0.56;
}

@media (max-width: 900px) {
  .single-lhn_event .entry-hero.lhn_event-hero-section .entry-header,
  .single-lhn_event article.lhn_event > .entry-header {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    row-gap: 14px;
    box-sizing: border-box;
    padding: 20px clamp(18px, 5vw, 34px) 24px;
  }

  .single-lhn_event .entry-header .entry-title {
    width: 100%;
    max-width: 24ch;
    font-size: clamp(26px, 4.8vw, 32px) !important;
    line-height: 1.18 !important;
    overflow-wrap: anywhere;
    text-align: center;
    text-wrap: balance;
  }

  .lhn-event-chat-title-button {
    justify-self: center;
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .single-lhn_event .lhn-chat-room-embed {
    margin-top: 28px;
  }

  .single-lhn_event .entry-hero.lhn_event-hero-section .entry-header,
  .single-lhn_event article.lhn_event > .entry-header {
    row-gap: 12px;
    padding: 17px 16px 20px;
  }

  .single-lhn_event .entry-header .entry-title {
    max-width: 26ch;
    font-size: clamp(22px, 6.2vw, 27px) !important;
    line-height: 1.2 !important;
  }

  .lhn-event-chat-title-button {
    width: min(100%, 280px);
    min-height: 42px;
    padding-inline: 14px;
    font-size: 13px;
  }

  .lhn-chat-room-embed {
    margin: 20px 0;
  }

  .lhn-circle-chat-wrap {
    margin-top: 24px;
  }

  .lhn-chat-room-access-notice {
    align-items: flex-start;
    gap: 13px;
    padding: 17px 16px;
  }

  .lhn-chat-room-access-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .lhn-chat-room-access-icon svg {
    width: 22px;
    height: 22px;
  }

  .lhn-chat-room-access-link {
    width: 100%;
  }

  .lhn-chat-room-access-content.has-join-action {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .lhn-chat-root[data-chat-mode="room"] {
    height: min(620px, calc(100svh - 88px));
    min-height: 340px;
    max-height: calc(100svh - 88px);
  }

  .lhn-chat-shell-room {
    border-radius: 14px;
  }

  .lhn-chat-shell-room .lhn-chat-messages {
    padding: 14px 12px !important;
  }

  .lhn-chat-shell-room .lhn-chat-composer {
    gap: 7px !important;
    padding: 10px !important;
  }

  .lhn-chat-shell-room .lhn-chat-send-btn {
    min-width: 76px !important;
    padding-inline: 13px !important;
  }

  .lhn-chat-root[data-chat-mode="room"] .lhn-chat-modal-backdrop {
    padding: 12px !important;
  }

  .lhn-chat-root[data-chat-mode="room"] .lhn-chat-modal {
    max-height: calc(100dvh - 24px) !important;
  }
}

/* Match the full LHN Chat page to the polished Event Chat conversation. */
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-messages {
  background-color: #f5f8fc !important;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(191, 219, 254, 0.36), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(209, 240, 178, 0.26), transparent 28%),
    linear-gradient(rgba(31, 79, 139, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 79, 139, 0.025) 1px, transparent 1px) !important;
  background-size: auto, auto, 28px 28px, 28px 28px !important;
  padding: clamp(14px, 2.5vw, 24px) !important;
  scrollbar-color: #aac0da transparent;
  scrollbar-width: thin;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-msg-bubble-wrap {
  border: 1px solid rgba(31, 79, 139, 0.1);
  box-shadow: 0 8px 20px rgba(31, 50, 81, 0.1);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-msg:not(.is-own):not(.is-image):not(.is-file) .lhn-chat-msg-bubble-wrap {
  border-color: #d3e1f1;
  background: linear-gradient(135deg, #fff 0%, #eaf2fd 100%) !important;
  box-shadow: 0 8px 20px rgba(31, 50, 81, 0.08);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-msg.is-own:not(.is-image):not(.is-file) .lhn-chat-msg-bubble-wrap {
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #245b99 0%, #4d89c7 100%) !important;
  box-shadow: 0 11px 25px rgba(31, 79, 139, 0.24);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-composer {
  gap: 10px !important;
  padding: 12px 14px !important;
  border-top: 1px solid rgba(31, 79, 139, 0.14) !important;
  background: linear-gradient(180deg, #fff 0%, #f4f8fd 100%) !important;
  box-shadow: 0 -10px 26px rgba(31, 50, 81, 0.07);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-composer textarea[name="chat_message"],
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-composer textarea[name="message"] {
  min-height: 44px !important;
  padding: 10px 14px !important;
  border: 1px solid #b9cce2 !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: #172033 !important;
  box-shadow: inset 0 1px 2px rgba(31, 50, 81, 0.04), 0 3px 10px rgba(31, 50, 81, 0.05);
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-composer textarea:focus {
  border-color: #4384c3 !important;
  outline: 0 !important;
  box-shadow: 0 0 0 4px rgba(67, 132, 195, 0.16), 0 5px 14px rgba(31, 79, 139, 0.08) !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-send-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  width: auto !important;
  min-width: 88px !important;
  height: 44px !important;
  padding: 0 17px !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #72bd1c 0%, #46920a 100%) !important;
  box-shadow: 0 9px 20px rgba(70, 146, 10, 0.26) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-send-btn::after {
  content: "Send";
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-send-btn .lhn-chat-btn-icon,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-send-btn svg,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-send-btn path {
  color: #fff !important;
  fill: currentColor !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-send-btn:not(:disabled):hover,
.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-send-btn:not(:disabled):focus-visible {
  filter: brightness(1.06);
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 13px 26px rgba(70, 146, 10, 0.33) !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-send-btn:not(:disabled):active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 5px 12px rgba(70, 146, 10, 0.24) !important;
}

.lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-send-btn:disabled {
  filter: saturate(0.45);
  opacity: 0.56;
}

@media (max-width: 860px) {
  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-messages {
    padding: 14px 12px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-composer {
    gap: 7px !important;
    padding: 10px !important;
  }

  .lhn-chat-root[data-chat-mode="embedded"] .lhn-chat-shell-embedded .lhn-chat-send-btn {
    width: auto !important;
    min-width: 76px !important;
    height: 42px !important;
    padding-inline: 13px !important;
  }
}
