:root {
  --chat-input-height: 72px;
}

html,
body {
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  height: 100%;
  overflow: hidden;
}

body.profile-modal-open {
  overflow: hidden;
}

#main-content {
  display: flex;
  flex: 1;
  /* Allow main-content to take available space */
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.mobile-hidden {
  display: none !important;
}

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px 16px;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(18px);
  display: none;
  gap: 8px;
  z-index: 1600;
}

.mobile-nav button {
  flex: 1;
  border: none;
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.88em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.mobile-nav button.is-active {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0f172a;
}

.mobile-nav button:active {
  transform: translateY(1px);
}

.mobile-nav.hidden {
  display: none;
}

body.mobile-nav-active {
  padding-bottom: 80px;
}

#sidebar {
  width: 320px;
  min-width: 300px;
  flex: 0 0 320px;
  flex-shrink: 0;
  border-right: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

#right-sidebar {
  width: 360px;
  border-left: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, #fdfcff 0%, #eef2ff 65%, #f9fafc 100%);
  display: flex;
  flex-direction: column;
  padding: 18px;
  box-sizing: border-box;
  overflow-y: auto;
  height: 100%;
  min-height: 0;
}

#place-details-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.place-details-shell {
  gap: 18px;
}

.place-details-hero {
  position: relative;
  height: 220px;
  border-radius: 28px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.4);
}

.place-details-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.45) 100%);
}

.place-info-card {
  background: #fff;
  border-radius: 30px;
  padding: 24px;
  box-shadow: 0 35px 60px rgba(15, 23, 42, 0.25);
  margin-top: -70px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.place-info-location {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  color: #64748b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.place-info-location-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  align-items: center;
  justify-content: center;
  color: #4338ca;
  font-size: 0.82em;
}

.place-map-card {
  display: block;
  margin-top: 16px;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.2);
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  padding: 0;
  cursor: pointer;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
  color: inherit;
  font: inherit;
}

.place-map-card:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.4);
  outline-offset: 4px;
}

.place-map-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 55px rgba(59, 130, 246, 0.25);
}

.place-map-tile {
  width: 100%;
  height: 170px;
  background-size: cover;
  background-position: center;
  position: relative;
  filter: saturate(1.05);
}

.place-map-tile.is-area::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(56, 189, 248, 0.75);
  border-radius: 14px;
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.12);
}

.place-map-marker {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background-size: cover;
  background-position: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.35);
}

.place-map-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1400;
  padding: 20px;
}

.place-map-overlay.is-visible {
  display: flex;
}

.place-map-overlay-card {
  position: relative;
  width: min(960px, 94vw);
  height: min(620px, 92vh);
  background: #ffffff;
  border-radius: 32px;
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.35);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.place-map-overlay-close {
  position: absolute;
  top: 12px;
  right: 18px;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  color: #1e293b;
  cursor: pointer;
}

.place-map-overlay-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 32px;
}

.place-map-overlay-title {
  margin: 0;
  font-size: 1.2em;
  font-weight: 700;
  color: #0f172a;
}

.place-map-overlay-status {
  font-size: 0.85em;
  color: #475569;
}

.place-map-overlay-map {
  flex: 1;
  border-radius: 24px;
  overflow: hidden;
}

.place-map-overlay-map,
.place-map-overlay-map .leaflet-container {
  width: 100%;
  height: 100%;
}

.leaflet-marker-icon.leaflet-avatar-icon {
  border-radius: 50%;
  border: none;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.3);
}

.leaflet-marker-icon.leaflet-avatar-icon.is-user {
  border: 2px solid #2563eb;
}

.place-info-title {
  margin: 0;
  font-size: 1.6em;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.place-info-rating {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.place-rating-text {
  font-size: 0.85em;
  color: #64748b;
}

.place-info-description {
  margin: 0;
  font-size: 0.95em;
  color: #233049;
  line-height: 1.55;
}

.place-info-section-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.92em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.place-info-photos-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.language-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
}

.language-label {
  font-size: 0.85em;
  font-weight: 600;
  color: #475569;
}

.language-buttons {
  display: inline-flex;
  gap: 6px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 2px;
}

.language-buttons button {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.78em;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.language-buttons button.is-active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

#right-sidebar.hidden {
  display: none;
}

.place-recommendations {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-upload-btn-inline {
  padding: 10px 18px;
  font-size: 0.85em;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.35);
}

.place-photo-gallery {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.place-photo-gallery-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.place-photo-gallery-header h5 {
  margin: 0;
  font-size: 1.05em;
  font-weight: 600;
  color: #0f172a;
}

.place-photo-gallery-header p {
  margin: 2px 0 0;
  font-size: 0.85em;
  color: #64748b;
}

.photo-upload-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.85em;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.photo-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.3);
}

.place-photo-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.place-photo-thumb {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding-bottom: 65%;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.place-photo-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 30%, rgba(15, 23, 42, 0.2) 100%);
}

.place-photo-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 24px rgba(15, 23, 42, 0.2);
}

