.chat-shell {
  padding: 0;
  overflow: hidden;
}

.chat-shell-head {
  padding: 22px 24px 0;
}

.chat-page-title {
  margin: 0;
  font-size: 28px;
  color: #111827;
}

.chat-page-subtitle {
  margin: 8px 0 0;
  color: #6b7280;
  line-height: 1.6;
}

.chat-alert {
  margin: 18px 24px 0;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
}

.chat-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.chat-alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  height: clamp(620px, 76vh, 820px);
  margin-top: 20px;
  border-top: 1px solid #ece7dd;
  overflow: hidden;
}

.chat-sidebar {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #e7e1d6;
  background: #fbfaf7;
}

.chat-sidebar-card {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
}

.chat-sidebar-title {
  margin: 0 0 16px;
  font-size: 18px;
  color: #111827;
  flex-shrink: 0;
}

.chat-conversation-list {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.chat-conversation-item {
  position: relative;
  min-width: 0;
}

.chat-conversation-card {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 52px 14px 14px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  border: 1px solid #ebe6dc;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.chat-conversation-card:hover {
  transform: translateY(-1px);
  border-color: #d8d1c4;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
}

.chat-conversation-card.is-active {
  background: #f6f1e8;
  border-color: #cfc8bc;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08);
}

.chat-conversation-card.is-active::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: #7a7468;
}

.chat-conversation-menu-wrap {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}

.chat-conversation-menu-toggle {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  transition: color 0.18s ease, background 0.18s ease;
}

.chat-conversation-menu-toggle:hover,
.chat-conversation-menu-toggle:focus-visible,
.chat-conversation-menu-toggle.is-open {
  background: rgba(17, 24, 39, 0.06);
  color: #111827;
  box-shadow: none;
  outline: none;
}

.chat-conversation-menu-toggle span {
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

.chat-conversation-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 8px;
  border: 1px solid #e7e1d6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(17, 24, 39, 0.12);
}

.chat-conversation-menu[hidden] {
  display: none !important;
}

.chat-conversation-menu-form + .chat-conversation-menu-form {
  margin-top: 6px;
}

.chat-conversation-menu-button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: #f8f5ef;
  color: #111827;
  font: inherit;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.chat-conversation-menu-button:hover,
.chat-conversation-menu-button:focus-visible {
  background: #efe8dc;
  outline: none;
}

.chat-conversation-menu-button.is-danger {
  background: #fff4f4;
  color: #b42318;
}

.chat-conversation-menu-button.is-danger:hover,
.chat-conversation-menu-button.is-danger:focus-visible {
  background: #ffe5e5;
}

.chat-conversation-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-conversation-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e7e1d6;
}

.chat-conversation-meta {
  min-width: 0;
  flex: 1;
}

.chat-conversation-name {
  display: block;
  color: #111827;
  font-size: 15px;
}

.chat-conversation-username {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: #6b7280;
}

