.fc-switch,
.fc-modes,
.fc-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.fc-switch {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  border-bottom: 1px solid #e6edf3;
  padding-bottom: 8px;
}

.fc-switch button,
.fc-modes button,
.fc-filters button {
  min-height: 36px;
  border: 1px solid transparent;
  background: #fff;
  color: #506578;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
}

.fc-switch button[aria-pressed="true"],
.fc-modes button[aria-pressed="true"],
.fc-filters button[aria-pressed="true"] {
  background: #eaf6ff;
  color: #0765b7;
  border-color: #c9e5fa;
  font-weight: 600;
}

.fc-switch button {
  flex: 1;
}

.fc-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fc-layout .fp-list-controls,
.shell[data-client-tab='inbox'] .fc-layout .fp-list-controls {
  display: block;
  padding: 12px;
  margin: 0;
}

.fc-layout > .fp-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fc-rows {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.fc-layout > .fp-chat,
.shell[data-client-tab='inbox'] .fc-layout > .fp-chat {
  display: block;
}

.fc-layout .fc-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  border: 1px solid #dce6ed;
  border-radius: 8px;
  padding-left: 10px;
  color: #687e90;
  background: #fff;
}

.fc-layout svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.fc-layout .fc-search input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  min-height: 40px;
  margin: 0;
  padding: 8px 6px;
}

.fc-sources {
  margin: 0;
  padding: 0;
  font-size: 12px;
}

.fc-sources summary {
  padding: 8px 0 2px;
  cursor: pointer;
  color: #506578;
}

.fc-source {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid #e6edf3;
}

.fc-source span {
  flex-basis: 100%;
  overflow-wrap: anywhere;
}

.fc-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  color: #2272aa;
  background: #edf6fc;
  border-radius: 50%;
  font-weight: 600;
}

.fc-row-state {
  color: #476981;
  font-size: 11px;
  line-height: 1.6;
}

.fc-conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.fc-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #e6edf3;
  flex-shrink: 0;
  margin: 0;
}

.fc-heading > div {
  flex: 1;
  min-width: 0;
}

.fc-heading strong,
.fc-heading small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-heading small {
  font-size: 12px;
  color: #596b7d;
  margin-top: 3px;
}

.fc-heading button,
.fc-comment-actions button,
.fc-operation-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe6ee;
  border-radius: 7px;
  padding: 7px 10px;
  min-height: 38px;
  color: #40617a;
  background: #fff;
  font: inherit;
  font-size: 13px;
}

.fc-detail {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 16px;
  background: #f7fafc;
  overscroll-behavior: contain;
}

.fc-detail p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0;
  line-height: 1.55;
}

.fc-post {
  padding: 10px 12px;
  margin: 0 0 14px;
  border: 1px solid #e0eaf0;
  border-radius: 8px;
  background: #fff;
}

.fc-post summary {
  cursor: pointer;
  color: #60778b;
  font-size: 12px;
}

.fc-post summary strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #354c5f;
  font-weight: 500;
  margin-top: 4px;
}

.fc-reply {
  padding: 12px 14px;
  margin: 0 0 12px;
  border: 1px solid #e0eaf0;
  border-radius: 10px;
  background: #fff;
}

.fc-comment-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.fc-badge {
  font-size: 11px;
  background: #fff2d7;
  color: #725211;
  border-radius: 5px;
  padding: 2px 7px;
}

.fc-detail small,
.fc-detail time {
  color: #60778b;
  font-size: 11px;
}

.fc-detail time {
  display: block;
  margin-top: 4px;
}

.fc-outgoing {
  background: #eff8ff;
  border-color: #dceefc;
  margin-left: 28px;
}

.fc-comment-actions,
.fc-operation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.fc-comment-actions {
  padding-top: 10px;
  border-top: 1px solid #edf1f5;
}

.fc-comment-actions a {
  margin-left: auto;
  font-size: 12px;
}

.fc-comment-actions button[aria-pressed="true"] {
  color: #0765b7;
  border-color: #b8dff9;
  background: #f0f9ff;
}

.fc-detail .fc-action-reason {
  font-size: 12px;
  color: #60778b;
  margin-bottom: 0;
}

.fc-history {
  margin: 12px 0;
  color: #596b7d;
  font-size: 12px;
}

.fc-history summary {
  cursor: pointer;
  padding: 8px 0;
}

.fc-action-event {
  padding: 10px 12px;
  margin: 8px 0;
  border-left: 2px solid #c5d6e3;
  background: #fff;
  font-size: 12px;
}

.fc-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px;
  margin: 0;
  border-top: 1px solid #e0eaf0;
  flex-shrink: 0;
}

.fc-composer textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 64px;
  max-height: 140px;
  font: inherit;
  padding: 10px;
  border: 1px solid #dce6ee;
  border-radius: 8px;
  margin: 0;
}

.fc-composer small,
.fc-blocked {
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  color: #53697d;
}

.fc-send-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.fc-send-row small {
  flex: 1;
  min-width: 0;
}

.fc-composer button[type="submit"] {
  background: #0878d1;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 42px;
  white-space: nowrap;
}

.fc-layout button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.fc-layout button:focus-visible,
.fc-layout summary:focus-visible {
  outline: 2px solid #0878d1;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .fc-heading,
  .fc-detail,
  .fc-composer {
    padding: 10px;
  }

  .fc-heading [data-fp-action="comment-back"] span {
    display: none;
  }

  .fc-modes button {
    flex: 1;
    padding-inline: 6px;
  }

  .fc-outgoing {
    margin-left: 12px;
  }

  .fc-send-row small {
    font-size: 11px;
  }

  .fc-comment-actions a {
    margin-left: 0;
  }

  .fc-heading button,
  .fc-comment-actions button {
    min-height: 42px;
  }
}
