.contribution-workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
  max-width: 1500px;
  margin: 24px auto;
  padding: 0 20px;
}
.chat-dashboard {
  align-self: start;
}
.contribution-picked-location {
  padding: 12px 16px;
  border: 1px solid #c6dbd4;
  border-radius: 14px;
  background: #f0f7f3;
  overflow-wrap: anywhere;
}
.contribution-workspace > #pending-map-location {
  grid-column: 1 / -1;
  grid-row: 1;
}
.contribution-picked-location button {
  margin: 6px;
  min-height: 44px;
}
.chat-location-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chat-location-fields label {
  min-width: 0;
  flex: 1 1 120px;
}
.chat-location-fields input {
  width: 100%;
}
.chat-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.chat-heading h1,
.chat-heading h2 {
  font-size: 24px;
  margin: 8px 0;
}
.thread-card {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line, #ddd);
  padding: 10px 0;
}
.thread-card > button:first-child {
  flex: 1;
  text-align: left;
  min-width: 0;
}
.thread-card strong,
.thread-card small {
  display: block;
  overflow-wrap: anywhere;
}
.thread-card small {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.chat-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  margin-top: 18px;
}
.chat-conversation {
  min-width: 0;
}
#chat-messages {
  max-height: 48dvh;
  min-height: 180px;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.chat-bubble {
  padding: 14px 16px;
  border-radius: 18px;
  background: #f0f4f1;
  max-width: 94%;
  overflow-wrap: anywhere;
}
.chat-user {
  align-self: flex-end;
  background: #e6eee9;
}
.chat-staff {
  border: 1px solid #aec4bb;
}
.chat-bubble p {
  white-space: pre-wrap;
  margin: 6px 0 0;
}
.chat-bubble small {
  font-weight: 700;
}
.chat-info {
  border-left: 1px solid var(--line, #ddd);
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-info label,
#chat-send label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-attached {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
}
.chat-attached img,
.chat-attached video {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
  background: #f0f0eb;
}
.chat-attached audio {
  width: 240px;
  max-width: 100%;
}
#chat-send {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
#ai-suggestions p {
  white-space: pre-wrap;
  font-size: 13px;
}
#toggle-chat-info {
  display: none;
}
.chat-empty {
  min-height: 300px;
}
.chat-welcome {
  padding: 24px;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .contribution-workspace {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .chat-columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .chat-info {
    border-left: 0;
    border-top: 1px solid #ddd;
    padding: 20px 0;
    display: none;
  }
  .info-open .chat-info {
    display: flex;
  }
  #toggle-chat-info {
    display: inline-flex;
  }
  .info-open .chat-conversation {
    display: none;
  }
}
@media (max-width: 700px) {
  .contribution-workspace {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 12px;
    margin: 0 auto;
  }
  .chat-dashboard {
    width: 100%;
  }
  #thread-list {
    max-height: 200px;
    overflow: auto;
  }
  .chat-editor {
    padding: 16px;
  }
  .chat-columns {
    gap: 0;
  }
  #chat-messages {
    max-height: 50dvh;
  }
  .chat-heading h1,
  .chat-heading h2 {
    font-size: 21px;
  }
  #chat-send .actions {
    gap: 5px;
  }
  #chat-send .actions button {
    padding: 8px 10px;
  }
  .chat-info {
    min-height: 65dvh;
  }
}
@media (prefers-reduced-motion: reduce) {
  #chat-messages {
    scroll-behavior: auto;
  }
}