.chat-conversation-badge {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2f2f2f;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.chat-conversation-preview {
  margin: 12px 0 0;
  color: #6b665e;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-main {
  min-width: 0;
  min-height: 0;
  background: #ffffff;
}

.chat-main-card {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chat-thread {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #ffffff;
}

.chat-thread-empty .chat-messages-scroll {
  display: flex;
}

.chat-main-head {
  flex-shrink: 0;
  padding: 18px 24px;
  border-bottom: 1px solid #ece7dd;
  background: linear-gradient(180deg, #fcfaf6 0%, #ffffff 100%);
}

.chat-main-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-main-head-label {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8377;
}

.chat-mobile-conversations-back {
  display: none;
  width: 34px;
  height: 44px;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b665e;
  text-decoration: none;
  box-shadow: none;
}

.chat-mobile-conversations-back i {
  font-size: 24px;
  line-height: 1;
}

.chat-mobile-conversations-back:hover,
.chat-mobile-conversations-back:focus-visible {
  color: #111827;
  outline: none;
}

.chat-main-head-placeholder {
  font-size: 15px;
  color: #6b7280;
}

.chat-main-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-main-user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e7e1d6;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
  flex-shrink: 0;
}

.chat-main-user-meta {
  min-width: 0;
}

.chat-main-user-name {
  display: block;
  color: #111827;
  font-size: 18px;
  line-height: 1.3;
}

.chat-main-user-username {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.chat-messages-scroll {
  min-height: 0;
  overflow-y: auto;
  background: linear-gradient(180deg, #faf8f4 0%, #ffffff 100%);
}

.chat-messages {
  min-height: 100%;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  box-sizing: border-box;
}

.chat-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 8px;
  color: #7a7468;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.chat-date-separator::before,
.chat-date-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #ded7cc;
}

.chat-date-separator span {
  padding: 5px 10px;
  border: 1px solid #d8d1c4;
  border-radius: 999px;
  background: #fbfaf7;
}

.chat-message-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 6px;
}

.chat-message-row.is-own {
  justify-content: flex-end;
}

.chat-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #d8d1c4;
  background: #ffffff;
}

.chat-message-bubble {
  width: fit-content;
  min-width: 150px;
  max-width: min(68%, 520px);
  padding: 14px 16px 10px;
  border-radius: 20px 20px 20px 10px;
  background: #ffffff;
  border: 1px solid #d2cabc;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.05);
}

.chat-message-bubble.is-own {
  border-radius: 20px 20px 10px 20px;
  background: #f3ede1;
  border-color: #bfb5a6;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.chat-message-text {
  color: #1f2937;
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
}

.chat-message-time {
  margin-top: 7px;
  font-size: 10px;
  color: #9aa1ab;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.chat-composer-wrap {
  flex-shrink: 0;
  padding: 16px 24px 20px;
  border-top: 1px solid #ece7dd;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
}

.chat-form {
  margin: 0;
}

.chat-composer {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e3ddd2;
  border-radius: 24px;
  background: #fbfaf7;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.05);
}

.chat-composer.is-disabled {
  opacity: 0.88;
}

.chat-composer-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.chat-emoji-wrap {
  position: relative;
  align-self: end;
}

.chat-emoji-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b7280;
  font-size: 21px;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.chat-emoji-button:hover,
.chat-emoji-button:focus-visible,
.chat-emoji-button[aria-expanded="true"] {
  background: rgba(17, 24, 39, 0.06);
  color: #111827;
  transform: translateY(-1px);
  outline: none;
}

.chat-emoji-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.chat-emoji-picker {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: 360px;
  max-height: 320px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid #e3ddd2;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.12);
  z-index: 20;
}

.chat-emoji-picker[hidden] {
  display: none !important;
}

.chat-emoji-category + .chat-emoji-category {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1ece4;
}

.chat-emoji-category-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.02em;
}

.chat-emoji-category-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.chat-emoji-item {
  width: 100%;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.chat-emoji-item:hover,
.chat-emoji-item:focus-visible {
  background: #f5efe6;
  transform: translateY(-1px);
  outline: none;
}

.chat-input-shell {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  padding: 4px 0;
}

.chat-textarea {
  width: 100%;
  min-height: 46px;
  max-height: 140px;
  padding: 11px 14px;
  border: 0;
  border-radius: 18px;
  background: #ffffff;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.55;
  resize: none;
  outline: none;
  box-shadow: inset 0 0 0 1px #e0d9cd;
  overflow-y: auto;
}

.chat-textarea:focus {
  box-shadow: inset 0 0 0 1px #cfc6b8;
}

.chat-textarea:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: #f8f5ef;
}

.chat-form-actions {
  display: flex;
  align-self: end;
  margin: 0;
}

.chat-send-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #2f2f2f;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.chat-send-button i {
  font-size: 14px;
}

