/* =========================
   Threads buttons
   ========================= */

.thread-section-action {
  border: 1px solid #dcdcdc;
  color: #111;
  padding: 0.45rem 0.75rem;
  border-radius: 9px;
  font-size: 0.88rem;
  transition: background 0.15s ease, border-color 0.15s ease;
  margin-bottom: 1em;
}

.thread-create-search-results {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 0.5em;
  border-radius: var(--br-l);
  background-color: white;
  width: max-content;
  border: 1px solid #ccc;
  overflow: hidden;
}

.thread-create-search-results button {
  width: 100%;
  text-align: left;
  background-color: transparent;
}

.thread-create-search-results button:hover {
  background-color: whitesmoke;
}

/* =========================
   Create Thread Modal
   ========================= */

.fsapp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 2rem;
}

.fsapp-modal {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.fsapp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.fsapp-modal-body {
  padding: 1.25rem;
}

.fsapp-modal-close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
}

.thread-create-selected-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* =========================
   Shared pagination
   ========================= */

.thread-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
}

.thread-page-button {
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border-color, #d9d9d9);
  background: #fff;
  border-radius: 0.5rem;
  cursor: pointer;
}

.thread-page-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.thread-pagination-info {
  font-size: 0.95rem;
  opacity: 0.8;
}

/* =========================
   Smart insert
   ========================= */

.smart-insert-dropdown {
  display: flex;
  flex-direction: column;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border-color, #d9d9d9);
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.14);
}

.smart-insert-dropdown[hidden] {
  display: none !important;
}

.smart-insert-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.875rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.smart-insert-option:hover,
.smart-insert-option.active {
  background: rgba(0,0,0,0.06);
}