.place-photo-thumb-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em;
  font-weight: 600;
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.08);
}

.place-photo-thumb-add span {
  position: relative;
  z-index: 1;
}

.photo-grid-empty {
  grid-column: 1 / -1;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.85em;
  color: #64748b;
  background: rgba(248, 250, 252, 0.8);
  text-align: center;
}

.place-photo-gallery.place-photo-gallery-inline {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.place-photo-grid.place-photo-grid-inline {
  margin-top: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.place-photo-grid.place-photo-grid-inline .place-photo-thumb {
  border-radius: 16px;
  border: none;
}

.place-info-card>.place-recommendations,
.place-info-card>.place-events-section {
  margin-top: 24px;
}

.place-recommendations h5 {
  margin: 0;
  font-size: 1em;
  color: #1f2d3d;
}

.place-recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recommendation-card {
  position: relative;
  min-height: 180px;
  border-radius: 26px;
  overflow: hidden;
  cursor: pointer;
  background: #0f172a;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.recommendation-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 60px rgba(15, 23, 42, 0.55);
}

.recommendation-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform 0.25s ease;
}

.recommendation-card:hover .recommendation-cover {
  transform: scale(1.05);
}

.recommendation-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 20%, rgba(0, 0, 0, 0.85) 100%);
}

.recommendation-overlay {
  position: relative;
  z-index: 1;
  padding: 18px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  color: #f8fafc;
  text-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.recommendation-chip-row {
  display: flex;
  gap: 6px;
}

.recommendation-chip {
  font-size: 0.65em;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
}

.recommendation-title {
  margin: 0;
  font-weight: 600;
  font-size: 1.15em;
  letter-spacing: 0.02em;
}

.recommendation-description {
  margin: 0;
  font-size: 0.9em;
  opacity: 0.95;
}

.recommendation-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.recommendation-meta {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.85;
}

.recommendation-avatars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.recommendation-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  font-size: 0.75em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#searchBar {
  padding: 10px;
  border-bottom: 1px solid #ccc;
  min-height: 35px;
  /* Ensure consistent height */
  display: flex;
  align-items: center;
  gap: 10px;
}

#searchBar input {
  flex: 1;
  padding: 8px;
  box-sizing: border-box;
}

#roomList {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.user-menu {
  margin-top: auto;
  padding: 8px 16px;
  border-top: 1px solid rgba(209, 217, 230, 0.6);
  background: linear-gradient(180deg, rgba(248, 249, 255, 0.95) 0%, rgba(241, 245, 255, 0.92) 100%);
  box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  position: sticky;
  bottom: 0;
}

.user-menu {
  box-sizing: border-box;
}

.user-menu:not(.auth-required) {
  min-height: var(--chat-input-height);
}

.user-menu.hidden {
  display: none;
}

.user-menu-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
  border: 2px solid rgba(79, 70, 229, 0.2);
  background: #fff;
}

.user-menu-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-menu-name {
  font-weight: 600;
  font-size: 1em;
  color: #1f2937;
}

.user-menu-action {
  font-size: 1.2em;
  line-height: 1;
  color: #6366f1;
  opacity: 0.85;
}

.user-menu {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.user-menu.auth-required {
  cursor: default;
  flex-direction: column;
  align-items: stretch;
  min-height: auto;
}

.user-menu:hover {
  box-shadow: 0 -16px 36px rgba(59, 130, 246, 0.18);
  transform: translateY(-1px);
}

.user-menu:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.55);
  outline-offset: 4px;
}

.user-menu.auth-required .user-menu-main {
  display: none;
}

.user-menu:not(.auth-required) .auth-cta {
  display: none;
}

.user-menu-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
}

.auth-cta {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.95em;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.auth-cta:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

.auth-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.45);
}

.logout-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 0.92em;
  color: #1f2937;
  background: rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: background 0.12s ease;
  display: none;
}

.logout-btn:hover {
  background: rgba(15, 23, 42, 0.16);
}

.room {
  margin: 0 8px 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 247, 252, 0.92) 100%);
  border: 1px solid rgba(209, 217, 230, 0.6);
  border-radius: 16px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: visible;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.room-unread-badge {
  position: absolute;
  bottom: -8px;
  right: -8px;
  min-width: 26px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76em;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1), transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.room-unread-badge[data-count="1"] {
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
}

.room-unread-badge.is-visible {
  opacity: 1;
  transform: scale(1);
}

.room-unread-badge.is-hidden {
  opacity: 0;
  transform: scale(0.6);
}

.room-removal-badge {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  font-size: 0.84em;
  font-weight: 600;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.room-removal-badge.visible {
  opacity: 1;
  transform: translateY(0);
}

.room-removal-badge-photo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 18px rgba(14, 116, 144, 0.35);
}

.room-removal-badge-text {
  white-space: nowrap;
}

.room:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.16);
  border-color: rgba(76, 110, 245, 0.35);
}

.room.active {
  border-color: rgba(76, 110, 245, 0.55);
  box-shadow: 0 24px 40px rgba(76, 110, 245, 0.25);
}