.chat-send-button span {
  display: none;
}

.chat-send-button:hover {
  background: #1f1f1f;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.16);
}

.chat-send-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chat-composer-help {
  padding: 0 6px 2px;
  font-size: 12px;
  color: #8b93a1;
}

.chat-empty-state {
  flex: 1;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 32px 24px;
  color: #6b7280;
}

.chat-empty-state-icon {
  font-size: 34px;
  color: #b0a899;
  margin-bottom: 14px;
}

.chat-empty-state h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 22px;
}

.chat-empty-state p,
.chat-empty-messages {
  margin: 0;
  line-height: 1.7;
  color: #6b7280;
}

.chat-empty-messages {
  padding: 8px 2px 0;
}

.chat-conversation-list::-webkit-scrollbar,
.chat-messages-scroll::-webkit-scrollbar {
  width: 10px;
}

.chat-conversation-list::-webkit-scrollbar-track,
.chat-messages-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.chat-conversation-list::-webkit-scrollbar-thumb,
.chat-messages-scroll::-webkit-scrollbar-thumb {
  background: #d7d0c4;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.chat-conversation-list::-webkit-scrollbar-thumb:hover,
.chat-messages-scroll::-webkit-scrollbar-thumb:hover {
  background: #c8c0b3;
  border: 2px solid transparent;
  background-clip: padding-box;
}

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

  .chat-layout.has-active-conversation .chat-sidebar {
    display: none;
  }

  .chat-layout:not(.has-active-conversation) .chat-main {
    display: none;
  }

  .chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid #ece7dd;
  }

  .chat-sidebar-card {
    height: auto;
  }

  .chat-conversation-list {
    max-height: 280px;
  }

  .chat-layout:not(.has-active-conversation) .chat-sidebar-card {
    overflow: visible;
  }

  .chat-layout:not(.has-active-conversation) .chat-conversation-list {
    max-height: none;
    overflow: visible;
    padding-bottom: 18px;
  }

  .chat-mobile-conversations-back {
    display: inline-flex;
  }

  .chat-main-card,
  .chat-thread {
    height: auto;
  }

  .chat-messages-scroll {
    max-height: 420px;
  }

  .chat-message-bubble {
    max-width: 88%;
  }
}

@media (max-width: 640px) {
  .chat-emoji-picker {
    width: min(320px, calc(100vw - 48px));
    max-height: 260px;
  }

  .chat-shell-head {
    padding: 18px 18px 0;
  }

  .chat-alert {
    margin: 16px 18px 0;
  }

  .chat-sidebar-card,
  .chat-main-head,
  .chat-composer-wrap {
    padding-left: 18px;
    padding-right: 18px;
  }

  .chat-messages {
    gap: 13px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .chat-message-row {
    gap: 10px;
    padding: 0 2px;
  }

  .chat-message-avatar {
    width: 28px;
    height: 28px;
  }

  .chat-message-bubble {
    min-width: 0;
    max-width: calc(100% - 48px);
    padding: 12px 14px 9px;
  }

  .chat-message-bubble.is-own {
    max-width: 82%;
  }
}

.chat-message-row.is-emoji-only {
  margin-top: 2px;
}

.chat-message-bubble.is-emoji-only,
.chat-message-bubble.is-own.is-emoji-only {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  max-width: none;
}

.chat-message-text.is-emoji-only {
  padding: 0 4px;
  font-size: 40px;
  line-height: 1.15;
  background: transparent;
}

.chat-message-bubble.is-emoji-only .chat-message-time {
  margin-top: 8px;
  padding-left: 4px;
}

@media (max-width: 640px) {
  .chat-composer {
    padding: 8px;
    border-radius: 18px;
  }

  .chat-composer-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .chat-emoji-wrap {
    align-self: center;
  }

  .chat-emoji-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 19px;
  }

  .chat-input-shell {
    min-width: 0;
    width: 100%;
    padding: 0;
  }

  .chat-textarea {
    min-height: 40px;
    max-height: 110px;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 15px;
  }

  .chat-form-actions {
    grid-column: auto;
    width: auto;
    margin-top: 0;
  }

  .chat-send-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    gap: 0;
    flex-shrink: 0;
  }

  .chat-send-button i {
    font-size: 14px;
  }

  .chat-composer-help {
    display: none;
  }
}