.room.new-room {
  opacity: 0;
  transform: translateY(-12px);
}

.room.pinned {
  font-weight: bold;
}

.room-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 10px 10px 10px 10px;
  flex-shrink: 0;
  object-fit: cover;
  background: linear-gradient(135deg, #dfe7f5 0%, #edf1fa 100%);
  border: 1px solid rgba(209, 217, 230, 0.6);
}

.room-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  justify-content: space-between;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  margin-top: -10px;
}

.room-title {
  font-weight: 600;
  font-size: 0.95em;
  color: #1f2d3d;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 4px;
  flex-direction: row-reverse;
}

.room-chip {
  font-size: 0.68em;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(27, 77, 228, 0.12);
  color: #1b4de4;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-meta-distance {
  font-size: 0.7em;
  color: #64748b;
}

.room-footer {
  font-size: 0.72em;
  color: #475569;
  display: grid;
  grid-auto-flow: column;
  grid-column-gap: 10px;
  align-items: center;
  font-weight: 500;
  margin-top: 0px;
  transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.room-footer.is-hidden {
  opacity: 0;
  visibility: hidden;
  height: 0;
  margin-top: 0;
  overflow: hidden;
}

.room-footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.room-footer .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

.room-typing {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72em;
  color: #1d4ed8;
  opacity: 0;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.room-typing.is-active {
  opacity: 1;
  visibility: visible;
  height: auto;
}

.room-typing.is-hidden {
  opacity: 0;
  visibility: hidden;
  height: 0;
}

.room-typing-avatars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.room-typing-avatars .avatar-xs {
  width: 22px;
  height: 22px;
  margin: 0;
  box-shadow: none;
}

.room-typing-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
#roomList::-webkit-scrollbar,
#chat::-webkit-scrollbar {
  width: 0;
  background: transparent;
  /* make scrollbar transparent */
}

/* Hide scrollbar for IE, Edge and Firefox */
#roomList,
#chat {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

#chatContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#chatContainer.hidden {
  display: none;
}

#chatHeader {
  padding: 10px;
  border-bottom: 1px solid #ccc;
  background: #f9f9f9;
  min-height: 35px;
  /* Ensure consistent height */
  height: 35px;
  /* Force height */
  line-height: 35px;
  /* Vertically center single line text */
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Align items with space between */
}

#chatHeader.hidden {
  display: none;
}

#closeChatBtn {
  cursor: pointer;
  font-size: 1.95em;
  /* 30% bigger */
  padding: 0 10px;
  font-weight: lighter;
  /* Thinner */
  opacity: 0.5;
  /* 50% transparent */
}

#chat p {
  margin: 0 0 8px 0;
}

.message-container {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 4px 0;
  width: 100%;
}

.message-container.message-incoming {
  justify-content: flex-start;
}

.message-container.message-outgoing {
  justify-content: flex-end;
}

.message-bubble-wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 68%;
  position: relative;
}

.message-bubble {
  position: relative;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.96em;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  margin-bottom: 4px;
}

.message-bubble.my-message {
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  color: #f8f9ff;
}

.message-bubble.other-message {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.message-bubble.other-message:hover {
  border-color: rgba(88, 101, 242, 0.25);
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.08);
}

.message-bubble.my-message:hover {
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.25);
}

.message-bubble .message-text {
  margin-bottom: 4px;
}

.message-media {
  margin-top: 6px;
  border-radius: 14px;
  overflow: hidden;
  display: block;
  background: rgba(15, 23, 42, 0.12);
}

.message-media img {
  display: block;
  max-width: 320px;
  width: 100%;
  height: auto;
}

.message-media a {
  display: block;
}

.message-container.message-incoming .message-bubble-wrapper {
  align-items: stretch;
}

.message-container.message-outgoing .message-bubble-wrapper {
  align-items: stretch;
}

.message-container.is-editing .message-bubble-wrapper {
  align-items: center !important;
}

.message-author {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.78em;
  font-weight: 600;
  color: #949ba4;
  margin-bottom: 6px;
  width: 100%;
}

.message-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  font-size: 0.68em;
  color: rgba(15, 23, 42, 0.5);
  margin-top: 6px;
}

.message-container.message-incoming .message-meta {
  justify-content: flex-end;
  color: rgba(148, 155, 164, 0.95);
}

.message-meta .message-time {
  min-width: 46px;
  text-align: right;
}

.message-meta .message-edited-label {
  font-style: italic;
  opacity: 0.75;
}

.message-container.message-outgoing .message-meta {
  color: rgba(225, 229, 255, 0.85);
}

.message-reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.message-reaction-chip {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72em;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

.message-bubble.my-message .message-reaction-chip {
  border-color: rgba(255, 255, 255, 0.4);
  color: #f8fafc;
}

.message-reaction-chip:hover {
  background: rgba(88, 101, 242, 0.18);
  transform: translateY(-1px);
}

.message-status {
  display: none;
}

.message-edited-label {
  margin-left: 6px;
  font-style: italic;
  color: #a0a0a0;
}

.message-editing-label {
  margin-left: 6px;
  font-style: italic;
  color: #2563eb;
}

.message-actions {
  display: none;
  gap: 8px;
  margin-top: 6px;
  justify-content: flex-end;
}

.message-container.message-outgoing:hover .message-actions {
  display: flex;
}

.message-container.message-outgoing:focus-within .message-actions {
  display: flex;
}

.message-actions .message-action {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.7em;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.message-actions .message-action:hover {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.message-edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.message-edit-input {
  width: 100%;
  font-size: 0.95em;
  line-height: 1.5;
  border: 1px solid #d0d7ff;
  border-radius: 10px;
  padding: 12px 14px;
  resize: none;
  outline: none;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  max-height: 220px;
  overflow: hidden;
}

.message-edit-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.message-edit-input:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

.message-edit-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
}

.message-edit-save,
.message-edit-cancel {
  border: none;
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 0.8em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.message-edit-save {
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.message-edit-save:not(:disabled):hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.message-edit-save:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.message-edit-cancel {
  background: transparent;
  color: #64748b;
  padding: 6px 10px;
}

.message-edit-cancel:hover {
  color: #1f2937;
  background: rgba(148, 163, 184, 0.15);
}

.message-edit-error {
  color: #dc2626;
  font-size: 0.75em;
  text-align: center;
}

.message-edit-helper {
  font-size: 0.72em;
  color: #94a3b8;
  text-align: center;
  margin-top: 6px;
}

.message-bubble-wrapper {
  position: relative;
}

.message-container.is-editing .message-bubble-wrapper {
  max-width: 360px;
  width: 100%;
}

.message-container.is-editing .message-bubble {
  background: #ffffff;
  border: 1px solid rgba(79, 70, 229, 0.35);
  box-shadow: 0 10px 40px rgba(79, 70, 229, 0.15);
  padding: 18px 20px 16px;
  border-radius: 22px;
  width: 100%;
}

.message-container.is-deleted .message-bubble {
  background: #f8fafc;
  color: #94a3b8;
}

.message-text-deleted {
  font-style: italic;
  color: #94a3b8;
}

.message-deleted-label {
  margin-left: 6px;
  font-style: italic;
  color: #cbd5f5;
}

.message-context-menu {
  position: absolute;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 6px;
  background: #1f2937;
  color: #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.45);
  gap: 4px;
}

.message-context-menu.hidden {
  display: none;
}

.message-context-item {
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
}

.message-context-item:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.25);
}

.message-context-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.message-context-item.hidden {
  display: none;
}

.message-context-delete {
  color: #fca5a5;
}

.message-context-report {
  color: #fbbf24;
}

.message-context-reactions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
}

.message-context-reactions.hidden {
  display: none;
}

.message-context-reaction {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1em;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.message-context-reaction:hover {
  background: rgba(30, 64, 175, 0.2);
  transform: translateY(-1px);
}

#roomContextMenu {
  min-width: auto;
  padding: 4px;
  display: inline-flex;
}

#roomContextMenu.hidden {
  display: none !important;
}

#roomContextMenu .message-context-item {
  text-align: center;
  padding: 8px 16px;
  min-width: 0;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1200;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
  color: #f8fafc;
  font-size: 0.85em;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
  cursor: pointer;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-info {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.toast-success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.toast-error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.message-avatar {
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.message-container.message-outgoing .message-avatar {
  order: 2;
}

.message-container.message-outgoing .message-bubble-wrapper {
  order: 1;
}

.message-media-button {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  display: block;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}

.message-media-button img {
  display: block;
  width: 220px;
  max-height: 220px;
  object-fit: cover;
}

.message-media-button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 4px;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 2000;
}

.photo-lightbox.hidden {
  display: none;
}

.photo-lightbox-body {
  position: relative;
  background: #0b1220;
  border-radius: 24px;
  padding: 24px 48px;
  max-width: 900px;
  width: 100%;
  color: #f8fafc;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.photo-lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 2rem;
  color: #e2e8f0;
  cursor: pointer;
}

.photo-lightbox-frame {
  margin: 0;
  text-align: center;
}

.photo-lightbox-image {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45);
}

.photo-lightbox-caption {
  margin-top: 12px;
  font-size: 0.85em;
  color: #cbd5f5;
}

.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(15, 23, 42, 0.5);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
}

.photo-lightbox-prev {
  left: 12px;
}

.photo-lightbox-next {
  right: 12px;
}

.photo-lightbox-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-action-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.35);
  color: #f8fafc;
}

.photo-vote-btn.is-active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.35);
}

.photo-lightbox-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 0.85em;
  color: #cbd5f5;
}

body.lightbox-open {
  overflow: hidden;
}

.message-image-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.message-image-modal.hidden {
  display: none;
}

.message-image-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
}