/* ===== 2026-04-22 mobile chat polish ===== */
@media (max-width: 640px) {
  .chat-main-card,
  .chat-thread,
  .chat-composer-wrap,
  .chat-composer,
  .chat-emoji-wrap {
    overflow: visible;
  }

  .chat-composer-wrap {
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, #fbf9f4 100%);
  }

  .chat-composer {
    gap: 10px;
    padding: 8px;
    border: 1px solid #ddd5c8;
    border-radius: 22px;
    background: #f6f1e8;
    box-shadow:
      0 10px 24px rgba(17, 24, 39, 0.08),
      inset 0 1px 0 rgba(255,255,255,0.7);
  }

  .chat-composer-main {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
    align-items: end;
  }

  .chat-emoji-wrap {
    position: static;
  }

  .chat-emoji-button {
    width: 42px;
    height: 42px;
    border: 1px solid #ddd5c8;
    background: #fffdf9;
    color: #4b5563;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.05);
  }

  .chat-emoji-button:hover,
  .chat-emoji-button:focus-visible,
  .chat-emoji-button[aria-expanded="true"] {
    background: #ffffff;
    color: #111827;
    transform: none;
  }

  .chat-input-shell {
    padding: 0;
  }

  .chat-textarea {
    min-height: 42px;
    max-height: 108px;
    padding: 10px 14px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #d9d1c4;
    font-size: 16px;
    line-height: 1.45;
  }

  .chat-textarea::placeholder {
    color: #8a8174;
    opacity: 1;
  }

  .chat-form-actions {
    align-self: end;
  }

  .chat-send-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(180deg, #8e8a84 0%, #6f6a64 100%);
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.16);
  }

  .chat-send-button:hover {
    background: linear-gradient(180deg, #7f7a74 0%, #615d57 100%);
    transform: none;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.16);
  }

  .chat-send-button:disabled {
    opacity: 0.5;
    box-shadow: none;
  }

  .chat-emoji-picker {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    max-height: min(48vh, 360px);
    padding: 12px;
    border: 1px solid #ddd5c8;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 20px 40px rgba(17, 24, 39, 0.18);
    z-index: 9999;
  }

  .chat-emoji-category-title {
    position: sticky;
    top: -12px;
    z-index: 1;
    padding: 6px 0 8px;
    background: rgba(255, 255, 255, 0.96);
  }

  .chat-emoji-category-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }

  .chat-emoji-item {
    height: 42px;
    border-radius: 12px;
    font-size: 22px;
  }
}

.admin-brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f7f1e7;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(122, 79, 34, 0.18);
}

.admin-brand-logo-img {
  display: block;
  width: 100%;
  max-width: 170px;
  height: auto;
}

@media (max-width: 900px) {
  .admin-brand-logo {
    width: auto;
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .admin-brand-logo-img {
    max-width: 140px;
  }
}
/* Fejléces Chat widget */
.header-chat-nav-item {
  position: relative;
}

.header-chat-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 140;
  width: min(340px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.header-chat-dropdown[hidden] {
  display: none;
}

.header-chat-dropdown-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 4px 12px;
}

.header-chat-dropdown-head strong {
  color: #111827;
  font-size: 0.98rem;
}

.header-chat-dropdown-head span {
  color: #6b7280;
  font-size: 0.82rem;
}

.header-chat-empty {
  margin: 0;
  padding: 12px 4px 4px;
  color: #6b7280;
  font-size: 0.9rem;
}

.header-chat-friend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.header-chat-friend-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-chat-friend-button:hover,
.header-chat-friend-button:focus-visible {
  background: #f3f4f6;
  transform: translateY(-1px);
  outline: none;
}

.header-chat-friend-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
}