.message-image-body {
  position: relative;
  background: #0b1220;
  padding: 16px;
  border-radius: 20px;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.message-image-preview {
  max-width: 80vw;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

.message-image-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: none;
  background: rgba(15, 23, 42, 0.5);
  color: #f8fafc;
  font-size: 1.5rem;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.message-image-caption {
  margin-top: 8px;
  text-align: center;
  font-size: 0.85em;
  color: #cbd5f5;
}

#chat {
  flex: 1;
  padding: 18px 20px;
  overflow-y: auto;
  background: #f2f3f5;
  display: none;
  flex-direction: column;
  /* Enable flex column for messages */
  min-height: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in, visibility 0.3s ease-in;
}

#chat.visible {
  opacity: 1;
  visibility: visible;
  display: flex;
}

#suggestions.hidden {
  display: none;
}

.suggestion-loading,
.suggestion-error,
.suggestion-empty {
  text-align: center;
  color: #708191;
  font-size: 0.95em;
  padding: 24px 0;
}

.suggestion-error {
  color: #c0392b;
}

.suggestion-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.suggestion-section-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  padding-left: 8px;
}

.suggestion-section-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #4c6ef5 0%, #3b82f6 100%);
}

.suggestion-section-title {
  margin: 0;
  font-size: 1.25em;
  font-weight: 700;
  color: #1a2c3d;
  letter-spacing: -0.01em;
}

.suggestion-section-subtitle {
  margin: 0;
  font-size: 0.9em;
  color: #708191;
}

.suggestion-row {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  grid-auto-rows: 1fr;
}

@media (max-width: 1200px) {
  .suggestion-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.suggestion-card {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  min-height: 220px;
  height: 100%;
  box-shadow: 0 35px 60px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}

.suggestion-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 35px 65px rgba(15, 23, 42, 0.45);
}

.suggestion-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform 0.22s ease;
}

.suggestion-card:hover .suggestion-cover {
  transform: scale(1.05);
}

.suggestion-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 20%, rgba(0, 0, 0, 0.85) 100%);
}

.suggestion-overlay {
  position: relative;
  z-index: 1;
  padding: 20px;
  min-height: 200px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: min-content;
  gap: 12px 24px;
  align-content: end;
  color: #f8fafc;
  text-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  flex: 1;
}

.suggestion-card-title {
  margin: 0;
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: 0.02em;
  grid-column: 1 / 2;
}

.suggestion-topics {
  position: static;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  grid-column: 2 / 3;
  align-self: start;
}

.suggestion-topic-pill {
  font-size: 0.68em;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
  color: #f8fafc;
}

.suggestion-topic-pill.primary {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.suggestion-about {
  font-size: 0.92em;
  color: rgba(255, 255, 255, 0.9);
  grid-column: 1 / -1;
}

.suggestion-meta {
  display: none;
}

.suggestion-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 18px;
  width: 100%;
  grid-column: 1 / -1;
}

.suggestion-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin-right: auto;
}

.suggestion-typing.is-hidden {
  display: none;
}

.suggestion-typing-stack {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.suggestion-avatars {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

.suggestion-avatars.is-hidden {
  display: none;
}

.suggestion-avatars-stack {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.suggestion-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(15, 23, 42, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -14px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.suggestion-avatar:first-child {
  margin-left: 0;
}

.suggestion-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: none;
  border: none;
}

.suggestion-avatar-more {
  font-size: 0.8em;
  font-weight: 600;
  color: #fff;
  background: rgba(12, 16, 24, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.suggestion-avatar.is-online {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35), 0 6px 14px rgba(0, 0, 0, 0.5);
}

.suggestion-avatar.is-typing {
  border-color: #facc15;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.35), 0 6px 14px rgba(0, 0, 0, 0.45);
}

.suggestion-message-bubble {
  background: transparent;
  border: none;
  padding: 0;
}

.suggestion-message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.suggestion-message-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.suggestion-message-author .avatar {
  box-shadow: none;
}

.suggestion-message-time {
  color: #6b7a91;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.suggestion-message-body {
  font-size: 0.88em;
  color: #253043;
  line-height: 1.45;
}

.suggestion-message-media {
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(79, 70, 229, 0.1);
}

.suggestion-message-media img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.suggestion-message-fallback {
  font-size: 0.85em;
  color: #5b6b7d;
}

.suggestion-card-updated {
  animation: suggestionPulse 0.65s ease;
}

@keyframes suggestionPulse {
  0% {
    box-shadow: 0 0 0 rgba(37, 99, 235, 0);
  }

  40% {
    box-shadow: 0 0 0 12px rgba(37, 99, 235, 0.18);
  }

  100% {
    box-shadow: 0 0 0 rgba(37, 99, 235, 0);
  }
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: #e5e7eb;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.avatar-sm {
  width: 28px;
  height: 28px;
}

.avatar-xs {
  width: 22px;
  height: 22px;
}

.avatar-md {
  width: 36px;
  height: 36px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background-color: #94a3b8;
  opacity: 0.4;
  animation: typingBlink 1.2s infinite ease-in-out;
}

.suggestion-companions.typing .typing-dots span {
  background-color: #64748b;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@media (max-width: 1100px) {
  #homeView.active {
    grid-template-columns: 1fr;
  }

  .feed-container,
  #suggestions {
    width: 100%;
  }

  .home-right-pane {
    grid-template-rows: auto auto;
  }
}

.place-hover-card {
  position: absolute;
  width: 320px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.place-hover-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.place-hover-card.hidden {
  opacity: 0;
}

.place-hover-image img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.place-hover-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
}

.place-hover-title {
  font-size: 1em;
  font-weight: 700;
  color: #1f2b3b;
}

.place-hover-meta {
  display: inline-flex;
  gap: 10px;
  font-size: 0.78em;
  color: #5c6a7d;
}

.place-hover-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

.place-hover-about {
  margin: 0;
  font-size: 0.86em;
  color: #324153;
  line-height: 1.45;
}

.place-hover-topics {
  display: inline-flex;
  gap: 6px;
}

.place-hover-topics span {
  font-size: 0.7em;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(76, 110, 245, 0.16);
  color: #2a4090;
}

.suggestion-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.suggestion-button {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.suggestion-button.primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.suggestion-button.secondary {
  background: #e8edf5;
  color: #445164;
}

.suggestion-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
}

.suggestion-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

#chatInputForm {
  display: none;
  border-top: 1px solid #ccc;
  background: #f8fafc;
  padding: 8px;
  gap: 8px;
  flex-direction: column;
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#chatInputForm input[type="text"] {
  flex: 1;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  font-size: 1em;
  background: #fff;
}

.chat-action-btn {
  border: none;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.2em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

#chatInputForm button[type="submit"] {
  padding: 10px 20px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  cursor: pointer;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
  font-weight: 600;
}

#chatInputForm button[type="submit"]:disabled {
  background: #cbd5f5;
  cursor: not-allowed;
  box-shadow: none;
}

.attachment-preview {
  display: block;
}

.attachment-preview.hidden {
  display: none;
}

.attachment-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.attachment-preview-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
}

.attachment-preview-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}

.attachment-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 4px 7px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8em;
  font-weight: 700;
  line-height: 1;
}

#addPlaceBtn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.5em;
  background-color: #007bff;
  /* Blue */
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  /* Prevent shrinking */
}

#changeUsernameBtn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.1em;
  background-color: #6c757d;
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

#changeUsernameBtn:hover {
  background-color: #5a6268;
}

#addPlaceOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  /* Initially hidden, use flex to show */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#addPlaceModalContent {
  width: 90%;
  max-width: 500px;
  border-radius: 8px;
  padding: 20px;
}

#addPlaceForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#addPlaceModalContent h2 {
  margin-top: 0;
}

.add-place-input-group {
  display: flex;
  gap: 10px;
  width: 100%;
}

#usernameOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#usernameModalContent {
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  overflow: hidden;
  background: #ffffff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.username-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.username-modal-header h2 {
  margin: 0;
  font-size: 1.4em;
}

.username-modal-actions {
  display: flex;
  gap: 8px;
}

.username-modal-actions button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background-color: #007bff;
  color: #fff;
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.username-modal-actions button:last-child {
  background-color: #6c757d;
}

.username-modal-actions button:hover {
  opacity: 0.9;
}

#usernameList {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.username-entry {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.username-entry.current {
  border-color: #007bff;
  background-color: #eef5ff;
}

.username-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.username-label {
  font-weight: bold;
  font-size: 1.05em;
}

.username-entry-actions {
  display: flex;
  gap: 8px;
}

.username-entry-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #007bff;
  color: #fff;
  font-size: 0.85em;
}

.username-entry-actions button:hover {
  opacity: 0.9;
}

.username-entry-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
  font-size: 0.85em;
  color: #555;
}

.username-entry-stats span strong {
  color: #222;
}

.username-empty,
.username-loading,
.username-error {
  text-align: center;
  color: #666;
  font-size: 0.95em;
  padding: 10px 0;
}

.username-error {
  color: #c0392b;
}

#eventOverlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#eventOverlay:not(.hidden) {
  display: flex;
}

.event-overlay-modal {
  background: #ffffff;
  color: #1d1d1d;
  max-width: 480px;
  width: 92%;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #6c757d;
}

.event-overlay-title {
  margin: 0;
  font-size: 1.4rem;
}

.event-overlay-time {
  margin: 0;
  font-weight: 600;
  color: #495057;
}

.event-overlay-summary {
  margin: 0;
  line-height: 1.5;
}

.event-overlay-source {
  margin-top: 8px;
  color: #0d6efd;
  text-decoration: underline;
  font-weight: 600;
}

.place-events-section {
  margin-top: 24px;
  border-top: 1px solid #e9ecef;
  padding-top: 16px;
}

.place-events-section h5 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: #212529;
}

.place-events-empty {
  margin: 0;
  color: #6c757d;
  font-style: italic;
}