.header-chat-friend-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.header-chat-friend-meta strong,
.header-chat-friend-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-chat-friend-meta strong {
  color: #111827;
  font-size: 0.92rem;
}

.header-chat-friend-meta small {
  color: #6b7280;
  font-size: 0.78rem;
}

/* Lábléc fölötti Chat panel */
.floating-chat-panel {
  position: fixed;
  right: 24px;
  bottom: calc(var(--site-footer-height) + 16px);
  z-index: 150;
  width: min(420px, calc(100vw - 32px));
  margin: 0;
}

.floating-chat-panel[hidden] {
  display: none;
}

.floating-chat-card {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

.floating-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #ece7dd;
  background: #fbfaf7;
}

.floating-chat-user {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.floating-chat-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
}

.floating-chat-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.floating-chat-user-meta strong,
.floating-chat-user-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-chat-user-meta strong {
  color: #111827;
  font-size: 0.98rem;
}

.floating-chat-user-meta small {
  color: #6b7280;
  font-size: 0.8rem;
}

.floating-chat-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.floating-chat-close:hover,
.floating-chat-close:focus-visible {
  background: #e5e7eb;
  transform: translateY(-1px);
  outline: none;
}

.floating-chat-error {
  margin: 14px 16px 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.9rem;
}

.floating-chat-error[hidden] {
  display: none;
}

.floating-chat-body {
  display: flex;
  flex-direction: column;
}

.floating-chat-body .chat-messages-scroll {
  height: clamp(280px, 45vh, 460px);
  border: 0;
}

.floating-chat-body .chat-composer-wrap {
  border-top: 1px solid #ece7dd;
}

@media (max-width: 640px) {
  .header-chat-dropdown {
    right: 0;
    width: min(320px, calc(100vw - 24px));
  }

  .floating-chat-panel {
    left: 10px;
    right: 10px;
    bottom: calc(var(--site-footer-height) + 12px);
    width: auto;
    margin: 0;
  }

  .floating-chat-card {
    border-radius: 20px;
  }

  .floating-chat-body .chat-messages-scroll {
    height: 360px;
  }
}

/* Külön mobil/tablet Chat panel */
.mobile-chat-panel {
  display: none;
}

.mobile-chat-panel[hidden] {
  display: none;
}

@media (max-width: 991px) {
  .mobile-chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1300;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    display: flex;
    background: #ffffff;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .mobile-chat-panel[hidden] {
    display: none;
  }

  .mobile-chat-card {
    width: 100%;
    height: 100%;
    max-width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
    touch-action: auto;
  }

  .mobile-chat-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    border-bottom: 1px solid #ece7dd;
    background: #fbfaf7;
  }

  .mobile-chat-user {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
  }

  .mobile-chat-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 auto;
  }

  .mobile-chat-user-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .mobile-chat-user-meta strong,
  .mobile-chat-user-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-chat-user-meta strong {
    color: #111827;
    font-size: 0.98rem;
  }

  .mobile-chat-user-meta small {
    color: #6b7280;
    font-size: 0.8rem;
  }

  .mobile-chat-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    cursor: pointer;
    flex: 0 0 auto;
  }

  .mobile-chat-error {
    flex: 0 0 auto;
    margin: 12px 14px 0;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.9rem;
  }

  .mobile-chat-error[hidden] {
    display: none;
  }

  .mobile-chat-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .mobile-chat-body .chat-messages-scroll {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    border: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .mobile-chat-body .chat-composer-wrap {
    flex: 0 0 auto;
    border-top: 1px solid #ece7dd;
    padding-bottom: env(safe-area-inset-bottom);
    background: #ffffff;
  }
}