.place-events-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.place-event-item {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.place-event-title {
  font-weight: 600;
  color: #212529;
}

.place-event-time {
  display: inline-block;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f1ff;
  color: #0d6efd;
  width: fit-content;
}

.place-event-summary {
  margin: 0;
  color: #495057;
  font-size: 0.95rem;
}

.place-event-more {
  align-self: flex-start;
  background: transparent;
  border: 1px solid #adb5bd;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
}

.place-event-more:hover {
  border-color: #0d6efd;
  color: #0d6efd;
}

#addPlaceForm input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#autocomplete-results {
  border: 1px solid #ccc;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  background-color: white;
}

#runPlaceSearch {
  padding: 10px 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#runPlaceSearch:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.hidden {
  display: none;
}

#homeView {
  min-width: 0;
  display: none;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

#homeView.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  align-items: stretch;
}

@media (max-width: 900px) {
  body {
    overflow-y: auto;
  }

  #main-content {
    flex-direction: column;
    height: auto;
  }

  #sidebar {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }

  #roomList {
    flex: 1;
    overflow-y: visible;
    max-height: none;
    padding-bottom: 110px;
  }

  #feedContainer,
  .feed-container {
    width: 100%;
    max-width: none;
    border-radius: 0;
    padding: 18px 20px;
    box-shadow: none;
    border-left: none;
    border-right: none;
    background: #f2f3f5;
  }

  .feed-list {
    padding: 0;
    gap: 0;
  }

  #homeView,
  #homeView.active {
    display: block;
    width: 100%;
    padding: 0;
  }

  .feed-card {
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .home-right-pane {
    width: 100%;
    max-width: none;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  #right-sidebar {
    display: none;
  }

  #chatContainer {
    width: 100%;
    padding-bottom: 0;
  }

  #suggestions {
    display: none !important;
  }

  #mapDiscoveryPanel {
    flex: 1;
    min-height: 0;
    height: auto;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
  }

  #mapDiscoveryView {
    flex: 1;
    width: 100%;
    height: 100%;
  }

  .mobile-nav {
    display: flex;
  }

  #chatInputForm {
    position: fixed;
    bottom: calc(62px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    z-index: 1500;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
  }

  #chat {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }
}

.home-right-pane {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  min-height: 0;
  min-width: 0;
  flex: 1 1 auto;
  max-width: none;
  width: 100%;
}

.map-discovery-panel {
  display: flex;
  flex-direction: column;
  border-radius: 0;
  height: 100vh;
  width: 100%;
  color: #e2e8f0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.map-discovery-controls {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 10px 12px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  box-sizing: border-box;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 85%, transparent 100%);
}

.map-category-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 8px 10px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  pointer-events: auto;
  position: relative;
  flex: 1;
}

.map-category-filters::-webkit-scrollbar {
  height: 0;
}

.map-category-empty {
  font-size: 0.85em;
  color: rgba(226, 232, 240, 0.8);
}

.map-category-chip {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  font-size: 0.95em;
  font-weight: 700;
  text-transform: none;
  color: #d1d5db;
  background: #2b2f38;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.1s ease, color 0.16s ease;
  scroll-snap-align: start;
}

.map-category-chip.is-active {
  background: #d1d5db;
  color: #0f172a;
  transform: translateY(-1px);
}

.map-category-chip:active {
  transform: translateY(0);
}

.map-category-nav {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.55);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1em;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
  transition: background 0.18s ease, color 0.18s ease, transform 0.1s ease, opacity 0.18s ease;
}

.map-category-nav:hover {
  background: rgba(255, 255, 255, 0.1);
}

.map-category-nav:active {
  transform: translateY(1px);
}

.map-category-nav.is-hidden {
  opacity: 0.2;
  pointer-events: none;
}

.map-category-filters::before,
.map-category-filters::after {
  content: '';
  position: absolute;
  top: 0;
  width: 18px;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.map-category-filters::before {
  left: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
}

.map-category-filters::after {
  right: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
}

.map-discovery-map {
  flex: 1;
  min-height: 360px;
  border-radius: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.map-discovery-map .leaflet-container {
  width: 100%;
  height: 100%;
}

.leaflet-container .leaflet-control-attribution {
  display: none;
}

.leaflet-control-zoom {
  display: none !important;
}

.map-discovery-map .leaflet-popup-content-wrapper {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border: none;
}

.map-discovery-map .leaflet-popup-tip {
  display: none;
}

.map-discovery-map .leaflet-popup {
  margin: 0;
}

.map-discovery-map .leaflet-popup-content {
  margin: 0;
}

.map-discovery-map .leaflet-popup-close-button {
  width: 28px;
  height: 28px;
  line-height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35);
  text-align: center;
  font-size: 1.1em;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  right: 6px;
  top: 6px;
  pointer-events: auto;
  z-index: 3;
  opacity: 0.95;
}

.map-discovery-map .leaflet-popup-close-button:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.45);
  opacity: 1;
}

.map-popup-card {
  position: relative;
  width: 280px;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

.map-popup-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.map-popup-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 35%, rgba(0, 0, 0, 0.85) 100%);
}

.map-popup-overlay {
  position: absolute;
  inset: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  color: #f8fafc;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.65);
  z-index: 1;
}

.map-popup-title {
  font-size: 1.05em;
  font-weight: 700;
  margin: 0;
}

.map-popup-meta {
  display: flex;
  justify-content: flex-start;
}

.map-popup-pill {
  font-size: 0.65em;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
}

.map-popup-about {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  z-index: 1600;
  padding: 24px;
}

.profile-modal.hidden {
  display: none;
}

.profile-modal-card {
  position: relative;
  width: min(420px, 90vw);
  background: #ffffff;
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 35px 80px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  border: none;
  background: rgba(15, 23, 42, 0.08);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1em;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}

.profile-modal-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-modal-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7em;
  color: #94a3b8;
}

.profile-modal-header h3 {
  margin: 0;
  font-size: 1.4em;
  color: #0f172a;
}

.profile-modal-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-modal-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-modal-avatar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.profile-modal-avatar img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
}

.profile-modal-fields {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-modal-label {
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.profile-modal-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

#profileModalUsernameInput {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 0.95em;
}

.profile-modal-hint {
  margin: 0;
  font-size: 0.85em;
  color: #475569;
}

.profile-modal-section h4 {
  margin: 0 0 8px;
  font-size: 0.9em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
}

.profile-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.profile-modal-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
}

.profile-modal-btn.secondary {
  background: #f1f5f9;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.profile-modal-btn.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 15px 30px rgba(239, 68, 68, 0.3);
}

.feed-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  background: #f2f3f5;
  border-radius: 18px;
  border: none;
  box-shadow: none;
  padding: 18px 20px;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  max-width: none;
}

.feed-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feed-header h2 {
  margin: 0;
  font-size: 1.75em;
  font-weight: 700;
  color: #1a2c3d;
  letter-spacing: -0.01em;
}

.feed-header p {
  margin: 0;
  font-size: 0.95em;
  color: #6b7b8b;
}

.feed-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}

.feed-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.feed-list {
  scrollbar-width: none;
}

.feed-loading,
.feed-error,
.feed-empty {
  text-align: center;
  padding: 24px 12px;
  font-size: 0.95em;
  color: #6c7a8f;
}

.feed-error {
  color: #d9534f;
}

.feed-card {
  position: relative;
  width: 100%;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.feed-card:first-child {
  margin-top: 0;
}

.feed-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.feed-author-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.feed-place-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 10px 2px 2px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: #475569;
  font-size: 0.85em;
  line-height: 1.25;
  vertical-align: middle;
}

.feed-place-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4);
}

.feed-place-chip-name {
  font-weight: 700;
}

.message-container.message-outgoing .feed-author-line {
  color: rgba(236, 241, 255, 0.92);
}

.message-container.message-outgoing .feed-place-chip {
  background: rgba(255, 255, 255, 0.16);
  color: #eef2ff;
}

.message-container.message-outgoing .feed-place-chip-avatar {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.feed-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  font-weight: 600;
  color: #475569;
  margin-top: 6px;
  margin-left: 46px;
}

.feed-typing.is-hidden {
  display: none;
}

.feed-typing-avatars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.feed-typing-avatars .avatar-xs {
  width: 22px;
  height: 22px;
  box-shadow: none;
}

.feed-typing-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.feed-card-new {
  animation: feedFade 0.35s ease;
}

@keyframes feedFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#suggestions {
  flex: 1 1 auto;
  overflow-y: auto;
  background: linear-gradient(180deg, #f5f8ff 0%, #eef2ff 35%, #f8f9ff 100%);
  display: flex;
  flex-direction: column;
  gap: 40px;
  border: 1px solid rgba(15, 23, 42, 0.04);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
  width: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  padding: 0;
}

#suggestions::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#suggestions {
  scrollbar-width: none;
}

.typing-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin: 6px 0 10px;
  padding: 0 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
}

.typing-indicator.show {
  display: flex;
}

.typing-indicator-avatars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.typing-indicator-avatars img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  background: #e5e7eb;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.typing-indicator-avatars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.typing-indicator-avatars img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  background: #e5e7eb;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4);
}

.typing-indicator .typing-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.typing-indicator .typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background-color: #94a3b8;
  opacity: 0.4;
  animation: typingBlink 1.2s infinite ease-in-out;
}

.typing-indicator .typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator .typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBlink {

  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  30% {
    opacity: 0.9;
    transform: translateY(-2px);
  }
}

.reply-btn {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  font-size: 0.8em;
  padding: 0;
}

#reply-preview {
  padding: 5px 10px;
  background-color: #f0f0f0;
  border-left: 3px solid #007bff;
  margin-bottom: 5px;
}

.parent-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9em;
  color: #1f2933;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  background-color: #f3f5f9;
}

.message-bubble.my-message .parent-message {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-left-color: rgba(255, 255, 255, 0.55);
}

.parent-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.parent-message-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
  color: inherit;
}

.parent-message-user {
  font-weight: 600;
  color: inherit;
}

.parent-message-preview {
  font-style: italic;
  opacity: 0.85;
  color: inherit;
}
